Tuesday, January 19, 2010

Making a Vector
x=c(1,2,3)
x=(0:100)
x=(0:10)*10
x=seq(0,1000,10)
y=rep(c(1,2,3,4,5),20)
Making a Matrix
year=c(1800,1850,1900,1950,2000) ### create a vector called 'year' with 5 values
carbon=c(8,54,534,1630,6611) ###create a vector called 'carbon' with 5 values
datum=data.frame(year=year,carbon=carbon)