Re: [R] Updata Rdata File

2010-11-18 Thread Joshua Wiley
Hi Jason,

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:

> ls()
character(0)
> load("rhelp.RData")
> ls()
[1] "x"
> ## 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
> save(x, y, file = "rhelp.RData")
> ## clear space and show it is empty
> rm(list=ls()); ls()
character(0)
> load("rhelp.RData")
> ls()
[1] "x" "y"
> ## now both 'x' and 'y' are in the RData file
> ## if I had just edited x and resaved, it would be updated

Cheers,

Josh

On Thu, Nov 18, 2010 at 7:26 AM, Jason Kwok  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.
> load(file="C:\\datafile.rdata")
> save(data,file="C:\\datafile.rdata")
>
> Thanks.
>
> Jason
>
> On Thu, Nov 18, 2010 at 6:56 AM, Duncan Murdoch 
> 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@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Updata Rdata File

2010-11-18 Thread Jeff Newmiller
?rbind

"Jason Kwok"  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.
>load(file="C:\\datafile.rdata")
>save(data,file="C:\\datafile.rdata")
>
>Thanks.
>
>Jason
>
>On Thu, Nov 18, 2010 at 6:56 AM, Duncan Murdoch
>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@r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

---
Jeff NewmillerThe .   .  Go Live...
DCN:Basics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
---
Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Updata Rdata File

2010-11-18 Thread Jason Kwok
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.
load(file="C:\\datafile.rdata")
save(data,file="C:\\datafile.rdata")

Thanks.

Jason

On Thu, Nov 18, 2010 at 6:56 AM, Duncan Murdoch 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@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Updata Rdata File

2010-11-18 Thread Duncan Murdoch

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

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.