draft.data {TAF}R Documentation

Draft DATA.bib

Description

Create an initial draft version of a ‘DATA.bib’ metadata file.

Usage

draft.data(originator = NULL, year = format(Sys.time(), "%Y"),
  title = NULL, period = NULL, access = "Public", source = NULL,
  file = "", append = FALSE,
  data.files = dir(taf.boot.path("initial/data")),
  data.scripts = dir(boot.dir(), pattern = "\\.R$"))

Arguments

originator

who prepared the data, e.g. a working group acronym.

year

year of the analysis when the data were used. The default is the current year.

title

description of the data, including survey names or the like.

period

a string of the form "1990-2000", indicating the first and last year that the data cover, separated by a simple dash. Alternatively, a single number if the data cover only one year. If the data do not cover specific years, this metadata field can be suppressed using period = FALSE.

access

data access code: "OSPAR", "Public", or "Restricted".

source

where the data are copied/downloaded from. This can be a URL, filename, or a special value: "file", "folder", or "script".

file

optional filename to save the draft metadata to a file. The value TRUE can be used as shorthand for "boot/DATA.bib".

append

whether to append metadata entries to an existing file.

data.files

data files to consider. The default is all folders and files inside ⁠boot/initial/data⁠.

data.scripts

boot data scripts to consider. The default is all ⁠*.R⁠ files in the ⁠boot⁠ folder.

Details

Typical usage is to specify originator, while using the default values for the other arguments. Most data files have the same originator, which can be specified to facilitate completing the entries after creating the initial draft.

The data access codes come from https://vocab.ices.dk/?ref=1435.

The special values ⁠source = "file"⁠, ⁠source = "folder"⁠, and ⁠source = "script"⁠ are described on the TAF Wiki, along with other metadata information.

The default value file = "" prints the initial draft in the console, instead of writing it to a file. The output can then be pasted into a file to edit further, without accidentally overwriting an existing metadata file.

Value

Object of class ⁠Bibtex⁠.

Note

This function is intended to be called from the top directory of a TAF analysis. It looks for data files inside ⁠boot/initial/data⁠ folder and data scripts inside ⁠boot⁠.

After creating the initial draft, the user can complete the description of each data entry inside the ⁠title⁠ field and look into each file to specify the ⁠period⁠ that the data cover.

See Also

period pastes two years to form a period string.

draft.software creates an initial draft version of a ⁠SOFTWARE.bib⁠ metadata file.

taf.boot reads and processes metadata entries.

TAF-package gives an overview of the package.

Examples

## Not run: 
# Print in console
draft.data("WGEF", 2015)

# Export to file
draft.data("WGEF", 2015, file=TRUE)

# Empty entry, to complete by hand
draft.data(data.files="")

## End(Not run)


[Package TAF version 4.2.0 Index]