Re: [R] 3d plotting

From: Brad B <the13thday_at_yahoo.com>
Date: Tue, 18 Dec 2007 12:21:36 -0800 (PST)


that worked.
  however Im trying to get a surface countour like persp() would show.   Since I dont have a matrix data set, I assumed that the wireframe function would do.   since I get an error using wireframe,
  no applicable method for "wireframe"
  I am using this plot3d. I was under the impression that plot3d would do similar as wireframe or persp but its not.    

  any other advice would be great.   

Scionforbai <scionforbai_at_gmail.com> wrote:   > 60,000

I hope that you actually haven't got any comma to separate the thousands... it separates fields in a csv files (as the "Comma Separated Values" name may suggest). If so, get rid of the commas.

> the 3dplot function returns this error,
> (list) object cannot be coerced to 'double'

> td<-read.csv("td.csv", header=TRUE)
> price<-read.csv("price.csv", header=TRUE)
> contractdate<-read.csv("contractdate.csv", header=TRUE)

You have to coerce the 1-column dataframes created by read.csv to numeric vectors or to a 60000x3 dataframe. solution 1:

myData <- cbind(td,contractdate,price)

> library(rgl)

plot3d(mydata)

solution 2:

td <- as.numeric(td)
...
price <- as.numeric(price)
plot3d(td,contractdate,price)

Bye,

ScionForbai        


        [[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. Received on Tue 18 Dec 2007 - 20:26:01 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 Tue 18 Dec 2007 - 20:30:20 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.