Is there a way I could replace the table in .Rdata file with another one? I can edit it with edit(x) command, but it would take an enormous amount of time to do this manually; besides, I haven't found a way to add rows to it.
RData file contains all objects in your current workspace.
To save data as an RData object, use the save function. To save data as a RDS object, use the saveRDS function. In each case, the first argument should be the name of the R object you wish to save. You should then include a file argument that has the file name or file path you want to save the data set to.
The easiest way to load the data into R is to double-click on the particular file yourfile. RData after you download it to your computer. This will open in RStudio only if you have associated the . RData files with RStudio.
I think you need to read a few 'intro to R' guides.
A .Rdata file is generally a saved session, and can have any number of 'things' saved in it, scalars, vectors, data.frames, lists, functions etc etc. I assume you have a data file that has been read into R into a data.frame and that is saved within a .Rdata file. You can load the .Rdata file with load("....Rdata")
then you can 'replace' your table (a data frame), by loading another one over top, if that's what you want to do, so assuming it's called dat, dat <- read.csv("new_data.csv", ...)
, and then save the session again, save.image("....Rdata")
. I've assumed a lot of things there though...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With