[R] matrix input

Jason Turner jasont at indigoindustrial.co.nz
Thu Oct 17 09:36:27 CEST 2002

On Thu, Oct 17, 2002 at 10:56:28AM -0500, Feng Zhang wrote:
> Hey, all
> Will u please tell me how to input a matrix (n x m) A
> in R?
> I cannot find such commond in the manual.

Weird.  I found it hard to miss.  Where did you look?

By "input" what do you mean?  Type it in from the R-prompt, or read
it off a disk, download from a url connection, load it from a database
server, copy it from an SAS export file, or ...

I think the two most likely questions you're trying to ask are
1) type it in.  For example:
A <- matrix(c(1,2,4,5,6,9),nrow=2)

2) read it off disk.
For that, you'll need the R Data Import/Export Manual that
came with your R distribution.  If you can't find that,
look here:



Indigo Industrial Controls Ltd.
jasont at indigoindustrial.co.nz
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list