0

I would like to investigate what is inside .RData file.

I tried to load .RData file and discovered that it consists of string:

load("~/Desktop/expDatDT.RData")
[1] "ret"

How can I obtain data about elements inside this .RData file? How can I check data types for elements inside .RData file?

Thank you!

Olha Kholod
  • 539
  • 1
  • 5
  • 11
  • Reading the help page ([`?load`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/load.html)), you see that the return value (labeled `Value:`) is *"A character vector of the names of objects created, invisibly."*. This means that `"ret"` is the name of a variable within the binary data store. (It also suggests you did not copy that directly from the console, since it is returned "invisibly" and not normally printed like that.) – r2evans Jul 31 '17 at 20:50
  • 1
    But @Jesse's answer stands: `str(ret)` will give you a quick view of the object named `"ret"`. – r2evans Jul 31 '17 at 20:51

1 Answers1

2

Try,

load("~/Desktop/expDatDT.RData")
head(ret)

Also, you can check types using the following,

str(ret)

Let me know if it works or not!

  • There is nothing in the question that suggests the name of any variable within the `Rdata` file is named `expDatDT`. In fact, if it is read verbatim, there is only one object named `ret`. – r2evans Jul 31 '17 at 20:49
  • It gives me the same result: `load("~/Desktop/aml_scrna_downstream/expDatDT.RData") head(expDatDT) [1] "ret" str(expDatDT) chr "ret"` I know that this file has multiple elements with different data types, but I do not know how to access them. Thank you! – Olha Kholod Jul 31 '17 at 20:51
  • @OlhaKholod might need more reproducible examples to help you answer your question. –  Jul 31 '17 at 21:00
  • I did the following command: `load("~/Desktop/expDatDT.RData", aml <- new.env()) ls.str(aml)` and obtain data types from .RData file: `ret : Classes ‘data.table’ and 'data.frame': 69217152 obs. of 6 variables: $ target_id : chr "ENST00000415118" "ENST00000434970" "ENST00000448914" "ENST00000604642" ... $ length : int 8 9 13 23 19 31 31 17 23 19 ... $ eff_length: num 4.25 4.59 5.82 8.42 7.44 ... $ est_counts: num 0 0 0 0 0 0 0 0 0 0 ... $ tpm : num 0 0 0 0 0 0 0 0 0 0 ... $ sampleName: chr "sample1" "sample1" "sample1" "sample1" ...` – Olha Kholod Jul 31 '17 at 21:09
  • 1
    @OlhaKholod I think this link also would be more helpful for you https://stackoverflow.com/questions/7270544/how-to-see-data-from-rdata-file –  Jul 31 '17 at 21:14