Storing all function and data / for future restoring in a new PC.


It seems that there is NO easy way to move all functions and data to a new PC.

There is an alternative way using

dump(ls()[sapply(ls(), function(x) is.function(get(x)))], "functions.Rdmpd.txt")

for storing all functions in text format for future use by source().

Now how to store all the data (into mostly 2 by 2 csv format )for future use?

How about 3-dimensional array?



Ambassador to the humans
What exactly are you asking about? Do you just want to save the functions and data that are in your workspace? If not you really need to describe your situation better.
Of course, all function and data is automatically stored in R workspace when we log out.

In case that 1) we move R system to a new PC or 2) we move current R system to Splus (an old version of R), we need text (csv) version of all function and data, for easy and clear moving.

Instead of the binary format in current R (that we cannot see), we like to change to a format (that any other software can understand).
1. Copy the folders with your R Programs.
2. Copy the folders with your (external original) data.
3. Install R and R-Studio on the new PC.
4. Make a list of your installed R packages and reinstall them on the new PC (you can write a little R program for this).

Of course, we all know above 4 steps (moving binary file to new PC).

Here, we are looking for safe(versatile) way to move R function and data ( with the safest method as a text (csv) format ).

There are too many number of local functions and data so that it is hard(time-consuming) to move everything separately.

We like to use simple R commands (a few line with such as apply) to backup everything everyday.

PS) The above one line seems to work for storing local functions. How about (2-dim) data?