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)
Run the code above in your browser using DataLab