[R] Assigning to multiple variables

Scott Romans scott.romans at mac.com
Sun Apr 13 22:56:01 CEST 2008


If we have a function that returns 2 or more values (such as dim as  
applied to a matrix), can we assign these 2 or more values to an equal  
number of differently named variables in one line? For example, is  
there any way to do something like this:

[NumberRows NumberColumns] <- dim(MatrixA)

Thanks in advance!

Scott



More information about the R-help mailing list