similar to: saveRDS()/readRDS() on environments

Displaying 20 results from an estimated 1000 matches similar to: "saveRDS()/readRDS() on environments"

2018 Apr 02
0
[FORGED] recordPlot/replayPlot not working with saveRDS/readRDS
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
2018 Apr 03
1
[FORGED] recordPlot/replayPlot not working with saveRDS/readRDS
>>>>> Paul Murrell <paul at stat.auckland.ac.nz> >>>>> on Tue, 3 Apr 2018 09:41:56 +1200 writes: > 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
2018 Apr 02
3
recordPlot/replayPlot not working with saveRDS/readRDS
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
2012 Sep 15
2
Risk of readRDS() not detecting race conditions with parallel saveRDS()?
I hardly know anything about the format used in (non-compressed) serialization/RDS, but hoping someone with more knowledge could give me some feedback; Consider two R processes running in parallel on the same unknown file system. Both of them write and read to the same RDS file foo.rds (without compression) at random times using saveRDS(object, file="foo.rds", compress=FALSE) and
2011 Oct 18
9
readRDS and saveRDS
Hi all, Is there any chance that readRDS and saveRDS might one day become read.rds and write.rds? That would make them more consistent with the other reading and writing functions. Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/
2017 Aug 09
1
Problem with serialization via readRDS() on a textConnection()
(Sorry for not linking to your message; I accidentally deleted the original copy of your message.) Your code > zz = textConnection('tempConnection', 'wb') > saveRDS(c("a", "b", "c"), zz, ascii = TRUE) > serialized_obj = paste(textConnectionValue(zz), collapse='\n') > readRDS(textConnection(serialized_obj)) Error in
2017 Aug 22
0
How to benchmark speed of load/readRDS correctly
You need to study how reading files works in your operating system. This question is not about R. -- Sent from my phone. Please excuse my brevity. On August 22, 2017 5:53:09 AM PDT, raphael.felber at agroscope.admin.ch wrote: >Dear all > >I was thinking about efficient reading data into R and tried several >ways to test if load(file.Rdata) or readRDS(file.rds) is faster. The
2017 Aug 08
0
Problem with serialization via readRDS() on a textConnection()
Hi All, I had working code under R v3.2 that serialized an object, stored the serialized object in a database, and then successfully retrieved and hydrated that object. I recently updated to R v3.4.1 and the same code now fails. Here is the code in question (simplified), and the resulting error: > zz = textConnection('tempConnection', 'wb') > saveRDS(c("a",
2017 Aug 22
0
How to benchmark speed of load/readRDS correctly
The large value for maximum time may be due to garbage collection, which happens periodically. E.g., try the following, where the unlist(as.list()) creates a lot of garbage. I get a very large time every 102 or 51 iterations and a moderately large time more often mb <- microbenchmark::microbenchmark({ x <- as.list(sin(1:5e5)); x <- unlist(x) / cos(1:5e5) ; sum(x) }, times=1000)
2017 Aug 22
1
How to benchmark speed of load/readRDS correctly
Note that if you force a garbage collection each iteration the times are more stable. However, on the average it is faster to let the garbage collector decide when to leap into action. mb_gc <- microbenchmark::microbenchmark(gc(), { x <- as.list(sin(1:5e5)); x <- unlist(x) / cos(1:5e5) ; sum(x) }, times=1000, control=list(order="inorder")) with(mb_gc,
2017 Aug 22
4
How to benchmark speed of load/readRDS correctly
Dear all I was thinking about efficient reading data into R and tried several ways to test if load(file.Rdata) or readRDS(file.rds) is faster. The files file.Rdata and file.rds contain the same data, the first created with save(d, ' file.Rdata', compress=F) and the second with saveRDS(d, ' file.rds', compress=F). First I used the function microbenchmark() and was a astonished
2014 Oct 17
1
Making parent.env<- an error for package namespaces and package imports
I'd like to propose a change to the R language so that calling 'parent.env<-' on a package namespace or package imports is a runtime error. Currently the documentation warns that it's dangerous behaviour and might go away: The replacement function ?parent.env<-? is extremely dangerous as it can be used to destructively change environments in ways that violate
2015 Jan 15
0
Request to speed up save()
In addition to the major points that others made: if you care about speed, don't use compression. With today's fast disks it's an order of magnitude slower to use compression: > d=lapply(1:10, function(x) as.integer(rnorm(1e7))) > system.time(saveRDS(d, file="test.rds.gz")) user system elapsed 17.210 0.148 17.397 > system.time(saveRDS(d,
2012 Jul 29
1
readRDS, In as.double.xts(fishReport$count) : NAs introduced by coercion
Hello, I looked in the R-help but could not find an archive addressing the following. I would like to convert a character to numeric after reading a file with RDS extension. After using as.numeric, I checked if it is numeric. It was not converted. Please help. Here is my code >Report <- readRDS(file="RDS/Report.RDS") > Report[1:2,] dive_id date
2018 Apr 22
0
Problem reading RDS files
Wouldn't the obvious problem be that your data file is corrupted or was never created using saveRDS in the first place? Can you show us a complete example of creating and attempting to read what was just created? On April 22, 2018 10:20:05 AM CDT, mohammad moradi <mri.moradi at gmail.com> wrote: >Hi there, > >I faced a weird problem doing a seemingly simple task in R.
2009 Dec 16
2
What is the fastest way to see what are in an RData file?
Currently, I load the RData file then ls() and str(). But loading the file takes too long if the file is big. Most of the time, I only interested what the variables are in the the file and the attributes of the variables (like if it is a data.frame, matrix, what are the colnames/rownames, etc.) I'm wondering if there is any facility in R to help me avoid loading the whole file.
2018 Feb 07
1
saveRDS() overwrites file when object is not found
I ran into this behaviour when accidentally running a line of code that I shouldn't have. When saving over an rds with an object that's not found, I would have expected saveRDS to not touch the file. saveRDS(iris, "test.rds") file.size("test.rds") #> [1] 1080 saveRDS(no_object_here, "test.rds") #> Error in saveRDS(no_object_here, "test.rds"):
2006 Feb 08
1
corruption of data with serialize(ascii=TRUE)
I noticed the following peculiarity with `serialize()' when `ascii = TRUE' is used. In today's (svn r37299) R-devel, I get > set.seed(10) > x <- rnorm(10) > > a <- serialize(x, con = NULL, ascii = TRUE) > b <- unserialize(a) > > identical(x, b) ## FALSE [1] FALSE > x - b [1] -3.469447e-18 2.775558e-17 -4.440892e-16 0.000000e+00
2018 Apr 23
1
Problem reading RDS files
I've tried to re-experiment the tutorial presented at http://www.rdatamining.com/docs/twitter-analysis-with-r and specifically aimed to use rds files (tweet records) at http://www.rdatamining.com/data/. On Sun, Apr 22, 2018 at 9:16 PM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: > Wouldn't the obvious problem be that your data file is corrupted or was > never created
2018 Nov 03
1
odd NOTE in R CMD check of data; Rcpp module related
With the current version of the "raster" package (that I maintain), R CMD check on packages "soilDB" and "PopGenReport" have this NOTE: Package: soilDB Check: data for non-ASCII characters New result: NOTE Error in .requirePackage(package) : unable to find required package 'raster' Calls: <Anonymous> ... .findInheritedMethods ->