Skip to contents

Save the tibble (and update the backing files). The gen_tibble object is saved to a file with extension .gt, together with update its .rds and .bk files. Note that multiple .gt files can be linked to the same .rds and .bk files; generally, this occurs when we create multiple subsets of the data. The .gt file then stores the information on what subset of the full dataset we are interested in, whilst the .rds and .bk file store the full dataset. To reload a gen_tibble, you can pass the name of the .gt file with gt_load().

Usage

gt_save(x, file_name = NULL, quiet = FALSE)

Arguments

x

a gen_tibble

file_name

the file name, including the full path. If it does not end with .gt, the extension will be added.

quiet

boolean to suppress information about the files

Value

the file name and path of the .gt file, together with the .rds and .bk files

See also

Examples

example_gt <- example_gt("gen_tbl")

# remove some individuals
example_gt <- example_gt %>% filter(id != "a")

# save filtered gen_tibble object
gt_save(example_gt, file_name = paste0(tempfile(), "_example_filtered"))
#> 
#> gen_tibble saved to /tmp/RtmpyN1xne/file22a2225f4283_example_filtered.gt
#> using bigSNP file: /tmp/RtmpyN1xne/file22a23dc704cc.rds
#> with backing file: /tmp/RtmpyN1xne/file22a23dc704cc.bk
#> make sure that you do NOT delete those files!
#> to reload the gen_tibble in another session, use:
#> gt_load('/tmp/RtmpyN1xne/file22a2225f4283_example_filtered.gt')
#> [1] "/tmp/RtmpyN1xne/file22a2225f4283_example_filtered.gt"
#> [2] "/tmp/RtmpyN1xne/file22a23dc704cc.rds"                
#> [3] "/tmp/RtmpyN1xne/file22a23dc704cc.bk"