[R] Using the Rprofile file to automatically plot data on Startup of R version 2.0.1.
Berton Gunter
gunter.berton at gene.com
Thu Jan 6 02:16:01 CET 2005
See ?Startup and the rw FAQ for info on startup procedures. I assume by
"Rprofile file" you mean Rprofile.site. As ?options --> defaultPackages
states, the graphics library is one of those loaded by default but, as
?Startup states, **not** until after Rprofile.site is executed. Since
plot()is now in the graphics library and not in base, it is not present when
you try to execute your plot commands -- ergo the error. So explicitly load
the library by calling library(graphics) ** before ** you plot, and you
should then be able to do your plotting.
-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of John Fisler
> Sent: Wednesday, January 05, 2005 2:51 PM
> To: r-help at lists.R-project.org; John Fisler
> Subject: [R] Using the Rprofile file to automatically plot
> data on Startup of R version 2.0.1.
>
> Dear R Help Members,
>
> I have some R functions that plot semiconductor data. I
> would like to
> automate these plots for individuals in our group such that
> they don't
> have to know R. I have read the R help manuals and postings but have
> not found this problem.
>
> I am using R version 2.0.1 under a Windows 2000 operating system.
>
> The following is a simplified version of what I am tring to do:
>
> If I insert the following R code in the Rprofile file located in
> directory 'C:\Program Files\R\rw2001\etc':
>
> x <- c(1,2,3,4,5)
> y <- c(2,5,6,3,10)
> plot(x,y)
>
> Using the Rgui.exe or the R.exe terminal version of R the following
> message appears:
>
> Error: couldn't find function "plot"
>
> If I copy and paste the command 'plot(x,y)' into the R Console Window
> the scatter plot appears in the R Graphics Device window as expected.
>
> I have also tried putting the above code in a 'R' script file
> and using
> the source command but I get the same error message.
>
> Any help would be appreciated.
>
> Thank you.
>
> John Fisler
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
More information about the R-help
mailing list