set_layer_aliases | R Documentation |
set_layer_aliases()
can replace or label column names based on the the
field aliases from a corresponding Table
or FeatureLayer
object created
with arc_open()
. Optionally repair names using vctrs::vec_as_names()
.
set_layer_aliases(
.data,
.layer,
name_repair = "unique",
alias = c("replace", "label"),
call = rlang::caller_env()
)
.data |
A data frame returned by |
.layer |
A Table or FeatureLayer object. Required. |
name_repair |
Default |
alias |
Use of field alias values. Defaults to
|
call |
The execution environment of a currently
running function, e.g. |
A data.frame. When alias = "replace"
, the column names are modified.
When alias = "label"
each column has a new label
attribute.
furl <- paste0(
"https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/",
"rest/services/USA_Counties_Generalized_Boundaries/FeatureServer/0"
)
# open the feature service
flayer <- arc_open(furl)
# select first five rows
five_counties <- arc_select(flayer, n_max = 5)
# add aliases
with_aliases <- set_layer_aliases(five_counties, flayer)
# preview the new names
str(with_aliases, give.attr = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.