Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see data from .RData file?

Tags:

r

rdata

I saw some similar qestions and I tried to work it out on my own, but I couldn't. This is my problem:

I have to load a isfar.RData file to use it in other computation (which are not important to describe here). And I would like to simply see how looks data in this isfar.RData file e.g. what numbers, columns, rows it carries.

First I load my file:

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

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

Thanks a lot, I appreciate all of the answers! Hope it's comprehensible what I wrote, Im not a native speaker.

like image 325
Ewa Avatar asked Sep 01 '11 12:09

Ewa


People also ask

How do I view data in RStudio?

View function in RStudio RStudio includes a data viewer that allows you to look inside data frames and other rectangular data structures. You can invoke the viewer in a console by calling the View() function on the data frame you want to look at.

What is a .RData file?

RDATA files mostly belong to R by R Foundation. RDATA stands for R Data file. RDATA files are associated with the newer versions of the R program. Main Use: R is a free software environment used for statistical analysis and graphical visualisation. R can be installed on Windows, macOS and several UNIX platforms.

Where can I find .RData files?

RData file in the data folder of your working directory. This file now contains all of your objects that you can easily access later using the load() function (we'll go over this in a second…).


2 Answers

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

Try either:

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

Or more general way

load("C:/Users/isfar.RData", ex <- new.env()) ls.str(ex)  
like image 146
Marek Avatar answered Sep 20 '22 14:09

Marek


you can try

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

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

like image 28
siaosing Avatar answered Sep 22 '22 14:09

siaosing