Friday, November 8, 2013

R – Perform Simple Addition

So let’s get started guys.
We’ll start with the basics and gradually look into more complex uses.
> 1+1
[1] 2
> 



Now, we can get the list of number using “:”, so lets see that
> (1:10)
 [1]  1  2  3  4  5  6  7  8  9 10
> 



So as you can see above we got a list from 1 to 10.

Now, there’s one more way we can add a number to a list.
> (1:10)+5
 [1]  6  7  8  9 10 11 12 13 14 15
> 


So as you can see, we 5 to all the number between 1 to 10.
Technorati Tags: ,,,,,,,,,,,,,,,

Windows Live Tags: Statistical ,R,Perform,Simple,Addition,basics,Courier,Monospace,margin,width,csharpcode,kwrd,preproc,html,attr,lnum


WordPress Tags: Statistical ,R,Perform,Simple,Addition,basics,Courier,Monospace,margin,width,csharpcode,kwrd,preproc,html,attr,lnum


Blogger Labels: Statistical ,R,Perform,Simple,Addition,basics,Courier,Monospace,margin,width,csharpcode,kwrd,preproc,html,attr,lnum

R–Variables

Using variables in R isn’t as hard as it might appear to be.

Let’s see an example.

> c <- 3
> print(c)
[1] 3
>



So in the example above we use a variable named “c” and assign it a value of 3. We also use print command to print the value stored in the variable.

> b <- "Hi"
> b
[1] "Hi"
> print(b)
[1] "Hi"
>



In this example we assign a string value to the variable.


Now let’s see a case when we try to assign multiple values to a variable.

> g <- (6:80)
> g
[1] 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
[27] 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
[53] 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
>



 


 


Technorati Tags: ,,,,,,,,,,,,,,

Windows Live Tags: Variables,example,size,Consolas,Courier,Monospace,margin,width,csharpcode,ffffff,kwrd,preproc,html,attr,lnum


WordPress Tags: Variables,example,size,Consolas,Courier,Monospace,margin,width,csharpcode,ffffff,kwrd,preproc,html,attr,lnum


Blogger Labels: Variables,example,size,Consolas,Courier,Monospace,margin,width,csharpcode,ffffff,kwrd,preproc,html,attr,lnum

Thursday, November 7, 2013

R–Window Configuration

We can configure the appearance of User Interface windows within R.

Go to Edit –> GUI Preferences

image

Now with this setting when you open new script window.

File –> New Script then the UI will be like

image

Alternatively, if you prefer Single User Interface, then you can change the UI Preferences using Edit –> GUI Preferences

image

Focus on 1st Row : Select SDI Radio Button and change Pager Style to single window radio button. Save the settings and restart R.

Now the R UI console will appear as shown below:

image

You’ve successfully realigned the UI.

Windows Live Tags: Free Statistical Tool,Statistical Tool,R-Configuration,R-Introduction,R,Configuration,User,Interface,Edit,Preferences,script,File,Single,Focus,Select,Radio,Button,Pager,Style,Save,settings
Blogger Labels: Free Statistical Tool,Statistical Tool,R-Configuration,R-Introduction,R,Configuration,User,Interface,Edit,Preferences,script,File,Single,Focus,Select,Radio,Button,Pager,Style,Save,settings

R Installation

 

You can download and Install R from here.

You need select the appropriate OS and OS version and download from the CRAN site.

While Installation is in progress you’ll get an option to choose between custom settings and typical settings. For the general usage restrict yourself to typical settings.

Windows Live Tags: Statistical Tool,R,Installation,Install,version,CRAN,option,custom,settings,usage
WordPress Tags: Statistical Tool,R,Installation,Install,version,CRAN,option,custom,settings,usage
Blogger Labels: Statistical Tool,R,Installation,Install,version,CRAN,option,custom,settings,usage

R–Introduction

 

R is a free and powerful statistical software which can run cross platform.

R is gaining popularity primarily due to its computational capabilities and then also due to the free availability of the tool.

You can download the software here.

R logo

Windows Live Tags: Statistical tool,R,Introduction,platform,capabilities,tool,software
WordPress Tags: Statistical tool,R,Introduction,platform,capabilities,tool,software
Blogger Labels: Statistical tool,R,Introduction,platform,capabilities,tool,software