Re: [R] small object but huge RData file exported

2021-10-21 Thread Duncan Murdoch
On 21/10/2021 2:09 a.m., Jinsong Zhao wrote: This example has demoed the similar or same characteristics of my question. If I > save(formula, file = "abc.RData") and then in a new launched R session, I > load("abc.RData") > formula x ~ y I want to know what are stored in the , and how

Re: [R] small object but huge RData file exported

2021-10-21 Thread Jinsong Zhao
Thanks a lot for your kindly reply and explanation. Environment is something hard for me. I will follow the advice from Duncan and Jeff. Best, Jinsong On 2021/10/21 14:36, Jeff Newmiller wrote: That depends what was in the active environment when you created that formula. You would probably

Re: [R] small object but huge RData file exported

2021-10-21 Thread Jeff Newmiller
That depends what was in the active environment when you created that formula. You would probably benefit from reading https://adv-r.hadley.nz/environments.html about now, though you are about to enter a complex interaction between functions, formulas and environments. A rational option is

Re: [R] small object but huge RData file exported

2021-10-21 Thread Jinsong Zhao
This example has demoed the similar or same characteristics of my question. If I > save(formula, file = "abc.RData") and then in a new launched R session, I > load("abc.RData") > formula x ~ y I want to know what are stored in the , and how to access it, or how to save the object without the

Re: [R] small object but huge RData file exported

2021-10-20 Thread Henrik Bengtsson
Example illustrating what Duncan says: > make_formula <- function() { large <- rnorm(1e6); x ~ y } > formula <- make_formula() # "Apparent" size of object > object.size(formula) 728 bytes # Actual serialization size > length(serialize(formula, connection = NULL)) [1] 8000203 # A better size

Re: [R] small object but huge RData file exported

2021-10-20 Thread Duncan Murdoch
On 20/10/2021 9:20 a.m., Jinsong Zhao wrote: On 2021/10/20 21:05, Duncan Murdoch wrote: On 20/10/2021 8:57 a.m., Jinsong Zhao wrote: Hi there, I have a RData file that is obtained by save.image() with size about 74.0 MB (77,608,222 bytes). When load into R, I measured the size of each object

Re: [R] small object but huge RData file exported

2021-10-20 Thread Jinsong Zhao
On 2021/10/20 21:05, Duncan Murdoch wrote: On 20/10/2021 8:57 a.m., Jinsong Zhao wrote: Hi there, I have a RData file that is obtained by save.image() with size about 74.0 MB (77,608,222 bytes). When load into R, I measured the size of each object with object.size():

Re: [R] small object but huge RData file exported

2021-10-20 Thread Duncan Murdoch
On 20/10/2021 8:57 a.m., Jinsong Zhao wrote: Hi there, I have a RData file that is obtained by save.image() with size about 74.0 MB (77,608,222 bytes). When load into R, I measured the size of each object with object.size(): object.size(combn.rda.m) 105448 bytes object.size(cross) 102064

[R] small object but huge RData file exported

2021-10-20 Thread Jinsong Zhao
Hi there, I have a RData file that is obtained by save.image() with size about 74.0 MB (77,608,222 bytes). When load into R, I measured the size of each object with object.size(): object.size(combn.rda.m) 105448 bytes object.size(cross) 102064 bytes object.size(denitr.1) 25032 bytes