Skip to content

Instantly share code, notes, and snippets.

@amoeba
Created May 26, 2016 23:02
Show Gist options
  • Select an option

  • Save amoeba/dabb6293372dbaa9dce16a2e31b62708 to your computer and use it in GitHub Desktop.

Select an option

Save amoeba/dabb6293372dbaa9dce16a2e31b62708 to your computer and use it in GitHub Desktop.
library(dataone)
mn <- MNode("https://arcticdata.io/metacat/d1/mn/v2")
pid <- "arctic-data.6230.1"
# Modify System Metadata
sysmeta <- getSystemMetadata(mn, pid)
sysmeta@formatId # You can see that it's "application/vnd.ms-excel"
#' Sytem Metadata formatId values are from a controlled list of identifires
#' that covers a variety of format types.
#'
#' We need to find the format ID for CSV. Go to:
#'
#' https://cn.dataone.org/cn/v2/formats
#'
#' and find 'text/csv'. You can see that it's "Id" is just "text/csv".
sysmeta@formatId <- "text/csv"
sysmeta@formatId
# Now we can just update the System Metadata
updateSystemMetadata(mn,
pid = pid,
sysmeta = sysmeta)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment