Learn R Programming

icesTAF (version 3.1-1)

draft.data: 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, source = "file", file = "",
  data.dir = "bootstrap/initial/data", data.files = dir(data.dir,
  recursive = TRUE), append = FALSE)

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.

source

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

file

optional filename to save the draft metadata to a file.

data.dir

directory containing data files.

data.files

data filenames. The default is all files inside data.dir.

append

whether to append metadata entries to an existing file.

Value

Object of class Bibtex.

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 special value source = "file" is described in the process.bib help page, 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.

This function is intended to be called from the top directory of a TAF analysis which contains a bootstrap/initial/data directory, as reflected in the default value of data.dir.

See Also

period pastes two years to form a period string.

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

process.bib reads and processes metadata entries. The help page contains example metadata entries and commentary.

icesTAF-package gives an overview of the package.

Examples

Run this code
# NOT RUN {
# Print in console
draft.data("WGEF", 2015)

# Export to file
draft.data("WGEF", 2015, file="bootstrap/DATA.bib")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab