diff --git a/DESCRIPTION b/DESCRIPTION index 94b2e05..2f3d5de 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,14 +2,14 @@ Package: eoR Type: Package Title: Data Management Package (Exposure and Occurrence Data in R) Version: 0.4.0 -Date: 2019-11-06 +Date: 2019-11-07 Authors@R: c(person("Rainer", "Walke", role = c("aut", "cre"), email = "walke@demogr.mpg.de", comment = c(ORCID = "0000-0002-4269-6531"))) Description: This data management package provides some helper classes for publicly available data sources (HMD, DESTATIS) in Demography. Similar to ideas developed in the Bioconductor - project bioconductor.org we strive to encapsulate data in easy + project we strive to encapsulate data in easy to use S4 objects. If original data is provided in a text file, the resulting S4 object contains all information from that text file. But the diff --git a/R/GENESISClasses.R b/R/GENESISClasses.R index ada3e68..52e273b 100644 --- a/R/GENESISClasses.R +++ b/R/GENESISClasses.R @@ -27,6 +27,11 @@ NULL #' @slot rd1 stores the death count table (data.table) #' @slot rd1total stores the death count total sums table (data.table) #' @slot protocol contains the protocol information +#' @examples +#' d1 <- readRegDeath(file.path(system.file(package="eoR"), "extdata", "12613-02-02-4m.csv")) +#' header(d1) +#' footer(d1) +#' rd1(d1)[, table(Year)] #' @export #' @rdname RD1-class setClass("RD1", @@ -218,6 +223,11 @@ setValidity("RD1", #' @slot re1 stores the exposure table (data.table) #' @slot re1total stores the exposure total sums table (data.table) #' @slot protocol contains the protocol information +#' @examples +#' r1 <- readRegExp(file.path(system.file(package="eoR"), "extdata", "12411-03-03-4m.csv")) +#' header(r1) +#' footer(r1) +#' re1(r1)[, table(Year)] #' @export #' @rdname RE1-class setClass("RE1", diff --git a/R/HMDClasses.R b/R/HMDClasses.R index c221b5d..c855243 100644 --- a/R/HMDClasses.R +++ b/R/HMDClasses.R @@ -26,6 +26,10 @@ NULL #' @slot header includes the raw header information #' @slot lt1 stores the life table (data.table) #' @slot protocol contains the protocol information +#' @examples +#' o1 <- readLT1x1(file.path(system.file(package="eoR"), "extdata", "DEUTNP.fltper_1x1m.txt")) +#' header(o1) +#' lt1(o1)[, table(Year)] #' @export #' @rdname LT1-class setClass("LT1", @@ -185,6 +189,10 @@ setValidity("LT1", #' @slot header includes the raw header information #' @slot ex1 stores the exposure table (data.table) #' @slot protocol contains the protocol information +#' @examples +#' e1 <- readEX1x1(file.path(system.file(package="eoR"), "extdata", "DEUTNP.Exposures_1x1m.txt")) +#' header(e1) +#' ex1(e1)[, table(Year)] #' @export #' @rdname EX1-class setClass("EX1", diff --git a/man/EX1-class.Rd b/man/EX1-class.Rd index 66b3969..db14d18 100644 --- a/man/EX1-class.Rd +++ b/man/EX1-class.Rd @@ -117,3 +117,8 @@ Try demo(EX1) for a demonstration. \item{\code{protocol}}{contains the protocol information} }} +\examples{ +e1 <- readEX1x1(file.path(system.file(package="eoR"), "extdata", "DEUTNP.Exposures_1x1m.txt")) +header(e1) +ex1(e1)[, table(Year)] +} diff --git a/man/LT1-class.Rd b/man/LT1-class.Rd index ab7a4a5..d92c340 100644 --- a/man/LT1-class.Rd +++ b/man/LT1-class.Rd @@ -117,3 +117,8 @@ Try demo(LT1) for a demonstration. \item{\code{protocol}}{contains the protocol information} }} +\examples{ +o1 <- readLT1x1(file.path(system.file(package="eoR"), "extdata", "DEUTNP.fltper_1x1m.txt")) +header(o1) +lt1(o1)[, table(Year)] +} diff --git a/man/RD1-class.Rd b/man/RD1-class.Rd index a93be59..77fb2e5 100644 --- a/man/RD1-class.Rd +++ b/man/RD1-class.Rd @@ -148,3 +148,9 @@ Try demo(RD1) for a demonstration. \item{\code{protocol}}{contains the protocol information} }} +\examples{ +d1 <- readRegDeath(file.path(system.file(package="eoR"), "extdata", "12613-02-02-4m.csv")) +header(d1) +footer(d1) +rd1(d1)[, table(Year)] +} diff --git a/man/RE1-class.Rd b/man/RE1-class.Rd index d139f3f..3a123c1 100644 --- a/man/RE1-class.Rd +++ b/man/RE1-class.Rd @@ -148,3 +148,9 @@ Try demo(RE1) for a demonstration. \item{\code{protocol}}{contains the protocol information} }} +\examples{ +r1 <- readRegExp(file.path(system.file(package="eoR"), "extdata", "12411-03-03-4m.csv")) +header(r1) +footer(r1) +re1(r1)[, table(Year)] +}