Creating a 2d Array in R

September 3, 2008

Simple, first of all create a variable that contains (n*m) elements

>  a = rnorm(100*100, mean=100,sd=1)

then dimension it

> dim(a) = c(1000,10)

where the first parameter is the number of rows, and the second the number of columns.  Easy.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: