R/dublin.R

Defines functions dublin

Documented in dublin

#' @name dublin
#' @title Creates a csv metadata file based on Dublin Core standard
#'
#' @description A function to create a metadata csv file
#'
#' @param project The name of the project.
#' @param name Your name.
#' @param email You email address.
#' @param office The name of your refuge or office.
#' 
#' @export
#'
#' \dontrun{
#' @examples dublin(project= "Haggis Survey", name="John Doe", email="john_doe@fws.gov", office="Haggis Refuge")}


dublin <- function(project, name, email, office){
  name <- name
  email <- email
  contact <- paste0(name, " <", email, ">")
  directory <- getwd()

  fileConn <- file("project_meta.txt")
  message <- c("==========================================================================",
               "Alaska Region Basic Metadata Template",
               "",
               "Dublin Core Metadata",
               "(http://www.niso.org/apps/group_public/download.php/10256/Z39-85-2012_dublin_core.pdf)",
               "Project Open Data",
               "(https://project-open-data.cio.gov/v1.1/schema/)",
               "==========================================================================",
               "",
               "  title:",
               paste0("  ", project),
               "",
               "subject:",
               "  [Enter a character string of keywords here]",
               "",
               "description:",
               "  [Enter a few sentence description of the project here]",
               "",
               "date_created:",
               paste0("  ", Sys.Date()),
               "",
               "date_edited:",
               paste0("  ", Sys.Date()),
               "",
               "creator:",
               paste0("  ", contact),
               "",
               "contact:",
               paste0("  ", contact),
               "",
               "contributor:",
               paste0("  ", contact),
               "",
               "coverage:",
               "  [Enter a character string of locations covered by the project (e.g., Kodiak Refuge)]",
               "",
               "publisher:",
               paste("  U.S. Fish and Wildlife Service, Region 7,", office),
               "",
               "distribution:",
               paste0("  ", directory),
               "",
               "type:",
               "  [text]",
               "",
               "format:",
               "  [Enter the format of the files included here (e.g., Plain Text, R, Word)]",
               "",
               "language:",
               "  en-US",
               "",
               "rights:",
               "  Public Domain",
               "",
               "==========================================================================",
               "  Directory Contents",
               "==========================================================================",
               "",
               "Admin (directory)",
               "  Materials related to general project administration.",
               "",
               "Code (directory)",
               "  R scripts and functions used to summarize and analyze the data.",
               "",
               "Data (directory)",
               "  Data generated by the project. Data obtained from other sources for use",
               "  by the project should be stored under the 'resources' branch.",
               "",
               "FormTemplate (directory)",
               "  Forms, templates, data sheets, etc.",
               "",
               "Incoming (directory)",
               "  Holding location for materials that should be filed under one of the other",
               "  branches after initial quality checks have been performed. Often used as",
               "  a part of a read only archive where collaborators can write data intended",
               "  for archiving. Data custodians and stewards then move the data to a protected",
               "  area of the filesystem after quality control checks have been performed.",
               "",
               "Products (directory)",
               "  Materials generated by project (reports, documents, maps, analyses, etc.)",
               "",
               "Protocols (directory)",
               "  Methods and protocol documents that guide project procedures.",
               "",
               "Resources (directory)",
               "  Existing documents and data used during the course of the project but not",
               "  created by the project.",
               "",
               "ProjectRecord_YYYYMMDDLastUpdated (Word doc)",
               "  A living document that provides an ongoing record of changes and updates to the project.")
  writeLines(message, fileConn)
  close(fileConn)
  message("Dublin core metadata file created.")
}
USFWS/refugetools documentation built on July 10, 2020, 7:26 a.m.