Re: [R] error in casting matrix

From: Erik Iverson <iverson_at_biostat.wisc.edu>
Date: Tue, 17 Jun 2008 18:23:07 -0500

Paul Adams wrote:
> Hello everyone,
> I am trying to cast a data frame to a matrix I have used the
> following code:
> dat<-read.table(file="C:\\Documents and Settings\.....txt",header=T,row.names=1)
> file.show(file="C:\\Documents and Setting....t.txt")
> Z.matrix<-as.matrix(dat.data.frame)
> but I keep getting the error
> error in as.matrix(dat.data.frame):
> object dat.data.frame not found
> What am I doing wrong?

You are assigning the data.frame returned from read.table to an object named 'dat'. So why are you trying to use an object called 'dat.data.frame' in your call to as.matrix.

Just do as.matrix(dat) if this is what you really want to do.

> Thank You
> Paul
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 18 Jun 2008 - 00:03:23 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 18 Jun 2008 - 02:31:46 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive