viewing, editing and saving an RDATA file

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

viewing, editing and saving an RDATA file

Jason Levy
Dear R Scholars
Many R users have successfully loaded and used the attached WVS RDATA file
into my R program. I would just would like help viewing, editing etc.
It is only one line of code to load in.
*load('WVS.RData')*

I would like help on how to view, edit and save this 2.461 MB RData file.
There have been so many questions and answers about this topic but I am at
my wits end. I apologize for asking such a basic question. I ave

I have tried this command and I cannot even view it, let alone edit the file
y <- load('WVS.RData')
head(y)

thank you for your guidance, Jack
______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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: viewing, editing and saving an RDATA file

Jim Lemon-4
Hi Jason,
I assume that you actually have "WVS.RData" in your working directory
when you try to load it. Otherwise you will get an error message. If
you don't get an error message when you do this:

load("WVS.RData")

there will be a new object in your workspace. So if you want to see
what the object is, try this:

objects()
load("WVS.RData")
objects()

Unless you have already run the "load" command, there will be a new
object in the list. That is what you're looking for. Say that object
is named "x". You can look at the first part of it with:

head(x)

and maybe do some basic editing with:

edit(x)

Good luck.

Jim

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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: viewing, editing and saving an RDATA file

David Winsemius
In reply to this post by Jason Levy

On 7/21/20 9:11 PM, Jason Levy wrote:
> Dear R Scholars
> Many R users have successfully loaded and used the attached WVS RDATA file
> into my R program.


You appear to have made a common mistake in assuming that attachments of
any sort can be processed by the Rhelp mail-server. Only attachments of
type postscript, PDF and plain-text can survive the scrubbing process.
It is possible to make an attachment that will hold a faithful
representation of R objects using dput or dump, but they must have
extension .txt when attached by mail-clients.


--

David.

> I would just would like help viewing, editing etc.
> It is only one line of code to load in.
> *load('WVS.RData')*
>
> I would like help on how to view, edit and save this 2.461 MB RData file.
> There have been so many questions and answers about this topic but I am at
> my wits end. I apologize for asking such a basic question. I ave
>
> I have tried this command and I cannot even view it, let alone edit the file
> y <- load('WVS.RData')
> head(y)
>
> thank you for your guidance, Jack
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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: viewing, editing and saving an RDATA file

Robert Baer
In reply to this post by Jim Lemon-4
You may misunderstand how RData files work.  Note that RData files are
not necessarily JUST a single variable unless they were explicitly
written to store a single variable only.

If you save a single variable (a dataframe, for example) named 'mydata'
with save(mydata, file = "saveddata.RData") and then load the variable
back into a new R session with y  <- load("saveddata.RData"), your data
will still be contained in a variable named 'mydata',  not renamed  y.

Look at ?load and ?save

On 7/22/2020 5:47 AM, Jim Lemon wrote:

> Hi Jason,
> I assume that you actually have "WVS.RData" in your working directory
> when you try to load it. Otherwise you will get an error message. If
> you don't get an error message when you do this:
>
> load("WVS.RData")
>
> there will be a new object in your workspace. So if you want to see
> what the object is, try this:
>
> objects()
> load("WVS.RData")
> objects()
>
> Unless you have already run the "load" command, there will be a new
> object in the list. That is what you're looking for. Say that object
> is named "x". You can look at the first part of it with:
>
> head(x)
>
> and maybe do some basic editing with:
>
> edit(x)
>
> Good luck.
>
> Jim
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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: viewing, editing and saving an RDATA file

Bert Gunter-2
Inline

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Wed, Jul 22, 2020 at 2:29 PM Robert Baer <[hidden email]> wrote:

> You may misunderstand how RData files work.  Note that RData files are
> not necessarily JUST a single variable unless they were explicitly
> written to store a single variable only.
>
> If you save a single variable (a dataframe, for example) named 'mydata'
> with save(mydata, file = "saveddata.RData") and then load the variable
> back into a new R session with y  <- load("saveddata.RData"), your data
> will still be contained in a variable named 'mydata',  not renamed  y.
>

Yes indeedy. In fact, y will be:
Value

A character vector of the names of objects created, invisibly.

>
> Look at ?load and ?save
>

Which should have been the OP's first port of call....

>
> On 7/22/2020 5:47 AM, Jim Lemon wrote:
> > Hi Jason,
> > I assume that you actually have "WVS.RData" in your working directory
> > when you try to load it. Otherwise you will get an error message. If
> > you don't get an error message when you do this:
> >
> > load("WVS.RData")
> >
> > there will be a new object in your workspace. So if you want to see
> > what the object is, try this:
> >
> > objects()
> > load("WVS.RData")
> > objects()
> >
> > Unless you have already run the "load" command, there will be a new
> > object in the list. That is what you're looking for. Say that object
> > is named "x". You can look at the first part of it with:
> >
> > head(x)
> >
> > and maybe do some basic editing with:
> >
> > edit(x)
> >
> > Good luck.
> >
> > Jim
> >
> > ______________________________________________
> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > 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.
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.