data_version: Get the DataVersion for a package

Description Usage Arguments Note See Also Examples

View source: R/dataversion.r

Description

Retrieves the DataVersion of a package if available

Usage

1
2
3
data_version(pkg, lib.loc = NULL)

dataVersion(pkg, lib.loc = NULL)

Arguments

pkg

character the package name

lib.loc

character path to library location.

Note

dataVersion() has been renamed to data_version()

See Also

packageVersion

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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)

   package_build(file.path(tempdir(),pname), install = FALSE)

   devtools::load_all(file.path(tempdir(),pname))
   data_version(pname)
}

RGLab/DataPackageR documentation built on Nov. 12, 2018, 10:51 p.m.