if (FALSE) {
if (interactive()) {
# authenticate
set_arc_token(auth_code())
# publish a layer
published <- publish_layer(penguins, "Penguin Test")
penguin_fl <- arc_open(published$services$encodedServiceURL) |>
get_layer(0)
# Update the name of the layer
update_layer_definition(
penguin_fl,
name = "New Layer Name"
)
# add an index on the the layer
add_layer_definition(
penguin_fl,
indexes = list(
name = "index1",
fields = "species",
isUnique = FALSE,
isAscending = FALSE,
description = "Example index"
)
)
# refresh the layer to get the updates
penguin_fl <- refresh_layer(penguin_fl)
penguin_fl[["indexes"]]
}
}
Run the code above in your browser using DataLab