Save a chronogram
cg_save.Rd
Write a chronogram to disk without duplicating metadata.
Arguments
- cg
a chronogram object (
class cg_tbl
)- file
quoted filename. Include an extension.
- ...
passed to
base::save()
. For example,compress
- verbose
logical. Default
TRUE
. Display messages?
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/file17d865fdc4e1
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