Search code examples
rdplyrtidyversetibble

R saving workspace with save.image() turns tibbles into plain dataframes


in RStudio, I have around 100 objects mostly tibbles, 5GB total which are always loaded before our analysis workflow. I'd like to store them all as a single .Rdata or some other appropriate data format so loading them is more convenient and consistent between team members' machine.

combination of save.image("~/r_all.Rdata", compress = TRUE) and load("~/r_all.Rdata") seemed to work great at first, but then I noticed all tibbles are turned into plain data.frames. Our codebase is very much reliant on tidyverse and this causes nuisance of having to convert them back to tibbles

Is there a way to store entire workspace where tibbles are kept as tibbles?


Solution

  • This was just a silly oversight on my part!

    I thought "tibbles are turned into plain data.frame" because of the way tibbles are printed on console - I hadn't load tidyverse package so tibbles are just "printed" as base data.frame would.

    run pacman::p_laod(tidyverse) and tibbles are printed exactly as expected.

    Thank you Limey for pointing that out!