Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
R - Mortality Tables
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
R
R - Mortality Tables
Commits
1b113239
Commit
1b113239
authored
Jul 28, 2018
by
Reinhold Kainhofer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pT.getSubTable to extract sub-tables of pensionTable objects
parent
cab5dffa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
NAMESPACE
NAMESPACE
+1
-0
R/utilityFunctions.R
R/utilityFunctions.R
+19
-0
No files found.
NAMESPACE
View file @
1b113239
...
...
@@ -32,6 +32,7 @@ export(mortalityTable.trendProjection)
export(mortalityTable.zeroes)
export(mortalityTables.list)
export(mortalityTables.load)
export(pT.getSubTable)
export(pensionTable)
export(pensionTables.list)
export(pensionTables.load)
...
...
R/utilityFunctions.R
View file @
1b113239
...
...
@@ -284,3 +284,22 @@ mT.setDimInfo = function(table, ..., append = TRUE) {
table
}
#' @export
pT.getSubTable
=
function
(
table
,
subtable
=
"qx"
)
{
if
(
is.array
(
table
))
{
return
(
array
(
lapply
(
table
,
pT.getSubTable
,
subtable
=
subtable
),
dim
=
dim
(
table
),
dimnames
=
dimnames
(
table
))
)
}
else
if
(
is.list
(
table
))
{
return
(
lapply
(
table
,
pT.getSubTable
,
subtable
=
subtable
))
}
if
(
!
is
(
table
,
"pensionTable"
))
stop
(
"First argument must be a pensionTable or a list of pensionTable objects."
)
if
(
.hasSlot
(
table
,
subtable
))
slot
(
table
,
subtable
)
else
NULL
}
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