How to read .rda file as dataframe in R

43 Views Asked by At

I have a .rda file and i want to read it in R and aim to convert it to dataframe and eventually i have to read it as .maf filer in maftools but i am failing on first step. By doing

File<-load(file.choose()) #loading .rda file
head(File)
Name

How to read it.

1

There are 1 best solutions below

0
moodymudskipper On

load() doesn't return a value, it populates an environment (with one or several objects), by default the local one but this can be tweaked, maybe this will be useful:

my_obj <- 42
save(my_obj, file = "foo.rda")
rm(my_obj)

e <- new.env()
load("foo.rda", envir = e)
e$my_obj
#> [1] 42

Created on 2024-03-22 with reprex v2.0.2