Hi,
Serialising with saveRDS won't work out of the box because the core hunter data object contains a nested Java object. Java objects cannot be serialised with saveRDS. However, rJava (used by Core Hunter to interact with Java) provides its own .jserialize function. The Java object is in the data$java slot of your data object (essentially an R list with custom S3 functions). You could try to serialise the data$java part first with .jserialize:
data$java <- .jserialize(data$java)
Then store your data object to RDS:
saveRDS(data$java, file = ...)
If that works (didn't try it yet) you could afterwards deserialise with
data <- readRDS(...)
data$java <- .junserialize(data$java)
Can you let me know if this works? If not, I will have a try myself to see what's going wrong. If it does work, maybe we could include a custom serialisation function for core hunter data that does this for you.
Op woensdag 20 maart 2024 om 16:36:40 UTC+1 schreef Fuchuan Han: