I am rather new to R and struggling with the syntax. I am trying to do simple plots and I can't get anything but errors. Specifically, I would like to know how to plot 3D scatterplots and using polar coordinates. So far I've tried installing the scatterplot3D package and have copied and pasted example code into R but it still returns " "Error: could not find function "scatterplot3D" ". Same thing happens when I've tried polar.plot(...). I don't know if I didn't install the package correctly, the packages don't work on my machine (Windows 7 64bit), or I'm just out in left field... Any suggestions would be much appreciated. Thanks in advanced -- View this message in context: http://r.789695.n4.nabble.com/General-Plotting-Commands-Help-tp3612485p3612485.html Sent from the R help mailing list archive at Nabble.com.
General Plotting Commands Help
3 messages · Deepfish, David Winsemius, William Dunlap
On Jun 20, 2011, at 4:52 PM, Deepfish wrote:
I am rather new to R and struggling with the syntax. I am trying to do simple plots and I can't get anything but errors. Specifically, I would like to know how to plot 3D scatterplots and using polar coordinates. So far I've tried installing the scatterplot3D package and have copied and pasted example code into R but it still returns " "Error: could not find function "scatterplot3D" ". Same thing happens when I've tried polar.plot(...).
Most of the time when getting that message, newbies (and oldies) have forgotten to type: require(scatterplot3d) # NOT scatterplot3D
I don't know if I didn't install the package correctly, the packages don't work on my machine (Windows 7 64bit), or I'm just out in left field...
If you have not installed the package properly, the error message will tell you it cannot be found, and you should always report the complete error message when communicating with r-help!
Any suggestions would be much appreciated. Thanks in advanced -- View this message in context: http://r.789695.n4.nabble.com/General-Plotting-Commands-Help-tp3612485p3612485.html
David Winsemius, MD West Hartford, CT
-----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of David Winsemius Sent: Monday, June 20, 2011 2:07 PM To: Deepfish Cc: r-help at r-project.org Subject: Re: [R] General Plotting Commands Help ... much elided ... Most of the time when getting that message, newbies (and oldies) have forgotten to type: require(scatterplot3d) # NOT scatterplot3D
This is off the topic, but when you use require(packageName)
you only get a warning and an invisibly returned value of FALSE
if the package is not installed so shouldn't it be called
wouldLikeToLoadPackage(packageName)? library(packageName) has
the advantage that it throws an error if packageName is not
installed.
My real question is whether there is a standard function
to load a package, installing it if it is not already installed?
This might be useful in a cloud computing environment, where you
might install just R on a new machine in the cloud and have it
install packages as needed instead of you having to know which
packages need to be installed before running your job. You
would just have to make sure options("repos") was set so that
the install.packages() calls would work.