How to view data from a .RData file?

I saw several similar questions, and I tried to figure it out on my own, but could not. It is my problem:

I need to download the isfar.RData file in order to use it in other calculations (which are not important here). And I would just like to see what the data in this isfar.RData file looks like, for example. what numbers, columns, rows he carries.

First, I upload the file:

isfar<-load("C:/Users/isfar.RData") 

When I try to get this information (I use Rcmdr) using the ls () function or marking isfar at the beginning after loading, I get in the output window: [1] "isfar" instead of the table. Why?

Thank you very much, I appreciate all the answers! I hope it is clear that I wrote, I am not a native speaker.

+58
r rdata
01 Sep '11 at 12:50
source share
7 answers

I think the problem is that you load isfar data.frame, but you overwrite it with the value returned by load .

Try either:

 load("C:/Users/isfar.RData") head(isfar) 

Or a more general way

 load("C:/Users/isfar.RData", ex <- new.env()) ls.str(ex) 
+64
Sep 01 '11 at 20:14
source share

you can try

isfar <- get (load ('c: /users/isfar.Rdata'))

this will assign a variable to isfar.Rdata isfar. After this task, you can use str (isfar) or ls (isfar) or head (isfar) to get a rough look of isfar.

+25
Aug 23 '16 at 4:48 on
source share

See the help page for load . Load return are the names of the created objects, so you can look at the contents of isfar to see which objects were created. The fact that nothing is displayed with ls() indicates that nothing was saved in your file.

Also note that loading will overwrite anything in your global environment that has the same name as something in the file loaded when used with the default behavior. If you basically want to study what is in the file, and possibly use something from this file with other objects in your global environment, it is better to use the attach function or create a new environment ( new.env ) and upload the file this environment using the envir argument to load .

+9
01 Sep '11 at 16:22
source share

It might be better as a comment, but I don't have enough reputation, so I posted it here.
It is worth noting that the load() function will save the name of the object that was originally saved, no matter how you .Rdata file.

Please check the name of the data.frame object used in the save() function . If you used RStudio, you can check the top right pane, Global Environment-Data, to find the name of the data you are loading.

+5
Jul 31. '18 at 20:27
source share

ls() just lists the file names, and "isfar" is the only object in your workspace. I'm not sure if there could be a special β€œRcmdr method”, but why not use str(isfar) ? It will give you the column names and the number of rows if "isfar" is a dataframe or matrix. I have no idea what you mean by "labeling."

If you want to β€œsee” numbers in a data object, then if it is too large to fit on the screen and you want to see it in a table, try: edit(isfar) Exact commands may differ from OS to OS, first check ?edit . I seem to remember the view function from my last days of Windows, but it is not available on my Mac.

+3
Sep 01 - 01 '11 at 12:58
source share

It looks like the only variable stored in the .RData file was one of them named isfar .

Are you sure you saved the table? The team should have been:

 save(the_table, file = "isfar.RData") 



There are many ways to learn a variable.

Enter this name on the command line to see a listing of it. Then browse str , ls.str , summary , View and unclass .

+1
Sep 01 '11 at 12:55
source share
 isfar<-load("C:/Users/isfar.RData") if(is.data.frame(isfar)){ names(isfar) } 

If isfar is a data framework, this will print its column names.

0
Sep 01 2018-11-11T00:
source share



All Articles