Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
R
R - Mortality Tables
Commits
9e37d77a
Commit
9e37d77a
authored
May 19, 2018
by
Reinhold Kainhofer
Browse files
Add mT.setDimInfo function to set the dimensional infor for makeQxDataFrame
parent
775ff4df
Changes
1
Hide whitespace changes
Inline
Side-by-side
R/utilityFunctions.R
View file @
9e37d77a
...
@@ -183,6 +183,9 @@ mT.extrapolateProbsExp = function(table, age, up = TRUE) {
...
@@ -183,6 +183,9 @@ mT.extrapolateProbsExp = function(table, age, up = TRUE) {
mT.fitExtrapolationLaw
=
function
(
table
,
method
=
"LF2"
,
law
=
"HP"
,
mT.fitExtrapolationLaw
=
function
(
table
,
method
=
"LF2"
,
law
=
"HP"
,
fit
=
75
:
99
,
extrapolate
=
80
:
120
,
fit
=
75
:
99
,
extrapolate
=
80
:
120
,
fadeIn
=
80
:
90
,
fadeOut
=
NULL
)
{
fadeIn
=
80
:
90
,
fadeOut
=
NULL
)
{
if
(
!
is
(
table
,
"mortalityTable"
))
stop
(
"First argument must be a mortalityTable."
)
ages
=
ages
(
table
)
ages
=
ages
(
table
)
if
(
!
is.null
(
table
@
exposures
)
&&
!
is.na
(
table
@
exposures
))
{
if
(
!
is.null
(
table
@
exposures
)
&&
!
is.na
(
table
@
exposures
))
{
Ex
=
table
@
exposures
Ex
=
table
@
exposures
...
@@ -215,3 +218,16 @@ mT.fitExtrapolationLaw = function(table, method = "LF2", law = "HP",
...
@@ -215,3 +218,16 @@ mT.fitExtrapolationLaw = function(table, method = "LF2", law = "HP",
table
table
}
}
#' @export
mT.setDimInfo
=
function
(
table
,
...
,
append
=
TRUE
)
{
if
(
!
is
(
table
,
"mortalityTable"
))
stop
(
"First argument must be a mortalityTable."
)
if
(
append
)
{
table
@
data
$
dim
[
names
(
list
(
...
))]
=
list
(
...
)
}
else
{
table
@
data
$
dim
=
list
(
...
)
}
table
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment