Skip to content

Commit

Permalink
improve documentation
Browse files Browse the repository at this point in the history
get rid of hello.R
  • Loading branch information
walke committed Oct 2, 2019
1 parent 23255ed commit bd76bf9
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 43 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export(Exposure1)
export(LTable1)
export(RegDeath1)
export(RegExp1)
export(hello)
export(readEX1x1)
export(readLT1x1)
export(readRegDeath)
Expand Down
44 changes: 36 additions & 8 deletions R/HMDClasses.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@ NULL
NULL
####

# S4 class definitions
# class for life-tables 1x1
## S4 class definitions

#' LT1 Class

#' LT1 class for life-tables 1x1
#'
#' A \code{LT1} is used to ..
#' The class \code{LT1} stores life-table information in a systematic way.
#' It fits to Human Mortality Database (HMD) 1x1 period life tables.
#' See https://www.mortality.org/ for data details.
#' An LT1 instance stores the raw header content and the life table as data.table.
#' Further it adds a pure numeric age AgeLow to the data.table.
#'
#' @slot content describes the content
#' @slot country
#' @slot country regional entity
#' @slot header includes the raw header information
#' @slot lt1 ist the life table (data.table)
#' @slot protocol contains the protocol information
#' @export
#' @rdname LT1-class
setClass("LT1",
slots=c(
header="vector", # file header
Expand All @@ -29,8 +34,15 @@ setClass("LT1",
)
)

# slot getters
## slot getters

#' LT1 header
#'
#' The \code{header}-method gets the raw header information of an LT1 object
#' @param x LT1-object
#' @return raw header information
#' @export
#' @rdname LT1-class
setMethod("header", "LT1", function(x) x@header)
#' @export
setMethod("lt1", "LT1", function(x) x@lt1)
Expand All @@ -48,14 +60,30 @@ setReplaceMethod("lt1", "LT1", function(x, value) {x@lt1 <- value; validObject(x



# constructor
## constructor

#' LT1 constructor
#'
#' The \code{LTable1}-constructor creates an LT1 object
#' @param object header lt1 content country protocol
#' @return LT1 object
#' @export
#' @rdname LT1-class
LTable1 <- function(header, lt1, content, country, protocol)
new("LT1", header=header, lt1=lt1, content=content, country=country, protocol=protocol)

# methods
## methods


#' LT1 length
#'
#' The \code{length}-method gets the number of rows int the LT1 lt1 data.table
#' @param x LT1-object
#' @return number of rows
#' @export
#' @rdname LT1-class
setMethod("length", "LT1", function(x) dim(x@lt1)[1])

#' @export
setMethod("show", "LT1",
function(object)
Expand Down
19 changes: 0 additions & 19 deletions R/hello.R

This file was deleted.

40 changes: 37 additions & 3 deletions man/LT1-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions man/hello.Rd

This file was deleted.

0 comments on commit bd76bf9

Please sign in to comment.