I´ve estimated a model with the poLCA-package in R and want to save the starting values to a file, so I can re-estimate exactly the same model anytime.
This is a list of
save(starting.values, file="fname.RData")
?save
Allows you to save one or more R objects to a single file.
Load with
load("fname.RData")
I would also suggest that you explore rlist package and the offered list.save
function as it provides additional flexibility when saving lists.
As available in documentation.
require(rlist)
x <- lapply(1:5,function(i) data.frame(a=i,b=i^2))
list.save(x, 'list.rds')
list.save(x, 'list.rdata')
list.save(x, 'list.yaml')
yaml
file preview- a: 1
b: 1.0
- a: 2
b: 4.0
- a: 3
b: 9.0
- a: 4
b: 16.0
- a: 5
b: 25.0
You could then load list with use of the list.load
function in the same package or you could read lines from the exported yaml
file. You could also consider having a look at the list.select
function and selecting objects from within list. Having said that, I presume that the easiest way to approach this would be simply to store/load a full list object.