use_tabde: Use table design file

Description Usage Arguments

View source: R/use_tabde.R

Description

use_tabde() is designed to be used during package development. It saves table_designs to the inst/table_design/ folder of the current package (and creates this folder if it doesn't exist).

use_tabde_fwf() and use_tabde_sql() are convenience functions that do the same and add the respective dummy columns.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use_tabde(
  x,
  file = {     if (assert_namespace("rprojroot"))         
    rprojroot::find_package_root_file("inst", "table_design",
    paste0(deparse(substitute(x)), ".csv"))     else stop("argument 'file' is missing") },
  overwrite = FALSE
)

use_tabde_fwf(
  x,
  file = {     if (assert_namespace("rprojroot"))         
    rprojroot::find_package_root_file("inst", "table_design",
    paste0(deparse(substitute(x)), ".csv"))     else stop("argument 'file' is missing") },
  overwrite = FALSE
)

use_tabde_sql(
  x,
  file = {     if (assert_namespace("rprojroot"))         
    rprojroot::find_package_root_file("inst", "table_design",
    paste0(deparse(substitute(x)), ".csv"))     else stop("argument 'file' is missing") },
  overwrite = FALSE
)

Arguments

x

a table_design or a regular data.frame. Regular data.frames are converted to table_designs via get_tabde().

file

scalar character. name for the table_design .csv file. The default is to construct a filename from the name of the object passed to x.

overwrite

logical scalar. Set TRUE to overwrite existing files.


s-fleck/tabde documentation built on April 4, 2021, 10:11 p.m.