api_update_object_set | R Documentation |
Batch update metadata of objects
api_update_object_set(object_ids, updates)
object_ids |
internal, numeric ids of the objects. |
updates |
named list with the metadata field(s) to update and the updated value(s). Use |
The number of updated objects.
# get list of possible fields via the `object` endpoint
str(api_object(24473014))
# change one field of metadata in one object
api_update_object_set(24473014, list(longitude=10))
# check that the change is effective
api_object(24473014)$longitude
# change several fields in one object
api_object(24473014)[c("longitude", "latitude")]
api_update_object_set(24473014, list(longitude=0, latitude=0))
api_object(24473014)[c("longitude", "latitude")]
api_object(24473014)$free_columns[c("area", "mean")]
api_update_object_set(24473014, list(area=1, mean=1))
api_object(24473014)$free_columns[c("area", "mean")]
# change several fields in several objects
api_update_object_set(c(24473014, 24473015), list(longitude=5, latitude=-2))
api_object(24473014)[c("longitude", "latitude")]
api_object(24473015)[c("longitude", "latitude")]
# change the taxonomic identification
api_update_object_set(24473014, list(classif_id=1, classif_qual="V"))
api_object(24473014)[c("classif_id", "classif_qual")]
# restore initial values
api_update_object_set(
c(24473014, 24473015),
list(longitude=7.31567, latitude=43.68500)
) # NB: these objects were actually collected in the same location
api_update_object_set(24473014, list(classif_id=11509, classif_qual="P"))
api_update_object_set(24473014, list(area=1028, mean=224))
api_update_object_set(24473015, list(area=1118, mean=225))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.