[R] "How to convert .Rdata file into .csv or something else?" [SOLVED]

y tanaka marineband2007 at gmail.com
Fri Aug 18 02:37:47 CEST 2017


Dear mailing list members,

Thank you for all members who gave me advice.
This question is solved.

I tried to create an object using the load function by analogy based on the
read.csv function like this;

> d <- load("~/docdis/input/ch2/WV6_Data_R_v_2016_01_01.rdata")

but, load function cannot be used in this way. Correct ways are;

> load("~/docdis/input/ch2/WV6_Data_R_v_2016_01_01.rdata", verbose = TRUE)
#You can find the name of the stored object is "WV6_Data_R" by setting
verbose = TRUE
Loading objects:
  .Traceback
  WV6_Data_R

or

> ls()
[1] "d"             "d2"            "Howell1"       "m4.1_logsigma" "m4.3"

[6] "post"          "sigma"         "WV6_Data_R"

Then,

> d <- WV6_Data_R  # the copy of  WV6_Data_R is created in the object d

If you want to create both csv file and an object directly from the file
path;

> library(R.utils)
> saveObject(WV6_Data_R, "~/docdis/input/ch2/WV6_Data_R_v_2016_01_01.csv")
> d <- loadObject("~/docdis/input/ch2/WV6_Data_R_v_2016_01_01.csv")

Best regards,
Yohei Tanaka
==========================
Yohei Tanaka
Tohoku University
Graduate school of Economics
Doctoral student
email: marineband2007 �� gmail.com

	[[alternative HTML version deleted]]



More information about the R-help mailing list