datapackage_skeleton: Create a Data Package skeleton for use with DataPackageR.

Description Usage Arguments Note Examples

View source: R/skeleton.R

Description

Creates a package skeleton directory structure for use with DataPackageR. Adds the DataVersion string to DESCRIPTION, creates the DATADIGEST file, and the data-raw directory. Updates the Read-and-delete-me file to reflect the additional necessary steps.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
datapackage_skeleton(
  name = NULL,
  path = ".",
  force = FALSE,
  code_files = character(),
  r_object_names = character(),
  raw_data_dir = character(),
  dependencies = character()
)

datapackage.skeleton(
  name = NULL,
  list = character(),
  environment = .GlobalEnv,
  path = ".",
  force = FALSE,
  code_files = character(),
  r_object_names = character()
)

Arguments

name

character name of the package to create.

path

A character path where the package is located. See package.skeleton

force

logical Force the package skeleton to be recreated even if it exists. see package.skeleton

code_files

Optional character vector of paths to Rmd files that process raw data into R objects.

r_object_names

vector of quoted r object names , tables, etc. created when the files in code_files are run.

raw_data_dir

character pointing to a raw data directory. Will be moved with all its subdirectories to "inst/extdata"

dependencies

vector of character, paths to R files that will be moved to "data-raw" but not included in the yaml config file. e.g., dependency scripts.

list

Not used.

environment

Not used.

Note

renamed datapackage.skeleton() to datapackage_skeleton().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
if(rmarkdown::pandoc_available()){
f <- tempdir()
f <- file.path(f,"foo.Rmd")
con <- file(f)
writeLines("```{r}\n tbl = table(sample(1:10,1000,replace=TRUE)) \n```\n",con=con)
close(con)
pname <- basename(tempfile())
datapackage_skeleton(name = pname,
   path = tempdir(),
   force = TRUE,
   r_object_names = "tbl",
   code_files = f)
   }

DataPackageR documentation built on March 17, 2021, 5:07 p.m.