View source: R/build_meta_head.r
| build_meta_head | R Documentation |
Takes typical row of metadata spreadsheet and creates standardized eTUFF header for use in Tagbase.
build_meta_head(meta_row, filename, write_hdr = FALSE,
metaTypes = NULL, global_attributes = NULL)
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. |
nothing to console. header is written to disk.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.