Social Media Research

02 R Data Analysis


Question

What is the syntax to create a matrix with 2 columns of data?


Answer
> foo = matrix(1:10, ncol=2)
> foo
     [,1] [,2]
[1,]    1    6
[2,]    2    7
[3,]    3    8
[4,]    4    9
[5,]    5   10



Comments