Skip to contents

create_otherEntity generates a EML entity of type otherEntity.

Usage

create_otherEntity(
  target_file_or_directory,
  description,
  overwrite = FALSE,
  project_naming = TRUE,
  additional_information = NULL,
  entity_value_description
)

Arguments

target_file_or_directory

(charater) The quoted name and path of the data file or directory.

description

(character) A description of the data entity.

overwrite

(logial) If creating otherEntity by zipping a directory, this is a logical indicating whether to overwrite an existing zip file that has the same name in the location as the temporary zip object to be created.

project_naming

(logical) Indicating if the file or directory should be renamed per the style used by the CAP LTER (default) with the package number + base file name + file extension. The passed file or directory name will be used if this parameter is set to FALSE.

additional_information

(character) Additional information about the data object. Should be quoted, and accepts (but not required) markdown formatting.

entity_value_description

(character) For raster data, a desciption of the raster value.

Value

EML entity of type otherEntity is returned. Additionally, the data file or directory is renamed with the package number + base file name + file extension if project naming is enabled.

Details

A otherEntity entity is created from a single file (e.g., desert_fertilization_sampling_sites.kml) or a directory. The resulting entity is renamed with the package number + base file name + md5sum + file extension. File extension is always .zip if the otherEntity is being created by zipping a directory.

Note

create_otherEntity will look for a package identifier and baseURL in config.yaml. `baseURL` must be provided. `package identifier` must be provided if project naming is enabled.

The target data file or directory can be located anywhere on a local computer but a renamed file or directory will be written to the current working directory.

Examples

if (FALSE) { # \dontrun{

 # using default parameters

 desert_fertilization_sites <- capeml::create_otherEntity(
   target_file_or_directory = "path-to-file/sampling_sites.Rmd",
   description              = "long-term study site documentation"
 )

 # set overwrite = TRUE - has the effect of overwriting an existing zipped
 # directory of the same name if the otherEntity is being generated by
 # zipping a directory.

 pass_codebook_2011 <- capeml::create_otherEntity(
   target_file_or_directory = "PASS-2011-Codebook-Feb2016rev.pdf",
   description              = "PASS 2011 survey codebook",
   overwrite                = TRUE
 )

 # example without project naming:

 pass_codebook_2011 <- capeml::create_otherEntity(
   target_file_or_directory = "path-to-directory/Desktop/max_temperature",
   description              = "rasters of max temperature years 2000-2016",
   project_naming           = FALSE
 )

} # }