add data from .RData file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

add data from .RData file

uday
I got two .RData file e.g data.2005.RData & data.2006.RData
I would like to combine these two different data set and make single RData file.
in both file there are some NULL files are also available and I would like to clear this NULL files also.
$ : NULL
 $ : NULL
 $ : num [1:43285, 1:8] -21.1 -21.1 -24.9 -24.9 -24.9 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : NULL
  .. ..$ : chr [1:8] "latitude" "longitude" "time" "ch4" ...
 $ : num [1:44730, 1:8] 5.74 5.74 5.74 -21.06 -21.06 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : NULL
  .. ..$ : chr [1:8] "latitude" "longitude" "time" "ch4" ...

I never worked with RData files, so it will be very nice if somebody can help me to do this operation.
Reply | Threaded
Open this post in threaded view
|

Re: add data from .RData file

Sarah Goslee
You can use load() to load them both, if they do not have objects with
identical names, then save() to make a new RData file.

I'm not clear on what you mean by a NULL file, though. If you know
which objects you want to get rid of, you can do that with rm().

Sarah

On Wed, Mar 7, 2012 at 12:46 PM, uday <[hidden email]> wrote:

> I got two .RData file e.g data.2005.RData & data.2006.RData
> I would like to combine these two different data set and make single RData
> file.
> in both file there are some NULL files are also available and I would like
> to clear this NULL files also.
> $ : NULL
>  $ : NULL
>  $ : num [1:43285, 1:8] -21.1 -21.1 -24.9 -24.9 -24.9 ...
>  ..- attr(*, "dimnames")=List of 2
>  .. ..$ : NULL
>  .. ..$ : chr [1:8] "latitude" "longitude" "time" "ch4" ...
>  $ : num [1:44730, 1:8] 5.74 5.74 5.74 -21.06 -21.06 ...
>  ..- attr(*, "dimnames")=List of 2
>  .. ..$ : NULL
>  .. ..$ : chr [1:8] "latitude" "longitude" "time" "ch4" ...
>
> I never worked with RData files, so it will be very nice if somebody can
> help me to do this operation.
>
> --


--
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: add data from .RData file

uday
HI Sarah, thanks for reply

your method works

what I did
load (" data.2005")
load ( "data.2006")
then
data.new<- c( data.2005, data.2006)  or we can save it as a new .RData also.

The NULL files I can remove by selecting particular file number
e.g data.new<- c( data.2005[1:3], data.2006[4:6])

cheers
Uday  
Reply | Threaded
Open this post in threaded view
|

Re: add data from .RData file

David Winsemius

On Mar 7, 2012, at 3:16 PM, uday wrote:

> HI Sarah, thanks for reply
>
> your method works
>
> what I did
> load (" data.2005")
> load ( "data.2006")
> then
> data.new<- c(  or we can save it as a new .RData also.

That looks failure prone. You have removed the context of your  
original question ( and PLEASE stop doing that despite the fact that  
the Nabble interface leads to to think that the rest of us see  
it) .... but I seem to remember that you had the same number of  
columns, so:

data.new <- cbind ( data.2005, data.2006 )
save(data.new, file="data.new.RData")

>
>
> The NULL files I can remove by selecting particular file number
> e.g data.new<- c( data.2005[1:3], data.2006[4:6])
>

--

David Winsemius, MD
West Hartford, CT

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: add data from .RData file

uday
This post has NOT been accepted by the mailing list yet.
Hey David ,
Sorry and Thanks for suggestion
Reply | Threaded
Open this post in threaded view
|

Re: add data from .RData file

David Winsemius
In reply to this post by David Winsemius

On Mar 7, 2012, at 3:39 PM, David Winsemius wrote:

>
> On Mar 7, 2012, at 3:16 PM, uday wrote:
>
>> HI Sarah, thanks for reply
>>
>> your method works
>>
>> what I did
>> load (" data.2005")
>> load ( "data.2006")
>> then
>> data.new<- c(  or we can save it as a new .RData also.
>
> That looks failure prone. You have removed the context of your  
> original question ( and PLEASE stop doing that despite the fact that  
> the Nabble interface leads to to think that the rest of us see  
> it) .... but I seem to remember that you had the same number of  
> columns, so:
>
>     data.new <- cbind ( data.2005, data.2006 )
                  ^^^^^^^
I meant to suggest rbind(         )
> save(data.new, file="data.new.RData")
>
>>
>>
>> The NULL files I can remove by selecting particular file number
>> e.g data.new<- c( data.2005[1:3], data.2006[4:6])
>>

David Winsemius, MD
West Hartford, CT

______________________________________________
[hidden email] 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.