Difference between revisions of "Getting Started with R"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) (Created page with "=Some Commands= <pre> read.table(filename,header=TRUE) # Read tab or space delimited file with a header read.table(filename,header=TRUE,sep=',') # Read csv files ...") |
PeterHarding (talk | contribs) |
||
Line 8: | Line 8: | ||
v2 <- c(1:10) # Create a vector from 1 to 10 | v2 <- c(1:10) # Create a vector from 1 to 10 | ||
v3 <- c(v1,v2) # Concatenate the vectors | |||
matrix1 <- cbind(v1,v2) # Column bind into a 2 x n matrix | |||
ls # List objects | |||
</pre> | </pre> | ||
=Some Links= | =Some Links= | ||
* http://www.personality-project.org/r/r.commands.html | * http://www.personality-project.org/r/r.commands.html |
Revision as of 12:02, 17 September 2013
Some Commands
read.table(filename,header=TRUE) # Read tab or space delimited file with a header read.table(filename,header=TRUE,sep=',') # Read csv files with a header v1 <- c(1,2,3,4,5,6,7) # Create a vector from these values v2 <- c(1:10) # Create a vector from 1 to 10 v3 <- c(v1,v2) # Concatenate the vectors matrix1 <- cbind(v1,v2) # Column bind into a 2 x n matrix ls # List objects