gt_load | R Documentation |
Load a gen_tibble
previously saved with gt_save()
. If the .rds and
.bk files have not
been moved, they should be found automatically. If they were moved, use
reattach_to
to point to the .rds file (the .bk file needs to be in the
same directory as the .rds file).
gt_load(file = NULL, reattach_to = NULL)
file |
the file name, including the full path. If it does not end with .gt, the extension will be added. |
reattach_to |
the file name, including the full path, of the .rds file if it was moved. It assumes that the .bk file is found in the same path. You should be able to leave this to NULL unless you have moved the files. |
a gen_tibble
gt_save()
example_gt <- load_example_gt("gen_tbl")
# remove some individuals
example_gt_filtered <- example_gt %>% filter(id != "a")
# save the filtered gen_tibble object
backing_files <- gt_save(example_gt_filtered,
file_name = paste0(tempfile(), "_example_filtered")
)
# backing_files[1] contains the name of the saved .gt file
backing_files[1]
# To load the saved gen_tibble object, use the path to the saved .gt file
reloaded_gt <- gt_load(backing_files[1])
# And we have loaded the gt without individual "a"
reloaded_gt
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.