[R] Updata Rdata File
jwiley.psych at gmail.com
Thu Nov 18 17:31:27 CET 2010
You can add as many objects as you want to save(). For instance:
save(data1, data2, data3, data4, file = "whatever"). Once you have
loaded the data, just add whatever data you want, and then save it (or
edit your original object and resave it). Here is another example:
> ## Now I could edit, 'x' (e.g., rbind() in additional rows, etc.)
> ## or I could create a new variable, 'y'
> y <- 1:10 # some new data
> ## from
> save(x, y, file = "rhelp.RData")
> ## clear space and show it is empty
> rm(list=ls()); ls()
 "x" "y"
> ## now both 'x' and 'y' are in the RData file
> ## if I had just edited x and resaved, it would be updated
On Thu, Nov 18, 2010 at 7:26 AM, Jason Kwok <jaykwok at gmail.com> wrote:
> Thanks for the response Duncan.
> I'm sorry I wasn't clear in my question. I need to add an additional value
> every day to the data and not update it.
> I know how to load and save but I dont' know how to add data.
> On Thu, Nov 18, 2010 at 6:56 AM, Duncan Murdoch <murdoch.duncan at gmail.com>wrote:
>> On 18/11/2010 1:49 AM, Jason Kwok wrote:
>>> How do I add data to a .rdata file? In my case, I have a time series that
>>> needs to get updated every day.
>> Load it, update the variables, save them.
>> Duncan Murdoch
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Ph.D. Student, Health Psychology
University of California, Los Angeles
More information about the R-help