incadata v0.5.3


Monthly downloads



by Erik Bulow

Recognize and Handle Data in Formats Used by Swedish Cancer Centers

Handle data in formats used by cancer centers in Sweden, both from INCA (the current register platform, (see <> for more information) and by the older register platform Rockan (used in the Western and Northern part of the country). All variables are coerced to suitable classes based on their format. Dates (from various formats such as with missing month or day, with or without century prefix or with just a week number) are all recognised as dates and coerced to the ISO 8601 standard (Y-m-d). Boolean variables (internally stored either as 0/1 or "True"/"False"/blanks when exported) are coerced to logical. Variable names ending in '_Beskrivning' and '_Varde' will be character, and 'PERSNR' will be coerced (if possible) to a valid personal identification number 'pin' (by the 'sweidnumbr' package). The package also allow the user to interactively choose if a variable should be coerced into a potential format even though not all of its values might conform to the recognised pattern. It also contain a caching mechanism in order to temporarily store data sets with its newly decided formats in order to not rerun the identification process each time.


AppVeyor Build Status Project Status: Active - The project has reached a stable, usable state and is being actively developed.


Package to handle datasets in INCA format

The package is primarly used to create a new data object of class "incadata" (inharating from class "tbl" in dplyr). All variables are coerced to suitable classes based on their format. Dates are recognised as dates (through the rccdates package), logical variables (with values "" and "True" in INCA) will be boolean, variablev with names ending in "_Beskrivning" and "_Varde" will be factors, variable with name "PERSNR" will be coerced to "pin" (by the "sweidnumbr" package) etcetera.


The package is primarly intended for use as a part of the rcc2 package but can also be installed independently:



The package contains two vignettes. Find them after installation by browseVignettes("incadata").

Functions in incadata

Name Description
lt Lead time from one date to another
dplyr_methods dplyr methods for INCA data
ex_data Example data from INCA
is.incalogical Coerce to logical if value is logical according to INCA
id Add id variables to data frame
as.Dates Converting potential date to Date vector
as.incadata Coerce to object of class "incadata"
reexports Objects exported from other packages
use_incadata Use incadata from file or dataframe df
No Results!

Last month downloads


Type Package
License GPL-2
RoxygenNote 6.0.1
VignetteBuilder knitr
LazyData true
NeedsCompilation no
Packaged 2017-02-15 09:19:49 UTC; erikbulow
Repository CRAN
Date/Publication 2017-02-15 14:28:33

Include our badge in your README