draft.data: Draft DATA.bib

Description Usage Arguments Details Value Note See Also Examples

View source: R/draft.data.R

Description

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

Usage

1
2
3
4
draft.data(originator = NULL, year = format(Sys.time(), "%Y"),
  title = NULL, period = NULL, access = "Public", source = NULL,
  file = "", append = FALSE, data.files = dir("bootstrap/initial/data"),
  data.scripts = dir("bootstrap", 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, special value "file", or special value "script".

file

optional filename to save the draft metadata to a file. The value TRUE can be used as shorthand for "bootstrap/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 bootstrap/initial/data.

data.scripts

bootstrap data scripts to consider. The default is all *.R files in the bootstrap 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" 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 bootstrap/initial/data folder and data scripts inside bootstrap.

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.bootstrap reads and processes metadata entries.

TAF-package gives an overview of the package.

Examples

1
2
3
4
5
6
7
8
## Not run: 
# Print in console
draft.data("WGEF", 2015)

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

## End(Not run)

TAF documentation built on April 7, 2021, 5:06 p.m.