Philip C. Philip C. - 4 months ago 20
R Question

How to save a data.tree in R?

I have been looking over the manual of the

data.tree
package, however I was not able to find a way to save a
data.tree
structure once you created one. Is there a way to write a data.tree structure instead of transforming it to another structure(i.e. data.frame) and then saving it?

Answer

Your question is a bit vague as I have no clue whatsoever what type of object you are referring to. However, this seems to work for me.

data("acme")
a = acme
class(a)
[1] "Node" "R6" 

x = tempdir()
setwd(tempdir())
save(a, file = 'test.Rdata')
rm(a)
load('test.Rdata')
a
Comments