# NOT RUN {
pigs.lm <- lm(log(conc) ~ source + factor(percent), data = pigs)
pigs.sav <- as.list(ref_grid(pigs.lm))
pigs.anew <- as.emmGrid(pigs.sav)
emmeans(pigs.anew, "source")
# }
# NOT RUN {
## Convert an entire workspace saved from an old **lsmeans** session
a.problem <- lsmeans::lsmeans(pigs.lm, "source")
#- Now global env contains at least two ref.grid and lsmobj objects,
#- and the "lsmeans" namespace is loaded
emmeans:::convert_workspace()
class(a.problem)
"lsmeans" %in% loadedNamespaces()
#- It's all better now
# }
Run the code above in your browser using DataLab