3 years ago
in English · 2,529 Views
likes 2clips 2comments 5
Basic R Introduction
If you don't already have your computer set up to program in R, then check out this card: http://www.vingle.net/posts/525420-Get-started-with-R CREATING A VECTOR To create a vector you can use the c function like this: x <- c(8,9,16,25, 33) Or you can even use a sequence function if you want to make a vector that has a sequence, such as 5, 10, 15, 20, 25 y <- seq(5,25, by=5) You can also use the repeat function if you want to make a vector of 7 2's (e.g. 2,2,2,2,2,2,2) z <- rep(2, 7) You can add, multiply vectors together x+y y*z As long as they are same length, unless you get an error. For more on basic operations, check out this link: http://www.cyclismo.org/tutorial/R/basicOps.html
csgeek clipped in 1 collections