View source: R/draft.data.script.R
draft.data.script | R Documentation |
Create an ‘R’ file to fetch data including adding metadata via roxygen2 fields to the top of the file.
draft.data.script(name, title, description, format, originator, year, period,
access, content)
name |
the name of the dataset and the file name that will be created. |
title |
description of the data, including survey names or the like. |
description |
a more involved description if required. |
format |
the format of the data produced, e.g. "csv" |
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. |
period |
a numeric vector of the form |
access |
data access code: |
content |
the r code that fetches and saves the data |
## Not run:
# Create boot folder
mkdir("boot")
# Create boot script, boot/mydata.R
draft.data.script(name="mydata", title="Title", description="Description",
format="txt", originator="Me", year="2022",
period=c(2000,2020), access="Public",
content='write(pi, file="pi.txt")')
# Create metadata, boot/DATA.bib
taf.roxygenise(files="mydata.R")
# Run boot script, creating boot/data/mydata/pi.txt
taf.boot()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.