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

y tanaka marineband2007 at gmail.com
Fri Aug 18 12:16:45 CEST 2017


Dear mailing list members,

A member found a problem of lines of codes in my last e-mail.
I submit the correction to this mailing list as follows.

In the final part of my last e-mail message, a csv file is created.
But, I cannot open this file, so please ignore the following part.
--------------------------------------------------------------------------------------------------
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")
---------------------------------------------------------------------------------------------------

I am so sorry for my mistake. For your reference, I put the whole contents
of my last e-mail message below.

------------------the following sentences are the previous
message--------------
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

-------------------------please ignore the following
part--------------------------------------------------
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