Вопрос

I have a web application that talks to R using plr when doing adaptive testing. I would need to find a way to store static data persistently between calls.

I have an expensive calculation creating an item bank than a lot of cheap ones getting the next item after each response submission. However currently I can't find a way to store the result of the expensive calculation persistently.

Putting it into the db seems to be a lot of overhead.

library(catR)
data(tcals)
itembank <- createItemBank(tcals) --this is the expensive call
nextItem(itembank, 0) # item 63 is selected

I tried to save and load the result, like this, but it doesn't seem to work, the result of the second NOTICE is 'itembank'.

save(itembank, file="pltrial.Rdata")
pg.thrownotice(itembank)

aaa=load("pltrial.Rdata")
pg.thrownotice(aaa)

I tried saving and loading the workspace as well, but didn't succeed with that either. Any idea how to do this?

Это было полезно?

Решение

The load function directly loads objects into your workspace. You don't have to assign the return value (which is just the names of the objects loaded, as you discovered). If you do a ls() after loading, you should find your itembank object sitting there.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top