write_sf_ext | R Documentation |
The write_sf_ext and write_sf_cache helper functions wrap the sf::write_sf
function to provide some additional options including consistent file naming
with make_filename()
and features including:
write_sf_ext( data, name = NULL, label = NULL, prefix = NULL, postfix = NULL, filename = NULL, filetype = NULL, path = NULL, cache = FALSE, overwrite = FALSE ) write_sf_cache( data, name = NULL, label = NULL, prefix = NULL, postfix = NULL, filename = NULL, filetype = NULL, data_dir = NULL, overwrite = FALSE ) write_sf_gist( data, name = NULL, label = NULL, prefix = NULL, postfix = NULL, filename = NULL, filetype = "geojson", description = NULL, public = TRUE, browse = FALSE, token = get_access_token(type = "GITHUB_PAT") ) write_sf_gsheet( data, name = NULL, label = NULL, prefix = NULL, postfix = NULL, filename = NULL, sheet = 1, ask = FALSE, key = NULL )
data |
|
name |
Name to make file name converted to snake case with
|
label |
Label to combine with name converted to snake case with
|
prefix |
File name prefix. "date" adds a date prefix, "time" adds a
date/time prefix; defaults to |
postfix |
File name postfix; defaults to |
filename |
File name to use. If filename is provided and the data is an
|
filetype |
File type to write and cache, Default: |
path |
Path to file or data directory. |
cache |
If |
overwrite |
Logical. Default |
data_dir |
cache data directory, defaults to
|
description |
(character) Brief description of gist (optional) |
public |
(logical) Whether gist is public (default: TRUE) |
browse |
(logical) To open newly create gist in default browser (default: TRUE) |
token |
A personal access token on GitHub with permission to create gists; defaults to Sys.getenv("GITHUB_PAT") |
sheet |
Sheet to write into, in the sense of "worksheet" or "tab". You can identify a sheet by name, with a string, or by position, with a number. |
ask |
If |
key |
If ask is |
If the data is not an sf object, optionally save as an RDS file.
If filetype is "csv" or the filename ends in ".csv" the file is
automatically converted to a dataframe using df_to_sf()
; if file type is
"gsheet" the file is converted and turned into a new Google Sheet document
(if a Google account is authorized with the googlesheets4 package using the
write_sf_gsheet()
function.).
If cache is TRUE
use write_sf_cache to cache file after writing a copy to
the path provided.
If data is a named sf list, pass the name of each sf object in the list to the name parameter and keep all other parameters consistent to write a file for each object in the list.
sf::st_write()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.