# \dontshow{
.old_wd <- getwd()
temp_dir <- tempdir()
usethis::proj_set(path = temp_dir, force = TRUE)
setwd(temp_dir)
# }
# Get a boilerplate metadata statement
use_metadata_template(file = "my_metadata.Rmd", quiet = TRUE)
# Once editing is complete, call `use_metadata()` to convert to an EML file
use_metadata("my_metadata.Rmd", quiet = TRUE)
# Check that file has been created
list.files("data-publish")
# returns "eml.xml" as expected
# \dontshow{
unlink("my_metadata.Rmd")
unlink("data-publish", recursive = TRUE)
usethis::proj_set(path = .old_wd, force = TRUE)
setwd(.old_wd)
# }
Run the code above in your browser using DataLab