Re: [Rd] inappropriate warning in latticeExtra

2018-04-02 Thread Deepayan Sarkar
On Fri, Mar 23, 2018 at 7:58 AM, Richard M. Heiberger  wrote:
> The warning message in the last line of this email is incorrect.
> This is behavior which Duncan Murdoch labeled a bug in
>https://stat.ethz.ch/pipermail/r-help/2017-December/450494.html

Yes, sorry, this has been fixed in the r-forge sources for a while
now, but I haven't had the time to finish up some other fixes and push
an update to CRAN.

Hopefully over the summer break.

Regards,
-Deepayan


> This is a fresh install of R-devel (2018-03-21 r74436)
>
>
>
>
> R Under development (unstable) (2018-03-21 r74436) -- "Unsuffered 
> Consequences"
> Copyright (C) 2018 The R Foundation for Statistical Computing
> Platform: x86_64-w64-mingw32/x64 (64-bit)
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
>   Natural language support but running in an English locale
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>
>> library(latticeExtra)
> Error in library(latticeExtra) :
>   there is no package called ‘latticeExtra’
>> install.packages("latticeExtra")
> Warning in install.packages("latticeExtra") :
>   'lib = "C:/Program Files/R/R-devel/library"' is not writable
> --- Please select a CRAN mirror for use in this session ---
> also installing the dependency ‘RColorBrewer’
>
> Warning: unable to access index for repository
> http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.5:
>   cannot open URL
> 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.5/PACKAGES'
> trying URL 
> 'https://cran.wu.ac.at/bin/windows/contrib/3.5/RColorBrewer_1.1-2.zip'
> Content type 'application/zip' length 55444 bytes (54 KB)
> downloaded 54 KB
>
> trying URL 
> 'https://cran.wu.ac.at/bin/windows/contrib/3.5/latticeExtra_0.6-28.zip'
> Content type 'application/zip' length 2191524 bytes (2.1 MB)
> downloaded 2.1 MB
>
> package ‘RColorBrewer’ successfully unpacked and MD5 sums checked
> package ‘latticeExtra’ successfully unpacked and MD5 sums checked
>
> The downloaded binary packages are in
> 
> C:\Users\rmh.DESKTOP-60G4CCO\AppData\Local\Temp\RtmpqA7Rqg\downloaded_packages
>> library(latticeExtra)
> Loading required package: lattice
> Loading required package: RColorBrewer
>> a <- xyplot(1 ~ 1)
>> c(a,a)
> Warning message:
> In formals(fun) : argument is not a function
>>
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] recordPlot/replayPlot not working with saveRDS/readRDS

2018-04-02 Thread Winston Chang
The documentation for recordPlot says the following:

> As of R 3.3.0, it is possible (again) to replay a plot from another R session 
> using, for example, saveRDS and readRDS.

However, I haven't been able to save and restore a plot displaylist
and have it work within the same R session, using R 3.4.3 or 3.3.3.
Here's an example:

# Save displaylist for a simple plot
png('test.png')
dev.control(displaylist ="enable")
plot(1:5, 1:5)
r <- recordPlot()
dev.off()

# Replay plot. This works.
png('test1.png')
replayPlot(r)
dev.off()

#  Save the plot and load it, then try to replay it. This does not work.
saveRDS(r, 'recordedplot.rds')
r2 <- readRDS('recordedplot.rds')
png('test2.png')
replayPlot(r2)  ## Error: NULL value passed as symbol address
dev.off()


Is there something that I'm doing wrong here?

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [FORGED] recordPlot/replayPlot not working with saveRDS/readRDS

2018-04-02 Thread Paul Murrell

Hi

What you are doing "wrong" is loading a recordedplot into the same 
session that it was created in.  The saveRDS()/readRDS() works if you 
save in one R session and then read in a different R session.  The 
assumption is that if you are still in the same session that created the 
recordedplot you still have the recordedplot (e.g., you can just do 
replayPlot(r) instead of replayPlot(r2).  Is that a bad assumption ?


Paul

On 03/04/18 05:23, Winston Chang wrote:

The documentation for recordPlot says the following:


As of R 3.3.0, it is possible (again) to replay a plot from another R session 
using, for example, saveRDS and readRDS.


However, I haven't been able to save and restore a plot displaylist
and have it work within the same R session, using R 3.4.3 or 3.3.3.
Here's an example:

# Save displaylist for a simple plot
png('test.png')
dev.control(displaylist ="enable")
plot(1:5, 1:5)
r <- recordPlot()
dev.off()

# Replay plot. This works.
png('test1.png')
replayPlot(r)
dev.off()

#  Save the plot and load it, then try to replay it. This does not work.
saveRDS(r, 'recordedplot.rds')
r2 <- readRDS('recordedplot.rds')
png('test2.png')
replayPlot(r2)  ## Error: NULL value passed as symbol address
dev.off()


Is there something that I'm doing wrong here?

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel



--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
p...@stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel