Skip to contents

Load into memory a chronogram previously written to disk by cg_save().

Usage

cg_load(file = NULL)

Arguments

file

quoted filename. Include an extension.

Value

re-loaded chronogram

See also

Examples

data("built_smallstudy")
cg_orig <- built_smallstudy$chronogram
ff <- tempfile()
cg_save(cg_orig, file = ff)
#> Finding metadata columns ...
#> Found: 
#> Writing file ... /tmp/RtmpAGjco6/file17d865579886
cg_new <- cg_load(ff)
#> Suggest save and load with the same package version:
#>  Loading into : 1.0.0 
#>  Saved with   : 1.0.0 
#>  If version numbers are different:
#>       re-generate chronogram, or update your library.

summary(cg_new == cg_orig)
#>  calendar_date  elig_study_id    age            sex           dose_1       
#>  Mode:logical   Mode:logical   Mode:logical   Mode:logical   Mode:logical  
#>  TRUE:1947      TRUE:1947      TRUE:1947      TRUE:1947      TRUE:1947     
#>                                                                            
#>  date_dose_1     dose_2        date_dose_2    serum_Ab_S     serum_Ab_N    
#>  Mode:logical   Mode:logical   Mode:logical   Mode:logical   Mode:logical  
#>  TRUE:1947      TRUE:1947      TRUE:1947      TRUE:12        TRUE:12       
#>                                               NA's:1935      NA's:1935     
identical(cg_new, cg_orig)
#> [1] TRUE