Learning some R programming. R is an opensource statistical package. First part of learning starts with this tutorial:
Chapter 1 reviews some basic information on accessing datasets:
v<-c(1:10) will assign numbers 1 through 10 to variable v
v<-c(10:1) same as above but in reverse
v<-seq(1,10) same as first
v<-seq(10,1) same as second
iris – a sample dataset built into R. if you type iris on the command line, will list all data. variables are case sensitive. If you type “Iris” you will get an error message.
you can view data in ranges:
iris[5:10,5] will show rows 5 through 10, and only colunm 5.
iris[5:10,] will show rows 5 through 10, and all colunms.
iris5<-iris[5:10,] will assign rows 5 through 10, and all colunms to iris5
ls() will list all user variables
rm(v) will remove variable named v