Apologies if this is really basic - is there a way to save an Agnes object from the Cluster library in R to a file for use in another session? I've looked at the CRAN pdf and for a similar question here on Stackoverflow but don't see anything.
Thanks in advance.
As mentioned in the comments:
library(cluster) data(animals) aa.ga <- agnes(animals, method = "gaverage") saveRDS(aa.ga,"aa.ga.RDS") # Save it rm(aa.ga) # Remove it so I can prove this works aa.ga <- readRDS("aa.ga.RDS") # Read it back in aa.ga
Call: agnes(x = animals, method = "gaverage") Agglomerative coefficient: 0.8285911 Order of objects:
 ant lob fly her liz sal bee cpl spi cat chi man cow lio rab duc eag ele wha fro Height (summary): Min. 1st Qu. Median Mean 3rd Qu. Max. 0.0000 0.0000 1.2050 0.9573 1.5890 2.6230
Available components:  "order" "height" "ac" "merge" "diss" "call" "method" "order.lab" "data"