build_meta_head: Build eTUFF metadata header

View source: R/build_meta_head.r

build_meta_headR Documentation

Build eTUFF metadata header

Description

Takes typical row of metadata spreadsheet and creates standardized eTUFF header for use in Tagbase.

Usage

build_meta_head(meta_row, filename, write_hdr = FALSE,
  metaTypes = NULL, global_attributes = NULL)

Arguments

meta_row

is a row of meta spreadsheet for the deployment of interest

filename

is output filename for this eTUFF file. Needs to be .txt.

write_hdr

is logical indicating whether or not to actually write the header to the file specified by filename. If FALSE, the constructed header is returned.

metaTypes

is csv sourced from github containing the latest metaTypes recognized by the NASA OIIP project. Usually this is left NULL and the file is auto-magically downloaded for you. The only reason you may want to specify this would be in order to work offline.

global_attributes

is character vector of additional global attributes to be associated with this eTUFF file. See the example for required formatting of vector elements.

Value

nothing to console. header is written to disk.

Examples

## Not run: 
# build_meta_head uses input tag metadata to build a header similar to:
cat("header1\nheader2\n", file="filename.csv")
cat("header3\n", file="filename.csv", append=TRUE)
DF <- data.frame(a=1:2, b=c("a","B"))
write.table(DF, file="filename.csv", append=TRUE)
> header1
header2
header3
"a" "b"
"1" 1 "a"
"2" 2 "B"

g_atts <- c('institution = "WHOI"', 'references = "doi: xxxx"')
build_meta_head(meta_row = meta[1,], filename = 'eTUFF_example.txt', global_attributes = g_atts)

## End(Not run)

camrinbraun/tags2etuff documentation built on June 9, 2025, 9:48 a.m.