From f27b89e3ce87414c494b0025980d06d540e05a06 Mon Sep 17 00:00:00 2001 From: YBK Date: Thu, 18 Aug 2022 17:52:34 +0200 Subject: [PATCH 01/24] Fix #285 Use empty instead of "" in regexp TIL It is invisible when using symbol "" in regexp for TIL column in recode. --- R/recode-regexp.R | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/R/recode-regexp.R b/R/recode-regexp.R index 24ea3a42..b2e1e88b 100644 --- a/R/recode-regexp.R +++ b/R/recode-regexp.R @@ -113,7 +113,7 @@ is_recode_regexp <- function(dt, code, cols){ for (i in seq_along(cols)){ col <- cols[i] fra <- is_rex(code = code[["FRA"]]) - til <- code[["TIL"]] + til <- is_empty_til(code = code[["TIL"]]) dt[, (col) := gsub(fra, til, get(col))] } @@ -129,3 +129,15 @@ is_rex <- function(code){ return(code) } + +## Symbol "" in Access make it invisible so better use +## something clear with the word 'empty' or 'tom' +is_empty_til <- function(code){ + code <- trimws(code) + ety <- c("empty", "emtpy", "tom") + if (is.element(code, ety)){ + code <- "" + } + + return(code) +} From e87f18ca800a3aa51e6676d9d9623e6650c2fe04 Mon Sep 17 00:00:00 2001 From: YBK Date: Thu, 18 Aug 2022 18:03:42 +0200 Subject: [PATCH 02/24] Test: Close #285 with testing --- inst/testdata/RegExpCode.rds | Bin 0 -> 185 bytes inst/testdata/RegExpDT.rds | Bin 0 -> 290 bytes inst/testdata/RegExpOut.rds | Bin 0 -> 285 bytes tests/testthat/test-recode-regexp.R | 10 ++++++++++ 4 files changed, 10 insertions(+) create mode 100644 inst/testdata/RegExpCode.rds create mode 100644 inst/testdata/RegExpDT.rds create mode 100644 inst/testdata/RegExpOut.rds diff --git a/inst/testdata/RegExpCode.rds b/inst/testdata/RegExpCode.rds new file mode 100644 index 0000000000000000000000000000000000000000..c78e4fe4f8cd1ec59a954187cd63d9c69e692d9f GIT binary patch literal 185 zcmV;q07m~GiwFP!0000028-ZgU|?WoU}0ipU}gm}8CV^IojpB)V!~hv1_l8jW@KPt z-~{m<9fQz>*yCbSs!eL+(S%u3a|=o;8Gr^O3+5%}rWQk0GQ-UD_V zG~Jv<`Q>^r6L^7`sR2m*2Lg0!l5-M^Vb(A~1-ViZOA_@;5|eULQAE;;fF`0DAgGs_ nSCU$kmzbkhoSKtXl$r(<6ocY_P)w{J82$kOuJhCZWB~vGLcvJ= literal 0 HcmV?d00001 diff --git a/inst/testdata/RegExpDT.rds b/inst/testdata/RegExpDT.rds new file mode 100644 index 0000000000000000000000000000000000000000..47f40c12ba7f770ff3a5bf0600a921b166496f51 GIT binary patch literal 290 zcmV+-0p0!|iwFP!000002ECF|OT#b_$1iECZXiqqKSoJXeb{5>L~2I{b`IYpY6?QF z&=!34dkd>^OEir*P{fC8{`YJCch@x6LjVXM#0Y{&ONe-Wnx>i^>SRyH=p8}`1HBFy zp(i(tF#0E;UwkJa<1r<_&id65v%>B}^b29036o^2I(C@Xj(jU{GWkRR`)ilRP9U@P zW?^KDLWzTZWMr-}+;lg8rha;kEBUAzGbVn~kFM)py^YabDVxT$#Rd-VWh>)W-j=FI zidt9n3LL}_RjcYsmT{xXqE>~5MF$A1nT6umpw{v6{b0O?CxLQp4N47iT oVw&gnCr3IapAZO)^iCLM z@!on^;~=5aX-xl|4XYt$g*}JjAB1@(Op~4J++kij`m4an>>B|bZ(SNYfy_Rbh0z@f zB@Wul$Xp}oyZ2;Nzr043d{&Ja6Tj)D>$-REVE9nVrZH`?f#XNn%BYq1r5cc;))l=1 zC(%>Ys=AV8)TpwkRiWXTiH(WL_MP>Hfb$zGuP&E%j_i6Vgnb6Lt2zJ54i{X^^W5G% jS@T8gewy*jrl}C?jIaEEv={O3W5DJE(-)6+d; Date: Thu, 18 Aug 2022 18:05:13 +0200 Subject: [PATCH 03/24] VER 0.7.5 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index c5db9dbf..b65f76e8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: orgdata Title: Aggregating Original Data -Version: 0.7.4 +Version: 0.7.5 Authors@R: c(person(given = "Yusman", family = "Kamaleri", From 7238a4c97e13da4a8e5d09956e8990a5b380e8ec Mon Sep 17 00:00:00 2001 From: YBK Date: Thu, 18 Aug 2022 18:07:08 +0200 Subject: [PATCH 04/24] Doc: Update news --- NEWS.md | 3 +++ docs/news/index.html | 21 ++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/NEWS.md b/NEWS.md index eadab036..a81c9a23 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +# orgdata 0.7.5 +- Use either `empty` or `tom` to represent regular expression to replace to since Access makes symbol `""` to be invisible (#285) + # orgdata 0.7.4 - Delete raw of similar columns with multiple specifications (#282) - Different ways to recode of similar column ie. duplicated, with defined lesid will give error. diff --git a/docs/news/index.html b/docs/news/index.html index a7fe7110..8afa1cf8 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -10,7 +10,7 @@ orgdata - 0.7.4 + 0.7.5 + + + + + +
+
+
+ +
+

See the original data that have been clean and structured i the +data warehouse. Data is saved in the warehouse when the column +KONTROLLERT is marked in the original file table in Access. This means +the dataset has been cleaned and recoded as specified in INNLESING table +in Access registration database.

+
+ +
+

Usage

+
see_data(
+  group = NULL,
+  koblid = NULL,
+  year = NULL,
+  action = c("read", "delete")
+)
+
+ +
+

Arguments

+
group
+

The filegroup name (filgruppe)

+ + +
koblid
+

KOBLID from table tbl_Koble

+ + +
year
+

Which year the geograhical codes to be recoded to. If it is empty +then global option for orgdata.year will be used.

+ + +
action
+

To read or delete the data in the database. Default is read.

+ +
+ +
+

Examples

+
if (FALSE) {
+dt <- see_org("LESEFERD", koblid = 134)
+}
+
+
+
+ + +
+ + + + + + + diff --git a/docs/reference/see_file.html b/docs/reference/see_file.html index 1e3b4e22..5881b182 100644 --- a/docs/reference/see_file.html +++ b/docs/reference/see_file.html @@ -10,7 +10,7 @@ orgdata - 0.7.4 + 0.7.5 + + + + + +
+
+
+ +
+

Create age categories either by age interval or specified age +categories. How to define the age categories in EXTRA column in Access is +shown in the example below.

+

Age categories can be specified as follows:

  • Specific interval eg. every 5 years. Interval with odd numbers will use minimum age of 0 and maximum age is 85+, while even number uses maximum age of 80+.

  • +
  • Specified interval eg. 0-18, 19-44, 45-64, 65-79, 80+

  • +
+ +
+

Usage

+
find_age_category(dt = NULL, interval = NULL)
+
+ +
+

Arguments

+
dt
+

Dataset

+ + +
interval
+

Age interval

+ +
+
+

See also

+ +
+ +
+

Examples

+
if (FALSE) {
+AgeCat(5) #Group age for every 5 years with min 0 and max 85+
+AgeCat(10) #Group age for every 10 years with min 0 and max 80+
+AgeCat(0, 19, 45, 65, 80) #Age group of 0-18, 19-44, 45-64, 65-79, 80+
+}
+
+
+
+ + +
+ + + + + + + diff --git a/docs/reference/get_extra_args.html b/docs/reference/get_extra_args.html index e4e43d13..e448952b 100644 --- a/docs/reference/get_extra_args.html +++ b/docs/reference/get_extra_args.html @@ -97,6 +97,7 @@

See also

Other extra arguments: do_extra_args_group(), do_extra_args(), +find_age_category(), get_extra_args_group()

diff --git a/docs/reference/get_extra_args_group.html b/docs/reference/get_extra_args_group.html index 631b1a8f..c21e6b0a 100644 --- a/docs/reference/get_extra_args_group.html +++ b/docs/reference/get_extra_args_group.html @@ -100,6 +100,7 @@

See also

Other extra arguments: do_extra_args_group(), do_extra_args(), +find_age_category(), get_extra_args()

diff --git a/docs/reference/index.html b/docs/reference/index.html index bed6ada9..b1776e12 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -378,6 +378,11 @@

Helper functions
+ find_age_category() +
+
Create age categories
+
+ find_column_input()
Columns with Single Input
diff --git a/docs/search.json b/docs/search.json index f40fb510..1fc5d7ae 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"orgdata-debug","dir":"Articles","previous_headings":"","what":"orgdata.debug","title":"How to debug","text":"used display process flow running functions orgdata. useful know process creates problems troubleshoot. Options shallow deep used decide levels functions shown process flow. Selecting shallow equal TRUE deep show helper functions well. activate:","code":"options(orgdata.debug = TRUE) # OR debug_opt(\"shallow\") # OR debug_opt(\"deep\")"},{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"orgdata-debug-nrow","dir":"Articles","previous_headings":"","what":"orgdata.debug.nrow","title":"How to debug","text":"make testing faster big file, can load rows activating options. instance, load first 50 rows use:","code":"options(orgdata.debug.nrow = 50) # OR debug_opt(\"nrow\", 50)"},{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"orgdata-debug-row","dir":"Articles","previous_headings":"","what":"orgdata.debug.row","title":"How to debug","text":"select specific row(s) processing. useful especially activating orgdata.debug.geo option. select rows 20 50:","code":"options(orgdata.debug.row = 20:50) # OR debug_opt(\"row\", 20:50)"},{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"orgdata-debug-aggregate","dir":"Articles","previous_headings":"","what":"orgdata.debug.aggregate","title":"How to debug","text":"check geographical codes original data aggregated . instance original data consist enumeration area codes can aggregated municipality county. Activating options add columns origin geographical codes codes aggregate municipality, county, city etc output data. difference options aggreagate argument make_file() argument aggregate = FALSE cease aggregating recoding geographical codes original data. use:","code":"options(orgdata.debug.aggregate = TRUE) # OR debug_opt(\"aggregate\")"},{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"geo","dir":"Articles","previous_headings":"","what":"orgdata.debug.geo","title":"How to debug","text":"option used check code use recoding geographical codes original data current geographical codes. new columns called oriGEO added consisting geographical codes original data example. Column GEO code recode oriGEO. value NA column GEO recode done respective code. reason either codes still valid current year recode code available/valid deleted. warning given.","code":"options(orgdata.debug.geo = TRUE) # OR debug_opt(\"geo\")"},{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"reset","dir":"Articles","previous_headings":"","what":"reset","title":"How to debug","text":"activating options orgdata, kept active actively deactivate restart new R session. can deactivate :","code":"reset_opt()"},{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"expl","dir":"Articles","previous_headings":"","what":"Example output","title":"How to debug","text":"example output activating orgdata.debug.geo","code":"oriGEO GEO AAR KJONN UTDANN TAB1 TAB2 TAB3 TAB4 ANDRE ANNEN 1: 1010102 30010102 2019 0 01 2 8 1 1 1 2 2: 1010102 30010102 2019 0 01 2 5 1 1 1 3 3: 1010102 30010102 2019 0 01 1 8 1 1 1 3 4: 1010102 30010102 2019 0 01 3 8 1 1 3 3 5: 1010102 30010102 2019 0 02 3 8 2 2 20 20 --- 326790: 50610108 NA 2019 2 02 2 5 1 2 20 20 326791: 50610108 NA 2019 2 02 3 5 1 2 20 20 326792: 50610108 NA 2019 2 02 4 8 1 1 20 20 326793: 50610110 NA 2019 0 03 4 8 1 1 20 20 326794: 50610110 NA 2019 1 03 4 8 1 1 20 20"},{"path":"https://helseprofil.github.io/orgdata/articles/geo-recode.html","id":"recode-geo-codes","dir":"Articles","previous_headings":"","what":"Recode Geo Codes","title":"Recode and Map Geo","text":"function create table recoding geo codes geo_recode(). table consists previous codes new codes whenever available. instance, get codes kommuner 2017 2022. table list codes kommuner since 2017 columname oldCode current codes ie. 2022, column currentCode. geo codes changed since 2017 new codes currentCode column. geo codes changed since 2017 value NA oldCode column. Use argument write = TRUE save database. table database named kommune2022 data consist geo codes 2022, ie. argument = 2022 type = kommune used. table already exists database just want add new dataset table, use argument append = TRUE, appending used control purposes production might create duplication oldCode column. Please check documentation details help(\"geo_recode\").","code":"library(orgdata) dt <- geo_recode(type = \"kommune\", from = 2018, to = 2022) dt[1:5] oldCode oldName currentCode newName changeOccurred batch 1: 0301 Oslo 2022 2022-03-15 2: 1101 Eigersund 2022 2022-03-15 3: 1141 Finnøy 1103 Stavanger 2020 2022-03-15 4: 1142 Rennesøy 1103 Stavanger 2020 2022-03-15 5: 1106 Haugesund 2022 2022-03-15"},{"path":"https://helseprofil.github.io/orgdata/articles/geo-recode.html","id":"mapping-geo-codes","dir":"Articles","previous_headings":"","what":"Mapping Geo Codes","title":"Recode and Map Geo","text":"function create geo mapping geo_map(). default table name created database tblGeo. consists geo granularities (levels) selected year. lowest level enumeration area codes grunnkrets. Arguments write append can used calling geo_map() function. However cases, need use append = TRUE, ie. append data existing tblGeo database.","code":"DT <- geo_map(year = 2022) DT[sample(1:.N, 5)] code name validTo level grunnkrets kommune fylke bydel batch 1: 30470104 Søndre Simostranda 2022 grunnkrets 30470104 3047 30 2022-03-15 2: 11140110 Vikeså 2 2022 grunnkrets 11140110 1114 11 2022-03-15 3: 30020408 Ørehavna 2022 grunnkrets 30020408 3002 30 2022-03-15 4: 46350304 Hjartholm 2022 grunnkrets 46350304 4635 46 2022-03-15 5: 42160109 Birkeland Nord 2022 grunnkrets 42160109 4216 42 2022-03-15"},{"path":"https://helseprofil.github.io/orgdata/articles/geo-recode.html","id":"merge-geo-codes","dir":"Articles","previous_headings":"","what":"Merge Geo Codes","title":"Recode and Map Geo","text":"geo_recode() geo_map() fetch data via API available SSB. merge geo codes aren’t available via API can done function geo_merge(). data merge can format accepted read_file() function. new data must column id merge tblGeo table column new geo codes added . instance new dataset 2022 levekaar codes columname code_levekaar levekaar codes derived bydel codes columname var01, specification arguments example . Please read documentation details arguments can used help(\"geo_merge\") ?geo_merge.","code":"dd <- geo_merge(id.table = \"bydel\", id.file = \"var01\", geo.col = \"code_levekaar\", geo.level = \"levekaar\", file = \"C:/Users/ybka/data/levekaar.csv\", year = 2022)"},{"path":"https://helseprofil.github.io/orgdata/articles/get-started.html","id":"aggregate-all-files","dir":"Articles","previous_headings":"","what":"Aggregate all files","title":"Get started","text":"aggregate files specific group BEFOLKNING group. satisfy output error shown process, save output ie, object df , .csv file : certain process controlled everything working correctly. save output directly .csv file argument save = TRUE: advisable mark file KONTROLLERT Access Database table original files checked output. ensure shorter processing time re-run make_file() skip cleaning recording processes. allready saved database. database can found ../PRODUKSJON/STYRING/raw-khelse/org_database","code":"library(orgdata) df <- make_file(\"BEFOLKNING\") df save_file(df, \"BEFOLKNING\") df <- make_file(\"BEFOLKNING\", save = TRUE)"},{"path":"https://helseprofil.github.io/orgdata/articles/get-started.html","id":"aggregate-selected-files-only","dir":"Articles","previous_headings":"","what":"Aggregate selected files only","title":"Get started","text":"Aggregating whole files group take long time many files selected group. select specific file files selecting KOBLID instead. example selecting one files respectively.","code":"df <- make_file(\"BEFOLKNING\", koblid = 4) df <- make_file(\"BEFOLKNING\", c(4,10,15))"},{"path":"https://helseprofil.github.io/orgdata/articles/get-started.html","id":"process-files-without-aggregating","dir":"Articles","previous_headings":"","what":"Process files without aggregating","title":"Get started","text":"need look file prior aggregating . specify argument aggregate FALSE. behavior also achieved activating globally via options. activating globally using options, proceeding processes aggregated unless ’s changed function call ie. include argument aggregate = TRUE, reset global options :","code":"df <- make_file(\"BEFOLKNING\", aggregate = FALSE) # Global option options(orgdata.aggregate = FALSE) df <- make_file(\"BEFOLKNING\") reset_opt()"},{"path":"https://helseprofil.github.io/orgdata/articles/sepaafil.html","id":"loading","dir":"Articles","previous_headings":"","what":"Loading","title":"SePaaFil","text":"å aktivere orgdata pakke Oppdatere pakken når ny versjon er tilgjengelig HUSK Å ALLTID TILORDNE ET OBJEKT make_file() og read_file()! Les original fil som det er ved å velge FILID les_fil() kan også brukes til å lese data ved å skrive hele stien til filen og kan brukes til å lese filer flere formater bl.Excel, Stata, .CSV etc. Aggregere utvalgte fil eller filer med KOBLID Les filene en filgruppe og bruk oppsettet som er spesifisert Access Lagre CSV fil Å lagre det et annet sted Evt. hvis alle filer har ingen feil Hvis filene har blitt kontrollert så kan man lagre flere FILGRUPPER med en gang, du velger selv måten du liker å gjøre det. FILGRUPPE blir lagret som csv direkte. Ingen feilmelding er gitt. Eller","code":"# Kjør alt herfra ------------------- library(orgdata) options(orgdata.year = 2021) #Hvilket årgang til å omkode geo #til hit som oppsett ---------------- update_orgdata() dt <- make_file() dvs. ^ df <- les_fil(file = 12) #12 er en FILID df <- les_fil(\"C:/Users/abc/FileName.csv\") dt <- lag_fil(\"BEFOLKNING\", koblid = 13) dt <- lag_fil(\"BEFOLKNING\", koblid = c(13, 15, 20)) dt <- lag_fil(\"BEFOLKNING\") dt <- lag_fil(\"BEFOLKNING\", raw = TRUE) #les fra original filen hvis allerede er KONTROLLERT save_file(dt, \"BEFOLKNING\") save_file(dt, name = \"MinFil\", path = \"C:/Navn/Til/Mappen\") lag_fil(\"BEFOLKNING\", save = TRUE) fgp <- c(\"BEFOLKNING\", \"NEET\", \"DODE\") #med \" \" lag_filgrupper(fgp) lag_filgrupper(BEFOLKNING, NEET, DODE) #uten"},{"path":"https://helseprofil.github.io/orgdata/articles/sepaafil.html","id":"tips-and-tricks","dir":"Articles","previous_headings":"","what":"Tips and Tricks","title":"SePaaFil","text":"Lest bare et bestemt antall rader f.eks 5 rader kan også brukes andre argumenter f.eks header = FALSE, skip = 0, sep = ; osv. Sjekk dokumentet. Sjekk koding:","code":"les_fil(file = 1, nrows = 5) # Sjekk kategorier evt. omkoding df <- les_fil(file = 1) se_fil(df) #alle kolonner se_fil(df, 1) #bare kolonne 1 se_fil(df, c(1:5)) #kolonner 1 til 5 se_fil(df, c(1,4,6)) se_fil(df, LANDBAK, INNVKAT) df[, .N, keyby = landb] #kategori for landb i original data dt <- lag_fil(\"TEST01\", koblid = 1) dt[, .N, keyby = LANDB] #kategori i omkodet aggregerte data dt[, .N, keyby = LANDF] # Få å finne kategorier bare for kommune eller spesifik kjonn dt[LEVEL == \"kommune\", .N, keyby = LANDBAK] dt[KJONN == 1, .N, keyby = LANDBAK] # Sjekk koder f.eks GEO 1050110 dt[GEO == 1050110] # Sjekk flere koder samtidig dt[GEO %in% c(1050110, 1050122)] # Sjekk GEO koder starter med 301 dt[GEO %like% \"^301\"] # Sjekk GEO avsluttet med 99 dt[GEO %like% \"99$\"] # Se alle rader i datasettet View(df) # Se logfiler read_log(\"code00\", 343) #343 er en KOBLID read_log(\"code99\", 343) # Åpne hjemmeside website() # Sjekk versjon packageVersion(\"orgdata\") # Se alle global options names(orgdata:::opt.orgdata) orgdata:::opt.orgdata #default verdi"},{"path":"https://helseprofil.github.io/orgdata/articles/sepaafil.html","id":"debugging","dir":"Articles","previous_headings":"","what":"Debugging","title":"SePaaFil","text":"å se original koder og hva det skal bli kodet til å se hva kodene skal bli aggregert til HUSK å nullstille etter bruk av debug funksjon","code":"debug_opt(\"geo\") debug_opt(\"aggregate\") reset_opt()"},{"path":"https://helseprofil.github.io/orgdata/articles/standard.html","id":"keyword-for-github-commit","dir":"Articles","previous_headings":"","what":"Keyword for GitHub Commit","title":"Make things standard","text":"keywords helpful searching relevant commits: Feat: new feature function Fix: bug fix Doc: documentation changes documentation Close: Style: changes code comments aren’t bugs Test: code testing tests folder DEV: development processes new feature VER: first version upgrade Misc: changes aren’t critical doesn’t fit keywords. Avoid using possible last resort Example commit message","code":"Feat: Get list of new files New files are missing in the current list. They need to be in the current list before aggregating."},{"path":"https://helseprofil.github.io/orgdata/articles/standard.html","id":"github-commit-message","dir":"Articles","previous_headings":"","what":"Github Commit Message","title":"Make things standard","text":"Use message commit follows: first line gives summary done. Preferably write imperative mood like commanding someone especially commit related features, functions (Feat:) fixing code (Fix).","code":"Keyword: Write summary as imperative or command More detail explanation if necessary with maximum 72 characters and use line break for long sentences."},{"path":"https://helseprofil.github.io/orgdata/articles/standard.html","id":"folders-structure","dir":"Articles","previous_headings":"","what":"Folders structure","title":"Make things standard","text":"files located files used. Folder /R R codes functions objects orgdata live. Folder /inst SQL code files files needed package. Folder /dev files aren’t used package good reference code testing. Files prefix utils-* folder /R helper functions used multiple times different places. Put functions helper functions file aren’t used different places.","code":""},{"path":"https://helseprofil.github.io/orgdata/articles/standard.html","id":"naming-style-function-or-object","dir":"Articles","previous_headings":"","what":"Naming style (function or object)","title":"Make things standard","text":"Use naming style: snake_case style function eg. find_column_input camelCase style object eg. fileGroup kebab-case style filename eg. utils-internal.R","code":""},{"path":"https://helseprofil.github.io/orgdata/articles/standard.html","id":"function-names","dir":"Articles","previous_headings":"","what":"Function names","title":"Make things standard","text":"effort group functions according responsibilities :) Files read_ perfix major functions. Files do_ prefix action functions. Files get_ prefix column specific functions. Files find_ prefix helper functions. Files is_ prefix internal functions utility use orgdata package. Internal functions exported needed, can accessed ::: eg. orgdata:::is_separate().","code":""},{"path":"https://helseprofil.github.io/orgdata/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Yusman Kamaleri. Author, maintainer. FHI KHelse group. Contributor, reviewer. https://www.fhi./hn/folkehelse","code":""},{"path":"https://helseprofil.github.io/orgdata/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Kamaleri Y (2022). orgdata: Aggregating Original Data. R package version 0.7.5, https://github.com/helseprofil/orgdata.","code":"@Manual{, title = {orgdata: Aggregating Original Data}, author = {Yusman Kamaleri}, year = {2022}, note = {R package version 0.7.5}, url = {https://github.com/helseprofil/orgdata}, }"},{"path":"https://helseprofil.github.io/orgdata/index.html","id":"orgdata-","dir":"","previous_headings":"","what":"Aggregating Original Data","title":"Aggregating Original Data","text":"Cleaning, restructuring aggregating ORiGinal DATA preferred dataset.","code":""},{"path":"https://helseprofil.github.io/orgdata/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Aggregating Original Data","text":"install run code maintain dependencies package version, can install orgdata user branch reproducibility, ie. keeping package version dependencies used development process. must however install Git prior using kh_restore() function. Alternatively can update new version install development version via orgdata.","code":"source(\"https://raw.githubusercontent.com/helseprofil/misc/main/utils.R\") kh_install(\"orgdata\") source(\"https://raw.githubusercontent.com/helseprofil/misc/main/utils.R\") kh_restore(\"orgdata\") orgdata::update_orgdata() # install development versjon orgdata::update_orgdata(ref = \"dev\")"},{"path":"https://helseprofil.github.io/orgdata/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Aggregating Original Data","text":"implement specifications per file group registered database use make_file() function. Use function make_filegroups() process multiple file groups .","code":"library(orgdata) # All files under BEFOLKNING group dt <- make_file(\"BEFOLKNING\") # For selected files with KOBLID dt <- make_file(\"BEFOLKNING\", koblid = 48) dt <- make_file(\"BEFOLKNING\", koblid = c(48, 72)) make_filegroups(BEFOLKNING, LESEFERD, NEET)"},{"path":"https://helseprofil.github.io/orgdata/index.html","id":"resources","dir":"","previous_headings":"","what":"Resources","title":"Aggregating Original Data","text":"Get started Functions overview Presentation slides Conventions Video guide","code":""},{"path":"https://helseprofil.github.io/orgdata/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2021 orgdata authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/debug_opt.html","id":null,"dir":"Reference","previous_headings":"","what":"Debugging options — debug_opt","title":"Debugging options — debug_opt","text":"wrapper debugging options.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/debug_opt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Debugging options — debug_opt","text":"","code":"debug_opt( opt = c(\"shallow\", \"deep\", \"nrow\", \"row\", \"aggregate\", \"geo\"), val = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/debug_opt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Debugging options — debug_opt","text":"opt Debug options val Value options","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/debug_opt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Debugging options — debug_opt","text":"Options available: \"shallow\" : Show executed funcitons process flow \"deep\" : Show deeper including helper functions process flow \"nrow\" : orgdata.debug.nrow. Default value 20 val argument missing \"row\" : orgdata.debug.row. Default value 1:50 val argument missing \"aggregate\" : Activating orgdata.debug.aggregate \"geo\" : Activating orgdata.debug.geo","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/debug_opt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Debugging options — debug_opt","text":"","code":"if (FALSE) { debug_opt(\"geo\") debug_opt(\"nrow\", 30) }"},{"path":"https://helseprofil.github.io/orgdata/reference/do_aggregate.html","id":null,"dir":"Reference","previous_headings":"","what":"Aggregate Data — do_aggregate","title":"Aggregate Data — do_aggregate","text":"Aggregate data according specification tbl_Filgruppe AGGREGERE column. input argument source must lower granularity level level input.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_aggregate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Aggregate Data — do_aggregate","text":"","code":"do_aggregate( dt = NULL, source = c(\"grunnkrets\", \"fylke\", \"kommune\", \"bydel\"), level = getOption(\"orgdata.geo.levels\"), year = NULL, aggregate.col = NULL, geoDT = NULL, check = NULL, base = NULL, control = FALSE, wide = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/do_aggregate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Aggregate Data — do_aggregate","text":"dt Input data preferrably data.table format mandatory source geographical granularity codes available source data. used merging geo codebook generated geo_map() ie. tblGeo geo database level Geographical granularity aggregating data. See getOption(\"orgdata.geo.levels\") year year geograhical codes recoded . empty global option orgdata.year used. aggregate.col columns aggregate standard ie. UTDANN, LANDSSB, LANDBAK INNVKAT geoDT Geo codes aggregate dataset check TRUE output keep variables geographical levels without aggregating . useful check geographical codes missing. Else use options(orgdata.aggregate = FALSE) base Logical value. TRUE use year original data base year recode geographical codes. Default FALSE use available codes geo codebook control Logical value. TRUE file controlled possible errors wide Column(s) reshape wide","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_aggregate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Aggregate Data — do_aggregate","text":"","code":"if (FALSE) { # To aggregate source data with enumeration area codes ie. grunnkrets, to # manucipaltiy ie. kommune dt <- make_file(\"BEFOLKNING\") DT <- do_aggregate(dt, source = \"grunnkrets\", level = \"kommune\") }"},{"path":"https://helseprofil.github.io/orgdata/reference/do_colname.html","id":null,"dir":"Reference","previous_headings":"","what":"Rename Columns — do_colname","title":"Rename Columns — do_colname","text":"Rename standard columns dataset","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_colname.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rename Columns — do_colname","text":"","code":"do_colname(dt = NULL, cols = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_colname.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rename Columns — do_colname","text":"dt Input data preferrably data.table format mandatory cols Old new columns. See output get_colname()","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_column_standard.html","id":null,"dir":"Reference","previous_headings":"","what":"Rename Standard Columns — do_column_standard","title":"Rename Standard Columns — do_column_standard","text":"Renaming standard columns. see standard columns run orgdata:::is_standard_cols().","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_column_standard.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rename Standard Columns — do_column_standard","text":"","code":"do_column_standard(dt = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_column_standard.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rename Standard Columns — do_column_standard","text":"dt Input data preferrably data.table format mandatory spec Specification data list. See output get_column_standard","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_delete_row.html","id":null,"dir":"Reference","previous_headings":"","what":"Delete Selected Rows — do_delete_row","title":"Delete Selected Rows — do_delete_row","text":"Delete selected rows dataset. rows deleted can specified directly Access registration database using minus symbol -","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_delete_row.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Delete Selected Rows — do_delete_row","text":"","code":"do_delete_row(dt = NULL, spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_delete_row.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Delete Selected Rows — do_delete_row","text":"dt Input data preferrably data.table format mandatory spec Specifications data data.frame con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args.html","id":null,"dir":"Reference","previous_headings":"","what":"Execute Extra Arguments — do_extra_args","title":"Execute Extra Arguments — do_extra_args","text":"based input EXTRA column Access registration database. arguments valid can expanded whenever needed. See details section valid arguments used. argument names written CamelCase style.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Execute Extra Arguments — do_extra_args","text":"","code":"do_extra_args(dt = NULL, args = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Execute Extra Arguments — do_extra_args","text":"dt Dataset args Extra arguments specified details section .","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Execute Extra Arguments — do_extra_args","text":"Currently, arguments can used: DeleteNaRow : Delete row consisting NA columns","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args_group.html","id":null,"dir":"Reference","previous_headings":"","what":"Execute Extra Arguments for Filegroup — do_extra_args_group","title":"Execute Extra Arguments for Filegroup — do_extra_args_group","text":"based input EXTRA column Access registration database filegroup. arguments valid can expanded whenever needed. See details section valid arguments used. argument names written CamelCase style.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args_group.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Execute Extra Arguments for Filegroup — do_extra_args_group","text":"","code":"do_extra_args_group(dt = NULL, args = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args_group.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Execute Extra Arguments for Filegroup — do_extra_args_group","text":"dt Dataset args Extra arguments specified details section .","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args_group.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Execute Extra Arguments for Filegroup — do_extra_args_group","text":"Currently, arguments can used: DeleteOldBydel : Delete bydel codes 2003, except Oslo","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_geo_recode.html","id":null,"dir":"Reference","previous_headings":"","what":"Recode Geographical Codes — do_geo_recode","title":"Recode Geographical Codes — do_geo_recode","text":"Recode geographical codes current year. Codes based norgeo::track_change() function. split geogaphical codes previous year, first code current year code chronological order selected recode.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_geo_recode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recode Geographical Codes — do_geo_recode","text":"","code":"do_geo_recode( dt = NULL, code = NULL, type = c(\"grunnkrets\", \"fylke\", \"kommune\", \"bydel\"), year = NULL, con = NULL, geo = NULL, base = NULL, control = FALSE, ... )"},{"path":"https://helseprofil.github.io/orgdata/reference/do_geo_recode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recode Geographical Codes — do_geo_recode","text":"dt Input data preferrably data.table format mandatory code Code dataset old new codes data.table format. type geographical granularity recoding. dataset output running get_geo_recode() function. year year geograhical codes recoded . empty global option orgdata.year used. con Connection database geo Logical value. Keep old geographical code TRUE. Default FALSE. base Logical value. TRUE use year original data base year recode geographical codes. Default FALSE use available codes geo codebook control Logical value. TRUE file controlled possible errors ... additional arguments","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_geo_recode.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Recode Geographical Codes — do_geo_recode","text":"","code":"if (FALSE) { code <- get_geo_recode(con = geo$dbconn, type = \"grunnkrets\") dt <- make_file(\"BEFOLKNING\", aggregate = FALSE) DT <- do_geo_recode(dt, code) }"},{"path":"https://helseprofil.github.io/orgdata/reference/do_implicit_null.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Implicit Null — do_implicit_null","title":"Create Implicit Null — do_implicit_null","text":"Implicit Null happens variable dataset unequal number categories different years due one several categories zero case. variables except AAR GEO must equal number categories. data handled package aggregated rawdata. categories variables might different different year. elucidate non-existence category rather zero number belonging category. function standardize categories across year.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_implicit_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Implicit Null — do_implicit_null","text":"","code":"do_implicit_null( dt = NULL, level = c(\"grunnkrets\", \"fylke\", \"kommune\", \"bydel\") )"},{"path":"https://helseprofil.github.io/orgdata/reference/do_implicit_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Implicit Null — do_implicit_null","text":"dt Dataset consisting years level Geographical granularity aggregating data. See getOption(\"orgdata.geo.levels\")","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_make_file_each.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Each File — do_make_file_each","title":"Process Each File — do_make_file_each","text":"Process file parallelly","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_make_file_each.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Each File — do_make_file_each","text":"","code":"do_make_file_each( spec, fgspec, aggregate, datacols, year, row, base, duck = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/do_make_file_each.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Each File — do_make_file_each","text":"spec File specification fgspec Filegroup specification aggregate Logical value. Default TRUE. Aggregate data according specification registration database. Global options orgdata.aggregate. datacols Columnames kept year year geograhical codes recoded . empty global option orgdata.year used. row Select specific row(s) numbers . Useful debugging. Please read Debugging article detail. base Logical value. TRUE use year original data base year recode geographical codes. Default FALSE use available codes geo codebook duck R6 object DuckDB","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_manheader.html","id":null,"dir":"Reference","previous_headings":"","what":"Rename Colname Manually — do_manheader","title":"Rename Colname Manually — do_manheader","text":"Rename columns manually based column index.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_manheader.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rename Colname Manually — do_manheader","text":"","code":"do_manheader(dt = NULL, manspec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_manheader.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rename Colname Manually — do_manheader","text":"dt Input data preferrably data.table format mandatory manspec Specification MANHEADER column tbl_Innlesing","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_mutate.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Column — do_mutate","title":"Create Column — do_mutate","text":"Create new column value specified symbols less < > standard columns. example specified KJONN <2>, new column KJONN created value 2. function applicable columns \"GEO\", \"AAR\", \"KJONN\", \"ALDER\", \"UTDANN\", \"LANDSSB\", \"TABS\" \"VALS\".","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_mutate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Column — do_mutate","text":"","code":"do_mutate(dt = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_mutate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Column — do_mutate","text":"dt Input data preferrably data.table format mandatory spec Specifications data data.frame","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode.html","id":null,"dir":"Reference","previous_headings":"","what":"Recode Variables — do_recode","title":"Recode Variables — do_recode","text":"Recode variables based specification tbl_KodeBok ie. codebook. LESID must combined FILGRUPPE create unique reference able recode variables. Specification group ALLE used neither FILGRUPPE LESID specified.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recode Variables — do_recode","text":"","code":"do_recode(dt = NULL, spec = NULL, con = NULL, control = FALSE)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recode Variables — do_recode","text":"dt Input data preferrably data.table format mandatory spec Specifications data data.frame con Connection database control Logical value. TRUE file controlled possible errors","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_aggregate.html","id":null,"dir":"Reference","previous_headings":"","what":"Recode Category Representing All Groups — do_recode_aggregate","title":"Recode Category Representing All Groups — do_recode_aggregate","text":"Recode category aggregating data based specification Codebook. example aggregating category type diagnoses NA produced represent type diagnoses. basically recode NA preferred value 0 Total.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_aggregate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recode Category Representing All Groups — do_recode_aggregate","text":"","code":"do_recode_aggregate( dt = NULL, spec = NULL, con = NULL, aggregate = NULL, control = FALSE )"},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_aggregate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recode Category Representing All Groups — do_recode_aggregate","text":"dt Input data preferrably data.table format mandatory spec Specification tbl_Filgruppe con Connection database aggregate Logical value. Default TRUE. Aggregate data according specification registration database. Global options orgdata.aggregate. control Logical value. TRUE file controlled possible errors","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_post.html","id":null,"dir":"Reference","previous_headings":"","what":"Post Recode Columns — do_recode_post","title":"Post Recode Columns — do_recode_post","text":"Recode selected columns cleaning processing filegroup based specification FILGRUPPE codebook type PS. example columns filegroup values specific year. column value 0. Instead special symbol .. given, representing column missing value available calculation. specify FRA column registration database recode years 1990 2000 TAB1 value foo selected value KOL column ie. AAR = 1990:2000 & TAB1 = \"foo\". Important use symbol & one conditions recode. use R code syntax directly asis, use raw prefix ie. raw(AAR == 1990:2000 & TAB1 == \"foo\"). Selection %%, %chin%, | etc. can used raw prefix.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_post.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Post Recode Columns — do_recode_post","text":"","code":"do_recode_post(dt = NULL, spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_post.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Post Recode Columns — do_recode_post","text":"dt Input data preferrably data.table format mandatory spec Specification tbl_Filgruppe con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_regexp.html","id":null,"dir":"Reference","previous_headings":"","what":"Recode Variables with Regular Expression — do_recode_regexp","title":"Recode Variables with Regular Expression — do_recode_regexp","text":"Recode variables regular expression based specification tbl_KodeBok TYPE RE. specification codebook can specific, common general. Specific LESID FILGRUPPE specified create unique reference able recode variables. Common FILGRUPPE specified LESID left empty general FILGRUPPE specified ALLE LESID left empty.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_regexp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recode Variables with Regular Expression — do_recode_regexp","text":"","code":"do_recode_regexp(dt = NULL, spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_regexp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recode Variables with Regular Expression — do_recode_regexp","text":"dt Input data preferrably data.table format mandatory spec Specifications data data.frame con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_without_aggregate.html","id":null,"dir":"Reference","previous_headings":"","what":"Recode Geo Code Without Aggregate — do_recode_without_aggregate","title":"Recode Geo Code Without Aggregate — do_recode_without_aggregate","text":"Recode geo code without aggregating data. input argument source must lower granularity level level input.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_without_aggregate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recode Geo Code Without Aggregate — do_recode_without_aggregate","text":"","code":"do_recode_without_aggregate( dt = NULL, source = c(\"grunnkrets\", \"fylke\", \"kommune\", \"bydel\"), year = NULL, base = NULL, ... )"},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_without_aggregate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recode Geo Code Without Aggregate — do_recode_without_aggregate","text":"dt Input data preferrably data.table format mandatory source geographical granularity codes available source data. used merging output geo_map() year year geograhical codes recoded . empty global option orgdata.year used. base Logical value. TRUE use year original data base year recode geographical codes. Default FALSE use available codes geo codebook ... additional arguments","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_without_aggregate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Recode Geo Code Without Aggregate — do_recode_without_aggregate","text":"","code":"if (FALSE) { # Source data with enumeration area codes ie. grunnkrets dt <- make_file(\"BEFOLKNING\", aggregate = FALSE) }"},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshape from Wide to Long — do_reshape","title":"Reshape from Wide to Long — do_reshape","text":"Reshape dataset wide format long format.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshape from Wide to Long — do_reshape","text":"","code":"do_reshape(dt = NULL, respec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshape from Wide to Long — do_reshape","text":"dt Dataset reshaped respec Reshape specification id, measure reshape type variables. output get_reshape_id_val()","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_long.html","id":null,"dir":"Reference","previous_headings":"","what":"Special Need Reshape to Long — do_reshape_long","title":"Special Need Reshape to Long — do_reshape_long","text":"function applicable reshape data reshaped wide via Access specification RESHAPE columns.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_long.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Special Need Reshape to Long — do_reshape_long","text":"","code":"do_reshape_long(dt = NULL, respec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_long.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Special Need Reshape to Long — do_reshape_long","text":"dt output dataset do_reshape_wide() respec Reshape specification id value variables. output get_reshape_wide_spec()","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_rename_col.html","id":null,"dir":"Reference","previous_headings":"","what":"Rename Reshaped Column — do_reshape_rename_col","title":"Rename Reshaped Column — do_reshape_rename_col","text":"Reshaping variables dataset wide long produce ID value columns. function rename columns specified RESHAPE_KOL Access registration database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_rename_col.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rename Reshaped Column — do_reshape_rename_col","text":"","code":"do_reshape_rename_col(dt = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_rename_col.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rename Reshaped Column — do_reshape_rename_col","text":"dt Dataset reshaped spec Specification column RESHAPE_KOL tbl_Innlesing","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_wide.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshape from Long to Wide — do_reshape_wide","title":"Reshape from Long to Wide — do_reshape_wide","text":"Reshape dataset long format wide format.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_wide.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshape from Long to Wide — do_reshape_wide","text":"","code":"do_reshape_wide(dt = NULL, respec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_wide.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshape from Long to Wide — do_reshape_wide","text":"dt Dataset reshaped respec Reshape specification id value variables. output get_reshape_wide_spec()","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_split.html","id":null,"dir":"Reference","previous_headings":"","what":"Split Column — do_split","title":"Split Column — do_split","text":"Split columns specified registration database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_split.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split Column — do_split","text":"","code":"do_split(dt = NULL, split = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_split.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split Column — do_split","text":"dt Input data preferrably data.table format mandatory split Split specification list. equivalent output get_split() function","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_year.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Year to Data — do_year","title":"Add Year to Data — do_year","text":"Add column year exist rawdata","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_year.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Year to Data — do_year","text":"","code":"do_year(dt = NULL, year = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_year.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Year to Data — do_year","text":"dt Input data preferrably data.table format mandatory year Output get_year()","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/emoji.html","id":null,"dir":"Reference","previous_headings":"","what":"Emoji — emoji","title":"Emoji — emoji","text":"Change emoji output messages fun 😄","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/emoji.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Emoji — emoji","text":"","code":"emoji( x = c(\"mark\", \"thumb\", \"write\", \"smile\", \"sad\", \"santa\", \"search\", \"folder\", \"book\") )"},{"path":"https://helseprofil.github.io/orgdata/reference/emoji.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Emoji — emoji","text":"x Emoji choose ie. thumb, smile etc","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/emoji.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Emoji — emoji","text":"","code":"emoji(\"smile\")"},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_input.html","id":null,"dir":"Reference","previous_headings":"","what":"Columns with Single Input — find_column_input","title":"Columns with Single Input — find_column_input","text":"Get value column one input allowed.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Columns with Single Input — find_column_input","text":"","code":"find_column_input( spec = NULL, col = NULL, type = c(\"character\", \"double\", \"integer\") )"},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Columns with Single Input — find_column_input","text":"spec Specifications data data.frame col Column name database table type Type object output ie. double, integer character. Default character.","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_multi.html","id":null,"dir":"Reference","previous_headings":"","what":"Columns with Multiple Inputs — find_column_multi","title":"Columns with Multiple Inputs — find_column_multi","text":"Get arguments selected column multiple arguments find_column_multi(). output character type arguments length. can can used find_column_multi_input() function get value input list object. interested specific argument among arguments column, use find_column_multi_input_arg() function. See example.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_multi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Columns with Multiple Inputs — find_column_multi","text":"","code":"find_column_multi(spec = NULL, col = NULL, sep = c(\",\", \"|\", \":\", \";\", \"&\")) find_column_multi_input(input = NULL) find_column_multi_input_arg(input = NULL, arg = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_multi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Columns with Multiple Inputs — find_column_multi","text":"spec Specifications data data.frame col Column name database table sep Symbols separate arguments eg. \",\" \":\" input Input argument(s) character vector arg Name specific argument column","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_multi.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Columns with Multiple Inputs — find_column_multi","text":"Output: find_column_multi gives character vector arguments separated sep argument find_column_multi_input gives list argument names values find_column_multi_input_arg gives single object value selected argument","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_multi.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Columns with Multiple Inputs — find_column_multi","text":"","code":"if (FALSE) { args <- find_column_multi(spec, \"INNLESARG\") vals <- find_column_multi_input(args) val <- find_column_multi_input_arg(args, \"header\") }"},{"path":"https://helseprofil.github.io/orgdata/reference/find_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Find Rawdata — find_data","title":"Find Rawdata — find_data","text":"Find rawdata load memory process. requires class attribute file set prior using find_data() method. Otherwise, use read_file() function instead unless specific reason .","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find Rawdata — find_data","text":"","code":"find_data(file = NULL, ...)"},{"path":"https://helseprofil.github.io/orgdata/reference/find_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find Rawdata — find_data","text":"file Input file ... options relevant file type","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find Rawdata — find_data","text":"","code":"if (FALSE) { file <- \"path/to/my-data.csv\" class(file) <- \"csv\" dt <- find_data(file) }"},{"path":"https://helseprofil.github.io/orgdata/reference/find_implicit_col.html","id":null,"dir":"Reference","previous_headings":"","what":"Find Implicit Null Categories — find_implicit_col","title":"Find Implicit Null Categories — find_implicit_col","text":"Find implicit null categories selected columns every selected year","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_implicit_col.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find Implicit Null Categories — find_implicit_col","text":"","code":"find_implicit_col(dt, years, col, ref)"},{"path":"https://helseprofil.github.io/orgdata/reference/find_implicit_col.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find Implicit Null Categories — find_implicit_col","text":"dt Dataset consisting years years years dataset col Selected column controlled implicit null ref Reference values selected column","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/find_implicit_null.html","id":null,"dir":"Reference","previous_headings":"","what":"Dataset for Implicit Null — find_implicit_null","title":"Dataset for Implicit Null — find_implicit_null","text":"Create dataset implicit null every selected columns","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_implicit_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dataset for Implicit Null — find_implicit_null","text":"","code":"find_implicit_null(imp, year, colstr, level)"},{"path":"https://helseprofil.github.io/orgdata/reference/find_implicit_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dataset for Implicit Null — find_implicit_null","text":"imp list implicit null data derived get_implicit_col function year Selected year dataset colstr Column structure Class type level Geographical granularity aggregating data. See getOption(\"orgdata.geo.levels\")","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/find_spec.html","id":null,"dir":"Reference","previous_headings":"","what":"File Specifications in Registration Database — find_spec","title":"File Specifications in Registration Database — find_spec","text":"function find specifications Access registration database via SQL code. example orginal data data restructured aggregated.. etc.. etc.. specifications registered following tables: tbl_Filgruppe - File group specification output tbl_Orgfile - original files tbl_Innlesing - file read R tbl_Koble - Connection original files file groups read tbl_KodeBok - Code book recode value tbl_Compute - Code book create new category existing categories SQL file must written base::sprintf style ie. '%s','%d' etc. Please refer base::sprintf documentation. addition, SQL code must contain comments. Example SQL code '%s': SELECT * tbl_Koble FILGRUPPE = '%s' saved C:/myfile.sql run code example.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_spec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"File Specifications in Registration Database — find_spec","text":"","code":"find_spec( file = NULL, value = NULL, con = NULL, external = FALSE, char = NULL, char2 = NULL, opposite = FALSE )"},{"path":"https://helseprofil.github.io/orgdata/reference/find_spec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"File Specifications in Registration Database — find_spec","text":"file SQL file. external TRUE complete filepath must specified. value value selection SQL code base::sprintf style. example name filgruppe. con Connection database external SQL file outside package. Default FALSE. char First input value added query char2 Second input value added query opposite TRUE second input value read first input value","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_spec.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"File Specifications in Registration Database — find_spec","text":"put data.frame.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_spec.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"File Specifications in Registration Database — find_spec","text":"","code":"if (FALSE) { qr <- find_spec(\"C:/myfile.sql\", value = \"BEFOLKNING\", con = dbconn, external = TRUE) qr2 <- find_spec(\"your.sql\", con = dbconn, char = \"BEFOLKNING\", char2 = 14) }"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_levels.html","id":null,"dir":"Reference","previous_headings":"","what":"Granularity of Georgraphical Codes — geo_levels","title":"Granularity of Georgraphical Codes — geo_levels","text":"Create database granularity geographical codes aggregate data accordingly. Implementation function base norgeo::cast_geo() function norgeo package.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/geo_levels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Granularity of Georgraphical Codes — geo_levels","text":"","code":"geo_levels(year = NULL, write = FALSE, append = FALSE, table = \"tblGeo\")"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_levels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Granularity of Georgraphical Codes — geo_levels","text":"year Year valid geographical codes write Write table orgdata.geo database. overwrite table already exists append Append data existing table orgdata.geo table Table name created database. Default tblGeo","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/geo_levels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Granularity of Georgraphical Codes — geo_levels","text":"","code":"if (FALSE) { geo_map(2020, write = TRUE) geo_map(2021, append = TRUE) }"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_map.html","id":null,"dir":"Reference","previous_headings":"","what":"Granularity of Geographical Codes — geo_map","title":"Granularity of Geographical Codes — geo_map","text":"Create database granularity geographical codes aggregate data accordingly. Implementation function base norgeo::cast_geo() function norgeo package.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/geo_map.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Granularity of Geographical Codes — geo_map","text":"","code":"geo_map(year = NULL, write = FALSE, append = FALSE, table = \"tblGeo\")"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_map.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Granularity of Geographical Codes — geo_map","text":"year Year valid geographical codes write Write table orgdata.geo database. overwrite table already exists append Append data existing table orgdata.geo table Table name created database. Default tblGeo","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/geo_map.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Granularity of Geographical Codes — geo_map","text":"","code":"if (FALSE) { geo_map(2020, write = TRUE) geo_map(2021, append = TRUE) }"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_merge.html","id":null,"dir":"Reference","previous_headings":"","what":"Merge Other Geo Level Manually — geo_merge","title":"Merge Other Geo Level Manually — geo_merge","text":"Geo codes downloaded SSB API can merged main geo table ie. tblGeo geocodes database. file must consist id column merge ie. id.file geo codes add ie. geo.col.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/geo_merge.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Merge Other Geo Level Manually — geo_merge","text":"","code":"geo_merge( id.table = NULL, id.file = NULL, geo.col = NULL, geo.level = NULL, file = NULL, year = NULL, write = FALSE, table.name = \"tblGeo\", ... )"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_merge.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Merge Other Geo Level Manually — geo_merge","text":"id.table ID columname merge found database eg. kommune id.file ID columname file merge . depends columnames files. id.table kommune, id.file must columname representing geo codes equivalent kommune codes. id.table id.file used merging codes must unique. geo.col Columname new geo codes eg. new geo codes levekaar, geo.col columname codes levekaar can found. geo.level Geographical level merged file representing eg. \"levekaar\". value column level tblGeo database. file Complete path filename merge year Year code valid . sepecified orgdata.year used. write Write table orgdata.geo database. overwrite table already exists table.name Name table geo recode geocodes database. can found getOptions(\"orgdata.geo\"). default tblGeo. ... possible arguments","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/geo_merge.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Merge Other Geo Level Manually — geo_merge","text":"","code":"if (FALSE) { dt <- geo_merge(id.table = \"grunnkrets\", id.file = \"id\", geo.col = \"col2\", geo.level = \"levekaar\", file = \"C:/path/to/file.csv\", year = 2022) }"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_recode.html","id":null,"dir":"Reference","previous_headings":"","what":"Geographical Codes to Recode — geo_recode","title":"Geographical Codes to Recode — geo_recode","text":"Create table current year geographical codes previous years geogprahical codes. used recode previous years codes current codes. Implementation function base norgeo::track_change() function.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/geo_recode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Geographical Codes to Recode — geo_recode","text":"","code":"geo_recode( type = c(\"grunnkrets\", \"bydel\", \"kommune\", \"fylke\"), from = NULL, to = NULL, write = FALSE, append = FALSE )"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_recode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Geographical Codes to Recode — geo_recode","text":"type Type regional granularity ie. enumeration area (grunnkrets) Starting year range period. Current year default left empty End year range period. Current year default left empty write Write table orgdata.geo database. overwrite table already exists append Append data existing table orgdata.geo","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/geo_recode.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Geographical Codes to Recode — geo_recode","text":"","code":"if (FALSE) { geo_recode(type = \"grunnkrets\", from = 2018, to = 2021, write = TRUE) geo_recode(type = \"grunnkrets\", from = 2018, to = 2021, append = TRUE) }"},{"path":"https://helseprofil.github.io/orgdata/reference/get_aggregate.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Aggregate Specification — get_aggregate","title":"Get Aggregate Specification — get_aggregate","text":"Get specification data aggregated different geographical levels ie. county, manucipality, town etc.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_aggregate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Aggregate Specification — get_aggregate","text":"","code":"get_aggregate(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_aggregate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Aggregate Specification — get_aggregate","text":"group group files (filgruppe) con Connection database spec Specification tbl_Filgruppe","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok.html","id":null,"dir":"Reference","previous_headings":"","what":"Codebook — get_codebok","title":"Codebook — get_codebok","text":"Get codebook recoding variables based FILGRUPPE LESID number. Specification group ALLE used neither FILGRUPPE LESID specified.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Codebook — get_codebok","text":"","code":"get_codebok(spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Codebook — get_codebok","text":"spec Specifications data data.frame con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok_aggregate.html","id":null,"dir":"Reference","previous_headings":"","what":"Codebook for Aggregate Columns — get_codebok_aggregate","title":"Codebook for Aggregate Columns — get_codebok_aggregate","text":"Get codebook recoding aggregated variables based FILGRUPPE. Specification group ALLE used FILGRUPPE specified.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok_aggregate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Codebook for Aggregate Columns — get_codebok_aggregate","text":"","code":"get_codebok_aggregate(spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok_aggregate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Codebook for Aggregate Columns — get_codebok_aggregate","text":"spec Specifications data data.frame con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok_regexp.html","id":null,"dir":"Reference","previous_headings":"","what":"Codebook with Regular Expression — get_codebok_regexp","title":"Codebook with Regular Expression — get_codebok_regexp","text":"Get codebook regular expression recode variables based FILGRUPPE LESID number. Specification group ALLE used neither FILGRUPPE LESID specified.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok_regexp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Codebook with Regular Expression — get_codebok_regexp","text":"","code":"get_codebok_regexp(spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok_regexp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Codebook with Regular Expression — get_codebok_regexp","text":"spec Specifications data data.frame con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_colname.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Renamed Columns — get_colname","title":"Get Renamed Columns — get_colname","text":"Get old new coloumnames renamed dataset.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_colname.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Renamed Columns — get_colname","text":"","code":"get_colname(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_colname.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Renamed Columns — get_colname","text":"group group files (filgruppe) con Connection database spec Specification tbl_Filgruppe","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_colname.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Renamed Columns — get_colname","text":"list consist two variables ie. old new indicating old new columnames","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_column_standard.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Standard Columns — get_column_standard","title":"Get Standard Columns — get_column_standard","text":"Standard columns names rawdata checked standard names options getOption(\"orgdata.columns\"). Nevertheless column GEO special case geo codes derived combination two columns.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_column_standard.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Standard Columns — get_column_standard","text":"","code":"get_column_standard(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_column_standard.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Standard Columns — get_column_standard","text":"group group files (filgruppe) con Connection database spec Specification standard columns tbl_Innlesing","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_column_standard.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Standard Columns — get_column_standard","text":"list old new columnnames","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_delete_row_spec.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Rows for Deletion — get_delete_row_spec","title":"Get Rows for Deletion — get_delete_row_spec","text":"Get rows deleted specified minus - symbol codebook based FILGRUPPE LESID number. Specification group ALLE used neither FILGRUPPE LESID specified.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_delete_row_spec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Rows for Deletion — get_delete_row_spec","text":"","code":"get_delete_row_spec(spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_delete_row_spec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Rows for Deletion — get_delete_row_spec","text":"spec Specifications data data.frame con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Extra Arguments — get_extra_args","title":"Get Extra Arguments — get_extra_args","text":"based input EXTRA column Access registration database. arguments valid can expanded whenever needed. argument names written CamelCase style. Use comma seperate multiple arguments.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Extra Arguments — get_extra_args","text":"","code":"get_extra_args(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Extra Arguments — get_extra_args","text":"group group files (filgruppe) con Connection database spec Specifications data data.frame","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Extra Arguments — get_extra_args","text":"list names value arguments","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args_group.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Extra Arguments for Filegroup — get_extra_args_group","title":"Get Extra Arguments for Filegroup — get_extra_args_group","text":"based input EXTRA column Access registration database filegroup. arguments valid can expanded whenever needed. argument names written CamelCase style. Use comma seperate multiple arguments.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args_group.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Extra Arguments for Filegroup — get_extra_args_group","text":"","code":"get_extra_args_group(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args_group.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Extra Arguments for Filegroup — get_extra_args_group","text":"group group files (filgruppe) con Connection database spec Specifications data data.frame","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args_group.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Extra Arguments for Filegroup — get_extra_args_group","text":"list names value arguments","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_geo_recode.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Previous and Current Geo Codes — get_geo_recode","title":"Get Previous and Current Geo Codes — get_geo_recode","text":"Get geographical codes registered geo-database consist old new codes applicable respective year.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_geo_recode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Previous and Current Geo Codes — get_geo_recode","text":"","code":"get_geo_recode( con = NULL, type = c(\"grunnkrets\", \"fylke\", \"kommune\", \"bydel\"), year = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/get_geo_recode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Previous and Current Geo Codes — get_geo_recode","text":"con Connection database type geographical granularity recode year year geograhical codes recoded . empty global option orgdata.year used.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_geo_recode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Previous and Current Geo Codes — get_geo_recode","text":"dataset columns GEO representing GEO codes recoded new code ie. .","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_grunnkrets_dummy.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Dummy Enumeration Area Codes — get_grunnkrets_dummy","title":"Create Dummy Enumeration Area Codes — get_grunnkrets_dummy","text":"downloaded enumeration area codes SSB lack codes missing ie. xxxx9999. function create codes needed recoding older codes current enumeration area codes.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_grunnkrets_dummy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Dummy Enumeration Area Codes — get_grunnkrets_dummy","text":"","code":"get_grunnkrets_dummy(dt, from, to)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_grunnkrets_dummy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Dummy Enumeration Area Codes — get_grunnkrets_dummy","text":"dt Downloaded data norgeo::track_change() Starting year range period. Current year default left empty End year range period. Current year default left empty","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_col.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Implicit Null Categories — get_implicit_col","title":"Get Implicit Null Categories — get_implicit_col","text":"Get categories implicit values selected columns","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_col.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Implicit Null Categories — get_implicit_col","text":"","code":"get_implicit_col(dt, years, cols, refs)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_col.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Implicit Null Categories — get_implicit_col","text":"dt Dataset consisting years years years dataset cols Columns controlled implicit null refs Reference values selected columns","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_per_year.html","id":null,"dir":"Reference","previous_headings":"","what":"Dataset for Implicit Null by Year — get_implicit_per_year","title":"Dataset for Implicit Null by Year — get_implicit_per_year","text":"Create dataset implicit null available year dataset","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_per_year.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dataset for Implicit Null by Year — get_implicit_per_year","text":"","code":"get_implicit_per_year(imp, refs, years, colstr, .env = parent.frame())"},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_per_year.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dataset for Implicit Null by Year — get_implicit_per_year","text":"imp list implicit null data derived get_implicit_col function refs Reference values selected columns years years dataset colstr Column structure Class type .env Inherit object parent frame","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_ref.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Reference Values — get_implicit_ref","title":"Get Reference Values — get_implicit_ref","text":"Get valid values columns controlled possible implicit null.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_ref.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Reference Values — get_implicit_ref","text":"","code":"get_implicit_ref(dt, cols)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_ref.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Reference Values — get_implicit_ref","text":"dt Dataset consisting years cols Columns controlled implicit null","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_innlesarg.html","id":null,"dir":"Reference","previous_headings":"","what":"Get INNLESARG Specifications — get_innlesarg","title":"Get INNLESARG Specifications — get_innlesarg","text":"function access possible arguments columns INNLESARG table tbl_Innlesing'. Symbol \"|\" MUST used separate arguments one arguments. symbol right top TAB button keyboard. Arguments can used depends file type. Please refer read_file(). example: header=TRUE | sheet=Ark1 | sep=,","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_innlesarg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get INNLESARG Specifications — get_innlesarg","text":"","code":"get_innlesarg(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_innlesarg.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get INNLESARG Specifications — get_innlesarg","text":"group group files (filgruppe) con Connection database spec Specifications data data.frame","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_innlesarg.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get INNLESARG Specifications — get_innlesarg","text":"list names value arguments","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_manheader.html","id":null,"dir":"Reference","previous_headings":"","what":"Get MANHEADER — get_manheader","title":"Get MANHEADER — get_manheader","text":"Get inputs column MANHEADER tbl_Innlesing. input tells want manually rename column various reasons column name rawdata long uses unstandard naming style. input like : 3,6=AGE,EDUCATION means want rename column 3 AGE column 6 EDUCATION.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_manheader.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get MANHEADER — get_manheader","text":"","code":"get_manheader(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_manheader.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get MANHEADER — get_manheader","text":"group group files (filgruppe) con Connection database spec Specifications data data.frame","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_manheader.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get MANHEADER — get_manheader","text":"list containing $index refer column index $col new name selected column index.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_mutate_value.html","id":null,"dir":"Reference","previous_headings":"","what":"Value for New Column — get_mutate_value","title":"Value for New Column — get_mutate_value","text":"Get value new column column fullfilled condition new column.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_mutate_value.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Value for New Column — get_mutate_value","text":"","code":"get_mutate_value(col)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_mutate_value.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Value for New Column — get_mutate_value","text":"col selected column","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_reshape_id_val.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshape Id and Measure — get_reshape_id_val","title":"Reshape Id and Measure — get_reshape_id_val","text":"Get id measure variables reshaping dataset. detail please read data.table::melt.data.table understand id mearsure variables.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_reshape_id_val.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshape Id and Measure — get_reshape_id_val","text":"","code":"get_reshape_id_val(dt = NULL, group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_reshape_id_val.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshape Id and Measure — get_reshape_id_val","text":"dt Dataset reshaped group group files (filgruppe) con Connection database spec Specification tbl_Filgruppe","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_reshape_wide_spec.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshape Wide Specification — get_reshape_wide_spec","title":"Reshape Wide Specification — get_reshape_wide_spec","text":"Get formula value variables reshaping long dataset wide. detail please read data.table::dcast.data.table understand formula value variables.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_reshape_wide_spec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshape Wide Specification — get_reshape_wide_spec","text":"","code":"get_reshape_wide_spec(dt = NULL, group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_reshape_wide_spec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshape Wide Specification — get_reshape_wide_spec","text":"dt Dataset reshaped group group files (filgruppe) con Connection database spec Specification tbl_Filgruppe","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_split.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Split Column — get_split","title":"Get Split Column — get_split","text":"Get column splitted column name new splitted columns. already specification find_spec(), arguments group con must NULL.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_split.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Split Column — get_split","text":"","code":"get_split(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_split.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Split Column — get_split","text":"group group files (filgruppe) con Connection database spec Specification tbl_Filgruppe","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_split.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Split Column — get_split","text":"list consist two variables ie. indicating column split new column names ","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_year.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Year of Data — get_year","title":"Get Year of Data — get_year","text":"Get year rawdata either available rawdata manually specified registration database. Check helper function is_defaar(). get_aar() alias get_year()","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_year.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Year of Data — get_year","text":"","code":"get_year(spec = NULL, con = NULL) get_aar(spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_year.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Year of Data — get_year","text":"spec Specifications data data.frame con Connection database","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_year.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Year of Data — get_year","text":"Either character integer value. Character value refering column name raw data value year. Integer value refers year shoule added raw data column name AAR","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_col_num_warn.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert column to numeric with warning — is_col_num_warn","title":"Convert column to numeric with warning — is_col_num_warn","text":"Covert numeric columns expected numeric give warning log coercion","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_col_num_warn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert column to numeric with warning — is_col_num_warn","text":"","code":"is_col_num_warn(dt, cols, koblid = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/is_col_num_warn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert column to numeric with warning — is_col_num_warn","text":"dt Dataset cols Columns converted numeric koblid ID connect file spec","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_col_separate.html","id":null,"dir":"Reference","previous_headings":"","what":"Multiple inputs style — is_col_separate","title":"Multiple inputs style — is_col_separate","text":"Multiple inputs separated , KOLNAVN MANHEADER","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_col_separate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multiple inputs style — is_col_separate","text":"","code":"is_col_separate(input)"},{"path":"https://helseprofil.github.io/orgdata/reference/is_col_separate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multiple inputs style — is_col_separate","text":"input product find_column_input()","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_conn_db.html","id":null,"dir":"Reference","previous_headings":"","what":"Connect to Database — is_conn_db","title":"Connect to Database — is_conn_db","text":"Alternative function produce R6 object connecting database","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_conn_db.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Connect to Database — is_conn_db","text":"","code":"is_conn_db(dbname = NULL, db = c(\"kh\", \"geo\", \"raw\"), .test = FALSE, ...)"},{"path":"https://helseprofil.github.io/orgdata/reference/is_conn_db.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connect to Database — is_conn_db","text":"dbname Database filename complete path db Database file kh (Kommunehelse), geo (Geo code) raw (Raw database) .test Use testing ... arguments","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_defaar.html","id":null,"dir":"Reference","previous_headings":"","what":"Year for The Data — is_defaar","title":"Year for The Data — is_defaar","text":"Find year value column DEFAAR table tbl_Orgfile column year available raw data. indicated $Y column AAR table tbl_Innlesing.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_defaar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Year for The Data — is_defaar","text":"","code":"is_defaar(id = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/is_defaar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Year for The Data — is_defaar","text":"con Connection database","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_defaar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Year for The Data — is_defaar","text":"integer","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_input_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Type of object input — is_input_type","title":"Type of object input — is_input_type","text":"Convert value selected type ie. checked typeof","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_input_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Type of object input — is_input_type","text":"","code":"is_input_type(value, type = c(\"character\", \"double\", \"integer\"))"},{"path":"https://helseprofil.github.io/orgdata/reference/is_input_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Type of object input — is_input_type","text":"value Input value converted","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_process_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Raw Data File — is_process_file","title":"Process Raw Data File — is_process_file","text":"Implement specifications raw data cleaning recoding data.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_process_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Raw Data File — is_process_file","text":"","code":"is_process_file( file, filespec, fgspec, con, verbose = NULL, row = NULL, control = FALSE, duck = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/is_process_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Raw Data File — is_process_file","text":"file File rawdata filespec Specification file tbl_Innlesing fgspec Specification file group con Connection database verbose Make processes explicit. Default FALSE row Select specific row control Logical value. file checked possible errors duck R6 object DuckDB","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_process_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Raw Data File — is_process_file","text":"dataset data.table format","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_query.html","id":null,"dir":"Reference","previous_headings":"","what":"Create the SQL query — is_query","title":"Create the SQL query — is_query","text":"Create SQL query get data specified","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_query.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create the SQL query — is_query","text":"","code":"is_query( file = NULL, value = NULL, external = FALSE, char = NULL, char2 = NULL, opposite = FALSE )"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":null,"dir":"Reference","previous_headings":"","what":"Connecting to Database — KHelse","title":"Connecting to Database — KHelse","text":"Connect registration database get necessary information data source cleaning specification. driver applicable Access Database. Calling method KHelse$new(YourFilePath) create object R6 Class. Please refer examples.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"Connecting to Database — KHelse","text":"dbname Database filename. dbtype Database type either Access DuckDB dbyear Production year. relevant DuckDB dbconn Database connection. tblname Table name created database. tblvalue Data inserted table tblname. Data must data.frame data.table format. dbpath Database path conn Create database connection. Default TRUE","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Connecting to Database — KHelse","text":"KHelse$new() KHelse$db_connect() KHelse$db_write() KHelse$db_read() KHelse$db_remove_table() KHelse$db_close()","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Connecting to Database — KHelse","text":"Start connecting database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Connecting to Database — KHelse","text":"","code":"KHelse$new( dbname = NULL, dbtype = \"Access\", dbyear = NULL, dbpath = FALSE, conn = TRUE )"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connecting to Database — KHelse","text":"dbname Database filename. dbtype Database type eg. Access, SQLite, DuckDB etc. dbyear Production year. arg relevant raw database DuckDB dbpath Path database file conn Create database connection. Default TRUE","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Connecting to Database — KHelse","text":"","code":"\\dontrun{ kh <- KHelse$new(file.path(getOption(\"orgdata.drive\"), getOption(\"orgdata.folder.db\"), getOption(\"orgdata.db\"))) kh$dbname kh$db_close() kh$db_connect() }"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"method-db-connect-","dir":"Reference","previous_headings":"","what":"Method db_connect()","title":"Connecting to Database — KHelse","text":"Reconnect database db_close used.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Connecting to Database — KHelse","text":"","code":"KHelse$db_connect()"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"method-db-write-","dir":"Reference","previous_headings":"","what":"Method db_write()","title":"Connecting to Database — KHelse","text":"Write table database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Connecting to Database — KHelse","text":"","code":"KHelse$db_write( name = NULL, value = NULL, write = FALSE, append = FALSE, field.types = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connecting to Database — KHelse","text":"name Table name created database. value data inserted table. write Write table database. overwrite table already exists append Append data existing table database field.types Type data specified column. Must named vector","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"method-db-read-","dir":"Reference","previous_headings":"","what":"Method db_read()","title":"Connecting to Database — KHelse","text":"Read table convert data.table format","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Connecting to Database — KHelse","text":"","code":"KHelse$db_read(name = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connecting to Database — KHelse","text":"name Table name created database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"method-db-remove-table-","dir":"Reference","previous_headings":"","what":"Method db_remove_table()","title":"Connecting to Database — KHelse","text":"Remove table database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Connecting to Database — KHelse","text":"","code":"KHelse$db_remove_table(name = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connecting to Database — KHelse","text":"name Table name created database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"method-db-close-","dir":"Reference","previous_headings":"","what":"Method db_close()","title":"Connecting to Database — KHelse","text":"Close connection database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Connecting to Database — KHelse","text":"","code":"KHelse$db_close()"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Connecting to Database — KHelse","text":"","code":"## ------------------------------------------------ ## Method `KHelse$new` ## ------------------------------------------------ if (FALSE) { kh <- KHelse$new(file.path(getOption(\"orgdata.drive\"), getOption(\"orgdata.folder.db\"), getOption(\"orgdata.db\"))) kh$dbname kh$db_close() kh$db_connect() }"},{"path":"https://helseprofil.github.io/orgdata/reference/log.html","id":null,"dir":"Reference","previous_headings":"","what":"Environment to store log info — log","title":"Environment to store log info — log","text":"Environment store log info","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/log.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Environment to store log info — log","text":"","code":"log"},{"path":"https://helseprofil.github.io/orgdata/reference/log.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Environment to store log info — log","text":"object class environment length 0.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/make_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Implement the Specifications — make_file","title":"Implement the Specifications — make_file","text":"Make csv file specifications Access register database implement raw data selected group files ie. (filgruppe). files selected group affected unless KOBLID argument koblid specified. Specifying koblid useful especially testing purposes. function lag_fil() alias make_file().","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/make_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Implement the Specifications — make_file","text":"","code":"make_file( group = NULL, koblid = NULL, aggregate = NULL, save = FALSE, year = NULL, implicitnull = NULL, row = NULL, base = NULL, parallel = deprecated(), raw = NULL ) lag_fil( group = NULL, koblid = NULL, aggregate = NULL, save = FALSE, year = NULL, implicitnull = NULL, row = NULL, base = NULL, parallel = deprecated(), raw = NULL ) mf( group = NULL, koblid = NULL, aggregate = NULL, save = FALSE, year = NULL, implicitnull = NULL, row = NULL, base = NULL, parallel = deprecated(), raw = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/make_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Implement the Specifications — make_file","text":"group group files (filgruppe) koblid KOBLID table tbl_Koble aggregate Logical value. Default TRUE. Aggregate data according specification registration database. Global options orgdata.aggregate. save Logical value. Default FALSE. save .csv format file activating save_file() function. year year geograhical codes recoded . empty global option orgdata.year used. implicitnull Logical value. Default TRUE add implicit null dataset. Global options orgdata.implicit.null. row Select specific row(s) numbers . Useful debugging. Please read Debugging article detail. base Logical value. TRUE use year original data base year recode geographical codes. Default FALSE use available codes geo codebook parallel Logical numeric value. logical value TRUE run parallel using 50% ie. 0.5 local cores. User can decide percentage needed. example use 75% cores specify parallel = 0.75. Nevertheless, maximum cores allowed 80%. Default value FALSE ie. use sequential processing raw Logical value. Default FALSE config. TRUE read original raw data directly source file even dataset already available DuckDB without need unmark KONTROLLERT Access database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/make_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Implement the Specifications — make_file","text":"","code":"if (FALSE) { dt <- make_file(\"ENPERSON\") dt <- make_file(\"ENPERSON\", raw = TRUE) #Skip DuckDB and read directly from original files dt <- make_file(\"ENPERSON\", koblid = 120:125, parallel = TRUE) #with parallel processing }"},{"path":"https://helseprofil.github.io/orgdata/reference/make_filegroups.html","id":null,"dir":"Reference","previous_headings":"","what":"Make Multiple Filegroups — make_filegroups","title":"Make Multiple Filegroups — make_filegroups","text":"Implement specification registration database several filegroups . function used selected filegroups controlled errors. selected filegroups saved .csv file respective filegroup names folder registration database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/make_filegroups.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make Multiple Filegroups — make_filegroups","text":"","code":"make_filegroups(...) lag_filgrupper(...)"},{"path":"https://helseprofil.github.io/orgdata/reference/make_filegroups.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make Multiple Filegroups — make_filegroups","text":"... Filegroup(s)","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/make_filegroups.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make Multiple Filegroups — make_filegroups","text":"","code":"if (FALSE) { make_filegroups(NEET, TRANGBODD, DODE) fgp <- c(\"NEET\", \"TRANGBODD\",\"DODE\") make_filegroups(fgp) }"},{"path":"https://helseprofil.github.io/orgdata/reference/orgdata-package.html","id":null,"dir":"Reference","previous_headings":"","what":"orgdata: Aggregating Original Data — orgdata-package","title":"orgdata: Aggregating Original Data — orgdata-package","text":"Cleaning, restructuring aggregating original data usually enumerical area codes geographical codes.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/orgdata-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"orgdata: Aggregating Original Data — orgdata-package","text":"Aggregating Original Data (raw data) different geographical levels county, manucipality town.","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/orgdata-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"orgdata: Aggregating Original Data — orgdata-package","text":"Maintainer: Yusman Kamaleri ybka@fhi.(ORCID) contributors: FHI KHelse group (https://www.fhi./hn/folkehelse) [contributor, reviewer]","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/read_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Read Data File — read_file","title":"Read Data File — read_file","text":"Read rawdata either using FILID value complete file path. uses find_data() generic method. .csv file, data.table::fread() used arguments fread function can used. .xlsx .xls file readxl::read_excel() function arguments. .dta file, haven::read_dta() used arguments read_dta function can used. Nevertheless, used arguments standardized read_file() : nrows display maksimum numbers rows read header FALSE give default columnames V1, V2 etc skip specific number rows reading data trimws trim leading trailing whitespace na character value interpreted NA","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/read_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read Data File — read_file","text":"","code":"read_file(file = NULL, ...) les_fil(file = NULL, ...) rdf(file = NULL, ...)"},{"path":"https://helseprofil.github.io/orgdata/reference/read_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read Data File — read_file","text":"file Use FILID, FILEGROUP complete path filename. Data set .csv extension https:// can also input file arg. ... arguments passed related file format","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/read_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read Data File — read_file","text":"","code":"if (FALSE) { # With FILID DT <- read_file(file = 5) DT <- read_file(file = 5, fill = TRUE, nrows = 10) # With FILEGROUP dt <- read_file(file = \"UTFORE\") # With filepath rdata <- read_file(file = \"/file/path/mydata.xlsx\", sheet = \"S3\", range = cell_rows(1:4)) rdata <- read_file(file = \"/file/path/mydata.csv\", sep = \",\", header = FALSE) }"},{"path":"https://helseprofil.github.io/orgdata/reference/read_log.html","id":null,"dir":"Reference","previous_headings":"","what":"Read Log File — read_log","title":"Read Log File — read_log","text":"Read log file orgdata default path. check default path use orgdata:::is_orgdata_path().","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/read_log.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read Log File — read_log","text":"","code":"read_log(name = NULL, koblid = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/read_log.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read Log File — read_log","text":"name Log filename without file extention koblid Connecting ID KOBLID","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/read_log.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read Log File — read_log","text":"","code":"if (FALSE) { # To list codes with xxxx9999 of koblid 67 read_log(\"code99\", 67) }"},{"path":"https://helseprofil.github.io/orgdata/reference/reset_options.html","id":null,"dir":"Reference","previous_headings":"","what":"Reset options — reset_options","title":"Reset options — reset_options","text":"Reset orgdata options default","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/reset_options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reset options — reset_options","text":"","code":"reset_options() reset_opt()"},{"path":"https://helseprofil.github.io/orgdata/reference/reset_options.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reset options — reset_options","text":"","code":"reset_options()"},{"path":"https://helseprofil.github.io/orgdata/reference/save_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Save Data to CSV file — save_file","title":"Save Data to CSV file — save_file","text":"Save data .csv format file semicolon ; seperator. file saved specified folder path Access regstration database root getOption(\"orgdata.folder.data\"). Use argument save = TRUE make_file() activate save_file() directly. Else can call save_file() save object output make_file(). function wrapper data.table:fwrite().","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/save_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save Data to CSV file — save_file","text":"","code":"save_file( dt = NULL, name = NULL, path = NULL, date = FALSE, fgSpec = NULL, sep = \";\", ... ) lagre_fil( dt = NULL, name = NULL, path = NULL, date = FALSE, fgSpec = NULL, sep = \";\", ... )"},{"path":"https://helseprofil.github.io/orgdata/reference/save_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save Data to CSV file — save_file","text":"dt Input data preferrably data.table format mandatory name Filename .csv file filegroup name path Folder path save file. name valide filegroup (FILGRUPPE) use specified UTMAPPE Access registration database else file saved default folder C:\\Users\\YourUserName\\orgdata_logs. default folder created exist. date Logical value. TRUE use date time part filename. Default FALSE. fgSpec File group specification Access registration database sep separator columns. Default \";\" ... arguments data.table::fwrite","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/save_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save Data to CSV file — save_file","text":"","code":"if (FALSE) { # Save file directly make_file(\"BEFOLKNING\", save = TRUE) # Two steps DF <- make_file(\"BEFOLKNING\") save_file(DF, \"BEFOLKNING\") # Save with different name and specified folder save_file(DF, name = \"myCSVfile\", path = \"C:/MyFolder\") }"},{"path":"https://helseprofil.github.io/orgdata/reference/see_data.html","id":null,"dir":"Reference","previous_headings":"","what":"See Structured Data in the Data Warehouse — see_data","title":"See Structured Data in the Data Warehouse — see_data","text":"See original data clean structured data warehouse. Data saved warehouse column KONTROLLERT marked original file table Access. means dataset cleaned recoded specified INNLESING table Access registration database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/see_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"See Structured Data in the Data Warehouse — see_data","text":"","code":"see_data( group = NULL, koblid = NULL, year = NULL, action = c(\"read\", \"delete\") )"},{"path":"https://helseprofil.github.io/orgdata/reference/see_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"See Structured Data in the Data Warehouse — see_data","text":"group filegroup name (filgruppe) koblid KOBLID table tbl_Koble year year geograhical codes recoded . empty global option orgdata.year used. action read delete data warehouse. Default read.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/see_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"See Structured Data in the Data Warehouse — see_data","text":"","code":"if (FALSE) { dt <- see_data(\"LESEFERD\", koblid = 134) }"},{"path":"https://helseprofil.github.io/orgdata/reference/see_file.html","id":null,"dir":"Reference","previous_headings":"","what":"See Column Categories — see_file","title":"See Column Categories — see_file","text":"See categories available dataset.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/see_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"See Column Categories — see_file","text":"","code":"see_file(dt = NULL, ...) se_fil(dt = NULL, ...)"},{"path":"https://helseprofil.github.io/orgdata/reference/see_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"See Column Categories — see_file","text":"dt Dataset type data.frame data.table ... Columnames column index displayed. missing columns listed.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/see_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"See Column Categories — see_file","text":"","code":"if (FALSE) { DT <- make_file(\"BEFOLKNING\") # Use columnames see_file(DT, KJONN, UTDANN, LANDSSB) dt <- read_file(15) # Use column index see_file(dt) #all columns see_file(dt , c(2,5)) see_file(dt, c(1:3)) #columns 1 to 3 see_file(dt, c(2, 4, 7:9)) }"},{"path":"https://helseprofil.github.io/orgdata/reference/see_org.html","id":null,"dir":"Reference","previous_headings":"","what":"See Original Data in the Database — see_org","title":"See Original Data in the Database — see_org","text":"See original data saved org database column KONTROLLERT marked. means dataset cleaned recoded specified INNLESING table Access registration database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/see_org.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"See Original Data in the Database — see_org","text":"","code":"see_org(group = NULL, koblid = NULL, year = NULL, action = c(\"read\", \"delete\"))"},{"path":"https://helseprofil.github.io/orgdata/reference/see_org.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"See Original Data in the Database — see_org","text":"group filegroup name (filgruppe) koblid KOBLID table tbl_Koble year year geograhical codes recoded . empty global option orgdata.year used. action read delete data database. Default read.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/see_org.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"See Original Data in the Database — see_org","text":"","code":"if (FALSE) { dt <- see_org(\"LESEFERD\", koblid = 134) }"},{"path":"https://helseprofil.github.io/orgdata/reference/update_orgdata.html","id":null,"dir":"Reference","previous_headings":"","what":"Update package — update_orgdata","title":"Update package — update_orgdata","text":"Update orgdata directly Github repo. Default main branch.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/update_orgdata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update package — update_orgdata","text":"","code":"update_orgdata(...) upgrade_orgdata(...)"},{"path":"https://helseprofil.github.io/orgdata/reference/update_orgdata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update package — update_orgdata","text":"... arguments remotes::install_github()","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/update_orgdata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Update package — update_orgdata","text":"","code":"if (FALSE) { update_orgdata() #use default update_orgdata(ref = \"dev\") #to upgrade with dev branch }"},{"path":"https://helseprofil.github.io/orgdata/reference/website.html","id":null,"dir":"Reference","previous_headings":"","what":"Show Website — website","title":"Show Website — website","text":"Display website orgdata package ie. https://helseprofil.github.io/orgdata/","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/website.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show Website — website","text":"","code":"website(url = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/website.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show Website — website","text":"url URL","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-075","dir":"Changelog","previous_headings":"","what":"orgdata 0.7.5","title":"orgdata 0.7.5","text":"Use either empty tom represent regular expression replace since Access makes symbol \"\" invisible (#285) Change function name see_org() see_data() viewing data data warehouse.","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-074","dir":"Changelog","previous_headings":"","what":"orgdata 0.7.4","title":"orgdata 0.7.4","text":"Delete raw similar columns multiple specifications (#282) Different ways recode similar column ie. duplicated, defined lesid give error. Show current installed version new release version.","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-073","dir":"Changelog","previous_headings":"","what":"orgdata 0.7.3","title":"orgdata 0.7.3","text":"Testing","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-072","dir":"Changelog","previous_headings":"","what":"orgdata 0.7.2","title":"orgdata 0.7.2","text":"minor text editing. Delete older file DuckDB automatically since new version can’t read older files (#280) Actively ask users update given options new release version available. Control columns numeric don’t contain string. columns controls now dynamic (#281)","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-071","dir":"Changelog","previous_headings":"","what":"orgdata 0.7.1","title":"orgdata 0.7.1","text":"Rename function alias rf() rdf() since rf() already use stats package. Deleting row specification lesid without lesid ie. common filegroup, create errors. fixed (#279) Need update version whenever new release available ensure everyone using latest release. Else users can’t load package.","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-070","dir":"Changelog","previous_headings":"","what":"orgdata 0.7.0","title":"orgdata 0.7.0","text":"Filter active files date done pragmatically ie. files BRUKTIL date 01-01-9999 excluded. Now filtering date compared current date. (#272) Delete dataset database unmark column KONTROLLERT instead updating dataset due time consuming updating . users mark column save read dataset database. (#278) Change default argument raw make_file() FALSE config file.","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-06","dir":"Changelog","previous_headings":"","what":"orgdata 0.6","title":"orgdata 0.6","text":"text editing . Function is_colour_txt() can specify symbol directly without needing rely global options use withr package. Just cosmetic purposes 😃 Standard columns uppercase. Using lowercase creates error GEO comes two separated columns especially handling recode codebook (#277) Standardize arguments names see_org() function. Parallel processing deactivated since doesn’t work smoothly Access DuckDB connection ie. DBI package, due problem -exportable objects future package. Replace SQLite DuckDB due speed DuckDB. since DuckDB active development, new version might work file created older version. situation older DuckDB database deleted re-run newer DuckDB version. loading package, users reminded whenever new version available. Show data frame warning NAs coercion instead just GEO number coercion took place (#274) Replace DuckDB SQLite (#271) Columnames case insensitive (#115) Use ellipsis arguments data.table::fwrite() save_file() function. Implicit null number geo digits moved config file. make easy maintain expand. Use future.apply package conditionally reduce package vulnerability. Deactivate dependency packages parallel processing. Use conditionally ie. install manually needed. Reshape multiple columns containing one VAL handled properly. reshaping multiple columns just one VAL leaving RESHAPE_VAL empty ie. use columns defined RESHAPE_ID work (#269) Give information error reshape data, especially long reshape. time source error defining RESHAPE_KOL RESHAPE_VAL (#268) Can reshape multiple columns reshaping LONG. Applicable multiple columns represent number cases one column represent denominator numerators (#266) Use KOBLID add delete Duck database (#261) Depends norgeo package refers directly CRAN version instead GitHub repo. Use function geo_merge() add geo granularity aren’t API. can csv, xls format accepted read_file (#262) Deactive KONTROLLERT without need umark Access database using argument raw = TRUE using function make_file() (#264)","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-05","dir":"Changelog","previous_headings":"","what":"orgdata 0.5","title":"orgdata 0.5","text":"Use KOBLID table name DuckDB instead FILID since FILID unique number ie. can used multiple KOBLID. Update text website Change function name geo_levels() geo_map() mapping geo codes granularity. Change helper function names read_file(). (#250) Fixed bugs reading file web https (#251) read_file() accept Stata file dta extension (#252) Use yaml format global configuration file ease update. file located config repo (#256) Raw data controlled saved DuckDB database format. increase reading speed especially big files. Mark column KONTROLLERT Access registration database activate function. Unmark read original raw file instead. (#257) Use see_org() read raw data database. Argument action = \"delete\" can used delete data raw database. Function geo_merge() merging geo codes aren’t available API mapping table ie. tblGeo, geo database. data file format accepted read_file() function. data merged must column merged ie. id.file, equivalent column id database ie. id.table. id.file must unique. Handle unbalanced parentheses post recode whenever possible raw used, else give error message. #246 read_file() accept filegroup name argument file read completed file running make_file() function. #247 Debug functions can go deeper show helper functions well debug_opt(\"deep\") options(orgdata.debug = \"deep\") #243 Post recode uses type PS codebook. function used need recode value column dataset clean aggregated. Specification select row recoded uses either standard expression R syntax data.table style. using R syntax value must raw prefix eg. raw(AAR %% c(2000, 2005)). #244 #245 Delete rows \"-\" minus symbol TIL column codebook accepted do_recode_post(). Able aggregate country level addition geographical levels (#240) Download geo code aggregate despite different geographical levels dataset aggregated (#241) Update package via function update_orgdata(). Basically ’s just wrapper remotes::install_github(). Can aggregate country level well (#240) Speed aggregate process (#241) Fixed bugs reshape wide consisting multiple dimensions ie. one TAB columns. (#228) Ensure melting columns converted factor (#234) columns numeric type columns GEO, AAR, KJONN, ALDER VALs. also specify global options orgdata.num. Ensure thise columns numeric give warning well log coercion NA introduced. (#235) Use log file check codes problem. (#237) Warn give logfile GEO can’t converted integer geo recode. (#233 #236) Able read files specific extension coma semicolon separated (#227) Ensure VAL columns numeric type (#229) Give explicit warning GEO codes character can cause coercion resulting converting GEO codes NA (#229) Log files code99 also include koblid. files named code99_koblidxxx (#222) Running parallel processing unstable. sure process crash due MS Access can’t handle constant requests … Anyway, running parallel now use 50% available cores (#224) User can specify less cores 50% needed. use 75% cores specifying parallel = 0.75 argment make_file() global options orgdata.parallel (#225) Connect database common function. (#212) Use global options orgdata.year specify production year using current year. (#216) Use parallel processing make_file() argument parallel = TRUE. (#217)","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-04","dir":"Changelog","previous_headings":"","what":"orgdata 0.4","title":"orgdata 0.4","text":"Get feedback successful unsuccessful filegroups running make_filegroups(). (#199) Reshape wide limited 3 reshape columns . (#200 #201) Create log files default orgdata folder instead occupying REM. (#202) Delete old bydel codes ie. 2003, except Oslo. due unstable geographical recoding bydel. Use EXTRA column filegroup level argument DeleteOldBydel. (#204 #206) Log files use KOBLID specific. (#208) Reshape wide format can now implement multiple reshape dimensions usually one multiple TAB columns. instance LESEFERD tot_elev product mestringsnivå klassetrinn. (#188) output arrange standard column order. (#190) Debugging easier wrapper function debug_opt(). (#196) Fixed #147 implement reshape wide format create denominator. function applicable certain file structure received SSB. example filegroup LESEFERD column tot_elev represents total number student mestringsnivå grand total students. number students mestringsnivå represented column ant_elev. Therefore long format mestringsnivå needs restructured wide value ant_elev ensure summing tot_elev creating denominator create grand total students instead total number students mestringsnivå. (#184) Fixed #162 saving geographical codebook write = TRUE table doesn’t exist geo-code database. Stop looping geographical levels orgdata.debug.geo orgdata.debug.aggregate active make default kommune. (#166) Add batch date codebook reference debugging. (#168) Hide warning messages file controlled possible errors. means column KONTROLLERT table original files marked specific file. (#171) Refactoring function recode geographical codes. (#174) Geo codes enumeration areas towns aren’t able merged converted unknown codes either xxxx9999 xxxx99. (#177) Create default folder C:/Users/YourUserName/orgdata_logs path argument specified save_file(). (#179) Create unknown codes enumeration areas town codes able recode. probably due enumeration codes 2002. Excel file SSB clean unstable used recoding. unknown codes based municipality codes added xxxx99 xxxx9999. #177 recode done municipality codes merging back original dataset. (#182) Add codeDelete log geographical codes aren’t able merged. codes excluded dataset. access deleted codes use log$codeDelete. (#149) Give explicit error message path missing save_file(). (#152) Able select valid year recode geographical codes aggregate accordingly. recoding geographical codes backward isn’t possible. (#153) Error message split long vector exist. (#153) Add column batch date geographical codes downloaded form SSB creating geo codebook geo_map() geo_recode(). (#156) Actively select first geo code old geo code split multiple new geo codes. (#159) Able select base year geo recode based year available original data. available column AAR dataset. Use argument base global option orgdata.recode.base logical input. TRUE select base year recoding geographical code year original file current year. Default FALSE ie. include available geographical codes available codebook. (#157) Fixed #139 orgdata.debug.geo keep original geo codes enumeration areas adding 9999. (#140) Fixed #142 show codes problem recode directly instead row numbers (#144) Save codes problem log environment easy access. list codes either log$code00 log$codeShort Recode geo even argument aggregate = FALSE make_file() function. Rename make_filegroup lag_filgruppe plural ie. make_filegroups lag_filgrupper. Use options orgdata.debug.row select specific row(s) processing. can activated via global options options(orgdata.debug.row = 20:50) via argument row = 20:50 make_file() select row 20 50. Fixed #135 incorrect geo recode. (#131) Make multiple filegroups via make_filegroups. (#137) Fixed #132 LANDSSB must string Convert whitespace NA able delete rows NA Fixed #119 able mutate TABS VALS well (#126) Fixed #122 delete rows NA via EXTRA column (#127) Fixed #118 warning text column(s) aren’t defined FILGRUPPE deleted (#128) Edit error message columns existing NA value aggregating. Total value NA conflict allready existing NA category aggregated column(s). Therefore existing NA value selected column(s) must recoded valid value.","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-03","dir":"Changelog","previous_headings":"","what":"orgdata 0.3","title":"orgdata 0.3","text":"Use options(orgdata.debug.geo = TRUE) keep old geo codes debuging (#120) Use reset_options() reset default options. Warn process discontinued due debugging. Add vignettes Standardize git Debugging Fixed #121 recode geographical code split codes (#120) Change database filename raw-database_BE.accdb Fixed #106 split long messages (#107) Fixed #108 #112 grunnkrets codes changed 2002 available via API SSB code changes municipality includes changes 1977. Check SSB website. use municipality codes create uspesified grunnkrets codes data 2002 (#109 #113) Fixed #110 updating SQL code new table name codebook (#111) Check columns aggregate possible NA (#98). Columns NA recoded uoppgitt something equivalent since leaving category NA conflict NA representing total value aggregating. Fixed #100 grunnkrets ends 00 correspond codes SSB API. Need add manually (#101) Fixed #99 geo codes fails recoded row index shown (#103) Geo codes ends 4 zeros xxxx0000 neither equivalent codes SSB representing correct coding structure called Delområde ends 2 zeros xxxxxx00. avoid missing information, geo codes recoded xxxx9999 function is_grunnkrets_0000() PR (#103). see_file() accepts just single numeric well. Fixed #85 see_file() list columns columnames column indexes specified. variables sorted whenever possible. (#87) Add function tests (#88) Exclude LANDSSB aggregate split LANDBAK INNVKAT. code 0 recoded 20 split causes unnecessary rows (#84) Delete deprecated functions. Fixed #93 source level can’t identified due NA. Fixed #95 grunnkrets codes aren’t missing less number digits ie. less 7 digits. Assuming codes municipality 9999 added end codes (#96) Gives row number GEO codes get coerced NA converted integer. make easy check original raw data (#96) Aggregate now give total dimensions including specified AGGKOL (#82) Function see_file() accept column index well (#83) Recode variables using regular expression defined codebook type RE. Finding pattern can either written ordinary regular expression ie. \\\\d{4}.* rex() package. (#78) New feature checking categories variables see_file() (#75) Fixed #65 make TABS VALS dynamic easy extension columns (#66) Fixed #64 recode variable different class (#68) Fixed #63 implicit null includes possible VAL columns exist (#69) Fixed #70 recode GEO different object class (#71) Fixed #67 aggregate total values standard variables ie. UTDANN, LANDSSB, LANDBAK INNVKAT (#72) Fixed #61 use AGGKOL Access registration database specify columns aggregate standard eg. KJONN, TAB1, TAB2 etc. (#73) Fixed #55 recode standard variables via codebook instead hard coded (#58) Fixed #52 skip split specified (#59) Fixed #57 split column duplicated values keep original column (#60) Fixed #56 aggregate VAL columns whenever specified specific VAL1 (#62) Edit verbose messages Reshape dataset wide long. Reshape can one measure variables. Please read specified Access registration database. Split columns must equal number values defined SPLITTIL. Duplicate value less maximum SPLITTIL. example value 0 column LANDSSB split LANDBAK INNVKAT, value duplicated 00 avoid split value NA. Recode LANDBAK INNVKAT aggregating done internally ie. hard coded, do_aggregate_recode_standard(). Total coded 20. eventuality future change also look related functions is_aggregate_standard_cols() is_col_num().","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-02","dir":"Changelog","previous_headings":"","what":"orgdata 0.2","title":"orgdata 0.2","text":"Change argument parameter find_spec() function. Update text document several places. Add colour type warn2 warning message without Warning: prefix. Request (#43) messages specific colour Fixed (#46) recode string even though columns type integer numeric. Unknown bydel ie. (uoppgitt) added enumeration areas codes ie. (grunnkrets) bydel XXXX9999 function geo_level(). Add unknown grunnkrets kommune available since datasets unknown grunnkrets aren’t listed API downloaded data (#39). Exclude TAB1, TAB2 TAB3 aggregated. (#44) Recode aggregated variables uses AG TYPE column codebook instead FILGRUPPE AGGREGATE implemented ver 0.2.0. make possible specify FILGRUPPE LESID implement principle GENERAL, COMMON SPECIFIC variables. Change function name do_aggregate_recode do_aggregate_recode_standard standard variables. Recode aggregated categories can defined Recode form ie. codebook, use AGGREGATE specification FILGRUPPE Delete rows defined codebook using minus symbol TIL column. Similar principles implemented GENERAL, COMMON SPECIFIC feature recode. Read detail ver 0.0.5 - alpha. Display columnames recoded found dataset aren’t found defined ALLE codebook user aware existence. Standardize used arguments read_file() nrows, header, skip, trimws na. Read details read_file() function description. Output read_file() data.table class. Use standard columnames V1, V2 etc argment header = FALSE specified. Error message list unmatch columns do_column_standard(). Give clearer message debug message eg. Execute: read_file(). Change MAPPE UTMAPPE make explicit path specification save file. Defun orgdata.active global options use columnames original dataset. Use global options options(orgdata.debug.nrow = TRUE) read first 20 rows. Suitable debug purposes. Fix (#28) GEO derived two columns empty INNLESARG. Add column LEVEL granularity level ie. grunnkrets, fylke, kommune, bydel etc","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-001---alpha-version","dir":"Changelog","previous_headings":"","what":"orgdata 0.0.1 - alpha version","title":"orgdata 0.0.1 - alpha version","text":"MANHEADER used new columname must specified respective standard column (#21) Deprecated arguments geo val make_file. Output data must use standard columnames instead keeping columnames original dataset. Rename functions read_raw lesraw make_file lag_fil (#27) Alle functions uses underscore “_” english norwegian. Add new columns one standard columns missing original data. value inserted new column must use symbol less < >. instance column KJONN doesn’t exist original data, can specify <2> column KJONN Access registration database. output add new column KJONN value 2. (#15) Fix #13 #18 Default orgdata.verbose TRUE. Options orgdata.implicit.null default TRUE. Use options(orgdata.implicit.null = FALSE) deactivate (#19) Changes PR #11 #12 following: Implicit zero (#11). Discussion Gist Use version specific imported packages. Rename standard column LANDBAK LANDSSB column original data received SOB containing information country origin. Save file specified column MAPPE Access registration database specify path argument function save_file. (#12) Changes PR #8 following: Create GEO code two separate columns. defined Access registration GEO comma separated eg. nameGeoCol1, nameGeoCol2. Order standard columns output dataset order first four columns: GEO, AAR, ALDER, KJONN Change norwegian name save_file lagfil lagrefil. Use column name KOLNAVN instead ADDKOL. Rename function do_addcols get_addcols do_colname get_colname consistent changes Access registration database. Changes PR #4 following: Recode variables specification tbl_KodeBok uses: GENERAL variables defined FILGRUPPE ALLE used recode variables groups. COMMON variables FILGRUPPE specified empty LESID. recode variables within selected group. SPECIFIC variables FILGRUPPE LESID specified. recode variables specified FILGRUPPE specified FILID. three specification exist tbl_KodeBok: SPECIFIC variables overrule COMMON variables COMMON variables overrule GENERAL variables Write codebook column FRA specifying missing variables indicating missing column recoded value column TIL. differentiate real missing real column value NA. (#5) Error message given LESID specified without FILGRUPPE since LESID unique ID.","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata---alpha-0-0-1","dir":"Changelog","previous_headings":"","what":"orgdata 0.0.4 - alpha","title":"orgdata 0.0.1 - alpha version","text":"MANHEADER KOLNAVN uses common helper function is_col_separate() MANHEADER old convert integer use index columns Changes PR #2","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata---alpha-0-0-1-1","dir":"Changelog","previous_headings":"","what":"orgdata 0.0.3 - alpha","title":"orgdata 0.0.1 - alpha version","text":"LESID unique id combination LESID FILGRUPPE Standard columns include 3 TABS 3 VALS KOLNAVN input uses comma separate VAL1=TOTAL, TAB1=ICDis valid input Changes PR #1","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata---alpha-0-0-1-2","dir":"Changelog","previous_headings":"","what":"orgdata 0.0.2 - alpha","title":"orgdata 0.0.1 - alpha version","text":"Things implemented Bla.. bla.. bla..","code":""}] +[{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"orgdata-debug","dir":"Articles","previous_headings":"","what":"orgdata.debug","title":"How to debug","text":"used display process flow running functions orgdata. useful know process creates problems troubleshoot. Options shallow deep used decide levels functions shown process flow. Selecting shallow equal TRUE deep show helper functions well. activate:","code":"options(orgdata.debug = TRUE) # OR debug_opt(\"shallow\") # OR debug_opt(\"deep\")"},{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"orgdata-debug-nrow","dir":"Articles","previous_headings":"","what":"orgdata.debug.nrow","title":"How to debug","text":"make testing faster big file, can load rows activating options. instance, load first 50 rows use:","code":"options(orgdata.debug.nrow = 50) # OR debug_opt(\"nrow\", 50)"},{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"orgdata-debug-row","dir":"Articles","previous_headings":"","what":"orgdata.debug.row","title":"How to debug","text":"select specific row(s) processing. useful especially activating orgdata.debug.geo option. select rows 20 50:","code":"options(orgdata.debug.row = 20:50) # OR debug_opt(\"row\", 20:50)"},{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"orgdata-debug-aggregate","dir":"Articles","previous_headings":"","what":"orgdata.debug.aggregate","title":"How to debug","text":"check geographical codes original data aggregated . instance original data consist enumeration area codes can aggregated municipality county. Activating options add columns origin geographical codes codes aggregate municipality, county, city etc output data. difference options aggreagate argument make_file() argument aggregate = FALSE cease aggregating recoding geographical codes original data. use:","code":"options(orgdata.debug.aggregate = TRUE) # OR debug_opt(\"aggregate\")"},{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"geo","dir":"Articles","previous_headings":"","what":"orgdata.debug.geo","title":"How to debug","text":"option used check code use recoding geographical codes original data current geographical codes. new columns called oriGEO added consisting geographical codes original data example. Column GEO code recode oriGEO. value NA column GEO recode done respective code. reason either codes still valid current year recode code available/valid deleted. warning given.","code":"options(orgdata.debug.geo = TRUE) # OR debug_opt(\"geo\")"},{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"reset","dir":"Articles","previous_headings":"","what":"reset","title":"How to debug","text":"activating options orgdata, kept active actively deactivate restart new R session. can deactivate :","code":"reset_opt()"},{"path":"https://helseprofil.github.io/orgdata/articles/debugging.html","id":"expl","dir":"Articles","previous_headings":"","what":"Example output","title":"How to debug","text":"example output activating orgdata.debug.geo","code":"oriGEO GEO AAR KJONN UTDANN TAB1 TAB2 TAB3 TAB4 ANDRE ANNEN 1: 1010102 30010102 2019 0 01 2 8 1 1 1 2 2: 1010102 30010102 2019 0 01 2 5 1 1 1 3 3: 1010102 30010102 2019 0 01 1 8 1 1 1 3 4: 1010102 30010102 2019 0 01 3 8 1 1 3 3 5: 1010102 30010102 2019 0 02 3 8 2 2 20 20 --- 326790: 50610108 NA 2019 2 02 2 5 1 2 20 20 326791: 50610108 NA 2019 2 02 3 5 1 2 20 20 326792: 50610108 NA 2019 2 02 4 8 1 1 20 20 326793: 50610110 NA 2019 0 03 4 8 1 1 20 20 326794: 50610110 NA 2019 1 03 4 8 1 1 20 20"},{"path":"https://helseprofil.github.io/orgdata/articles/geo-recode.html","id":"recode-geo-codes","dir":"Articles","previous_headings":"","what":"Recode Geo Codes","title":"Recode and Map Geo","text":"function create table recoding geo codes geo_recode(). table consists previous codes new codes whenever available. instance, get codes kommuner 2017 2022. table list codes kommuner since 2017 columname oldCode current codes ie. 2022, column currentCode. geo codes changed since 2017 new codes currentCode column. geo codes changed since 2017 value NA oldCode column. Use argument write = TRUE save database. table database named kommune2022 data consist geo codes 2022, ie. argument = 2022 type = kommune used. table already exists database just want add new dataset table, use argument append = TRUE, appending used control purposes production might create duplication oldCode column. Please check documentation details help(\"geo_recode\").","code":"library(orgdata) dt <- geo_recode(type = \"kommune\", from = 2018, to = 2022) dt[1:5] oldCode oldName currentCode newName changeOccurred batch 1: 0301 Oslo 2022 2022-03-15 2: 1101 Eigersund 2022 2022-03-15 3: 1141 Finnøy 1103 Stavanger 2020 2022-03-15 4: 1142 Rennesøy 1103 Stavanger 2020 2022-03-15 5: 1106 Haugesund 2022 2022-03-15"},{"path":"https://helseprofil.github.io/orgdata/articles/geo-recode.html","id":"mapping-geo-codes","dir":"Articles","previous_headings":"","what":"Mapping Geo Codes","title":"Recode and Map Geo","text":"function create geo mapping geo_map(). default table name created database tblGeo. consists geo granularities (levels) selected year. lowest level enumeration area codes grunnkrets. Arguments write append can used calling geo_map() function. However cases, need use append = TRUE, ie. append data existing tblGeo database.","code":"DT <- geo_map(year = 2022) DT[sample(1:.N, 5)] code name validTo level grunnkrets kommune fylke bydel batch 1: 30470104 Søndre Simostranda 2022 grunnkrets 30470104 3047 30 2022-03-15 2: 11140110 Vikeså 2 2022 grunnkrets 11140110 1114 11 2022-03-15 3: 30020408 Ørehavna 2022 grunnkrets 30020408 3002 30 2022-03-15 4: 46350304 Hjartholm 2022 grunnkrets 46350304 4635 46 2022-03-15 5: 42160109 Birkeland Nord 2022 grunnkrets 42160109 4216 42 2022-03-15"},{"path":"https://helseprofil.github.io/orgdata/articles/geo-recode.html","id":"merge-geo-codes","dir":"Articles","previous_headings":"","what":"Merge Geo Codes","title":"Recode and Map Geo","text":"geo_recode() geo_map() fetch data via API available SSB. merge geo codes aren’t available via API can done function geo_merge(). data merge can format accepted read_file() function. new data must column id merge tblGeo table column new geo codes added . instance new dataset 2022 levekaar codes columname code_levekaar levekaar codes derived bydel codes columname var01, specification arguments example . Please read documentation details arguments can used help(\"geo_merge\") ?geo_merge.","code":"dd <- geo_merge(id.table = \"bydel\", id.file = \"var01\", geo.col = \"code_levekaar\", geo.level = \"levekaar\", file = \"C:/Users/ybka/data/levekaar.csv\", year = 2022)"},{"path":"https://helseprofil.github.io/orgdata/articles/get-started.html","id":"aggregate-all-files","dir":"Articles","previous_headings":"","what":"Aggregate all files","title":"Get started","text":"aggregate files specific group BEFOLKNING group. satisfy output error shown process, save output ie, object df , .csv file : certain process controlled everything working correctly. save output directly .csv file argument save = TRUE: advisable mark file KONTROLLERT Access Database table original files checked output. ensure shorter processing time re-run make_file() skip cleaning recording processes. allready saved database. database can found ../PRODUKSJON/STYRING/raw-khelse/org_database","code":"library(orgdata) df <- make_file(\"BEFOLKNING\") df save_file(df, \"BEFOLKNING\") df <- make_file(\"BEFOLKNING\", save = TRUE)"},{"path":"https://helseprofil.github.io/orgdata/articles/get-started.html","id":"aggregate-selected-files-only","dir":"Articles","previous_headings":"","what":"Aggregate selected files only","title":"Get started","text":"Aggregating whole files group take long time many files selected group. select specific file files selecting KOBLID instead. example selecting one files respectively.","code":"df <- make_file(\"BEFOLKNING\", koblid = 4) df <- make_file(\"BEFOLKNING\", c(4,10,15))"},{"path":"https://helseprofil.github.io/orgdata/articles/get-started.html","id":"process-files-without-aggregating","dir":"Articles","previous_headings":"","what":"Process files without aggregating","title":"Get started","text":"need look file prior aggregating . specify argument aggregate FALSE. behavior also achieved activating globally via options. activating globally using options, proceeding processes aggregated unless ’s changed function call ie. include argument aggregate = TRUE, reset global options :","code":"df <- make_file(\"BEFOLKNING\", aggregate = FALSE) # Global option options(orgdata.aggregate = FALSE) df <- make_file(\"BEFOLKNING\") reset_opt()"},{"path":"https://helseprofil.github.io/orgdata/articles/sepaafil.html","id":"loading","dir":"Articles","previous_headings":"","what":"Loading","title":"SePaaFil","text":"å aktivere orgdata pakke Oppdatere pakken når ny versjon er tilgjengelig HUSK Å ALLTID TILORDNE ET OBJEKT make_file() og read_file()! Les original fil som det er ved å velge FILID les_fil() kan også brukes til å lese data ved å skrive hele stien til filen og kan brukes til å lese filer flere formater bl.Excel, Stata, .CSV etc. Aggregere utvalgte fil eller filer med KOBLID Les filene en filgruppe og bruk oppsettet som er spesifisert Access Lagre CSV fil Å lagre det et annet sted Evt. hvis alle filer har ingen feil Hvis filene har blitt kontrollert så kan man lagre flere FILGRUPPER med en gang, du velger selv måten du liker å gjøre det. FILGRUPPE blir lagret som csv direkte. Ingen feilmelding er gitt. Eller","code":"# Kjør alt herfra ------------------- library(orgdata) options(orgdata.year = 2021) #Hvilket årgang til å omkode geo #til hit som oppsett ---------------- update_orgdata() dt <- make_file() dvs. ^ df <- les_fil(file = 12) #12 er en FILID df <- les_fil(\"C:/Users/abc/FileName.csv\") dt <- lag_fil(\"BEFOLKNING\", koblid = 13) dt <- lag_fil(\"BEFOLKNING\", koblid = c(13, 15, 20)) dt <- lag_fil(\"BEFOLKNING\") dt <- lag_fil(\"BEFOLKNING\", raw = TRUE) #les fra original filen hvis allerede er KONTROLLERT save_file(dt, \"BEFOLKNING\") save_file(dt, name = \"MinFil\", path = \"C:/Navn/Til/Mappen\") lag_fil(\"BEFOLKNING\", save = TRUE) fgp <- c(\"BEFOLKNING\", \"NEET\", \"DODE\") #med \" \" lag_filgrupper(fgp) lag_filgrupper(BEFOLKNING, NEET, DODE) #uten"},{"path":"https://helseprofil.github.io/orgdata/articles/sepaafil.html","id":"tips-and-tricks","dir":"Articles","previous_headings":"","what":"Tips and Tricks","title":"SePaaFil","text":"Lest bare et bestemt antall rader f.eks 5 rader kan også brukes andre argumenter f.eks header = FALSE, skip = 0, sep = ; osv. Sjekk dokumentet. Sjekk koding:","code":"les_fil(file = 1, nrows = 5) # Sjekk kategorier evt. omkoding df <- les_fil(file = 1) se_fil(df) #alle kolonner se_fil(df, 1) #bare kolonne 1 se_fil(df, c(1:5)) #kolonner 1 til 5 se_fil(df, c(1,4,6)) se_fil(df, LANDBAK, INNVKAT) df[, .N, keyby = landb] #kategori for landb i original data dt <- lag_fil(\"TEST01\", koblid = 1) dt[, .N, keyby = LANDB] #kategori i omkodet aggregerte data dt[, .N, keyby = LANDF] # Få å finne kategorier bare for kommune eller spesifik kjonn dt[LEVEL == \"kommune\", .N, keyby = LANDBAK] dt[KJONN == 1, .N, keyby = LANDBAK] # Sjekk koder f.eks GEO 1050110 dt[GEO == 1050110] # Sjekk flere koder samtidig dt[GEO %in% c(1050110, 1050122)] # Sjekk GEO koder starter med 301 dt[GEO %like% \"^301\"] # Sjekk GEO avsluttet med 99 dt[GEO %like% \"99$\"] # Se alle rader i datasettet View(df) # Se logfiler read_log(\"code00\", 343) #343 er en KOBLID read_log(\"code99\", 343) # Åpne hjemmeside website() # Sjekk versjon packageVersion(\"orgdata\") # Se alle global options names(orgdata:::opt.orgdata) orgdata:::opt.orgdata #default verdi"},{"path":"https://helseprofil.github.io/orgdata/articles/sepaafil.html","id":"debugging","dir":"Articles","previous_headings":"","what":"Debugging","title":"SePaaFil","text":"å se original koder og hva det skal bli kodet til å se hva kodene skal bli aggregert til HUSK å nullstille etter bruk av debug funksjon","code":"debug_opt(\"geo\") debug_opt(\"aggregate\") reset_opt()"},{"path":"https://helseprofil.github.io/orgdata/articles/standard.html","id":"keyword-for-github-commit","dir":"Articles","previous_headings":"","what":"Keyword for GitHub Commit","title":"Make things standard","text":"keywords helpful searching relevant commits: Feat: new feature function Fix: bug fix Doc: documentation changes documentation Close: Style: changes code comments aren’t bugs Test: code testing tests folder DEV: development processes new feature VER: first version upgrade Misc: changes aren’t critical doesn’t fit keywords. Avoid using possible last resort Example commit message","code":"Feat: Get list of new files New files are missing in the current list. They need to be in the current list before aggregating."},{"path":"https://helseprofil.github.io/orgdata/articles/standard.html","id":"github-commit-message","dir":"Articles","previous_headings":"","what":"Github Commit Message","title":"Make things standard","text":"Use message commit follows: first line gives summary done. Preferably write imperative mood like commanding someone especially commit related features, functions (Feat:) fixing code (Fix).","code":"Keyword: Write summary as imperative or command More detail explanation if necessary with maximum 72 characters and use line break for long sentences."},{"path":"https://helseprofil.github.io/orgdata/articles/standard.html","id":"folders-structure","dir":"Articles","previous_headings":"","what":"Folders structure","title":"Make things standard","text":"files located files used. Folder /R R codes functions objects orgdata live. Folder /inst SQL code files files needed package. Folder /dev files aren’t used package good reference code testing. Files prefix utils-* folder /R helper functions used multiple times different places. Put functions helper functions file aren’t used different places.","code":""},{"path":"https://helseprofil.github.io/orgdata/articles/standard.html","id":"naming-style-function-or-object","dir":"Articles","previous_headings":"","what":"Naming style (function or object)","title":"Make things standard","text":"Use naming style: snake_case style function eg. find_column_input camelCase style object eg. fileGroup kebab-case style filename eg. utils-internal.R","code":""},{"path":"https://helseprofil.github.io/orgdata/articles/standard.html","id":"function-names","dir":"Articles","previous_headings":"","what":"Function names","title":"Make things standard","text":"effort group functions according responsibilities :) Files read_ perfix major functions. Files do_ prefix action functions. Files get_ prefix column specific functions. Files find_ prefix helper functions. Files is_ prefix internal functions utility use orgdata package. Internal functions exported needed, can accessed ::: eg. orgdata:::is_separate().","code":""},{"path":"https://helseprofil.github.io/orgdata/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Yusman Kamaleri. Author, maintainer. FHI KHelse group. Contributor, reviewer. https://www.fhi./hn/folkehelse","code":""},{"path":"https://helseprofil.github.io/orgdata/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Kamaleri Y (2022). orgdata: Aggregating Original Data. R package version 0.7.5, https://github.com/helseprofil/orgdata.","code":"@Manual{, title = {orgdata: Aggregating Original Data}, author = {Yusman Kamaleri}, year = {2022}, note = {R package version 0.7.5}, url = {https://github.com/helseprofil/orgdata}, }"},{"path":"https://helseprofil.github.io/orgdata/index.html","id":"orgdata-","dir":"","previous_headings":"","what":"Aggregating Original Data","title":"Aggregating Original Data","text":"Cleaning, restructuring aggregating ORiGinal DATA preferred dataset.","code":""},{"path":"https://helseprofil.github.io/orgdata/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Aggregating Original Data","text":"install run code maintain dependencies package version, can install orgdata user branch reproducibility, ie. keeping package version dependencies used development process. must however install Git prior using kh_restore() function. Alternatively can update new version install development version via orgdata.","code":"source(\"https://raw.githubusercontent.com/helseprofil/misc/main/utils.R\") kh_install(\"orgdata\") source(\"https://raw.githubusercontent.com/helseprofil/misc/main/utils.R\") kh_restore(\"orgdata\") orgdata::update_orgdata() # install development versjon orgdata::update_orgdata(ref = \"dev\")"},{"path":"https://helseprofil.github.io/orgdata/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Aggregating Original Data","text":"implement specifications per file group registered database use make_file() function. Use function make_filegroups() process multiple file groups .","code":"library(orgdata) # All files under BEFOLKNING group dt <- make_file(\"BEFOLKNING\") # For selected files with KOBLID dt <- make_file(\"BEFOLKNING\", koblid = 48) dt <- make_file(\"BEFOLKNING\", koblid = c(48, 72)) make_filegroups(BEFOLKNING, LESEFERD, NEET)"},{"path":"https://helseprofil.github.io/orgdata/index.html","id":"resources","dir":"","previous_headings":"","what":"Resources","title":"Aggregating Original Data","text":"Get started Functions overview General guide Conventions Video guide","code":""},{"path":"https://helseprofil.github.io/orgdata/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2021 orgdata authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/debug_opt.html","id":null,"dir":"Reference","previous_headings":"","what":"Debugging options — debug_opt","title":"Debugging options — debug_opt","text":"wrapper debugging options.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/debug_opt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Debugging options — debug_opt","text":"","code":"debug_opt( opt = c(\"shallow\", \"deep\", \"nrow\", \"row\", \"aggregate\", \"geo\"), val = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/debug_opt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Debugging options — debug_opt","text":"opt Debug options val Value options","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/debug_opt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Debugging options — debug_opt","text":"Options available: \"shallow\" : Show executed funcitons process flow \"deep\" : Show deeper including helper functions process flow \"nrow\" : orgdata.debug.nrow. Default value 20 val argument missing \"row\" : orgdata.debug.row. Default value 1:50 val argument missing \"aggregate\" : Activating orgdata.debug.aggregate \"geo\" : Activating orgdata.debug.geo","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/debug_opt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Debugging options — debug_opt","text":"","code":"if (FALSE) { debug_opt(\"geo\") debug_opt(\"nrow\", 30) }"},{"path":"https://helseprofil.github.io/orgdata/reference/do_aggregate.html","id":null,"dir":"Reference","previous_headings":"","what":"Aggregate Data — do_aggregate","title":"Aggregate Data — do_aggregate","text":"Aggregate data according specification tbl_Filgruppe AGGREGERE column. input argument source must lower granularity level level input.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_aggregate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Aggregate Data — do_aggregate","text":"","code":"do_aggregate( dt = NULL, source = c(\"grunnkrets\", \"fylke\", \"kommune\", \"bydel\"), level = getOption(\"orgdata.geo.levels\"), year = NULL, aggregate.col = NULL, geoDT = NULL, check = NULL, base = NULL, control = FALSE, wide = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/do_aggregate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Aggregate Data — do_aggregate","text":"dt Input data preferrably data.table format mandatory source geographical granularity codes available source data. used merging geo codebook generated geo_map() ie. tblGeo geo database level Geographical granularity aggregating data. See getOption(\"orgdata.geo.levels\") year year geograhical codes recoded . empty global option orgdata.year used. aggregate.col columns aggregate standard ie. UTDANN, LANDSSB, LANDBAK INNVKAT geoDT Geo codes aggregate dataset check TRUE output keep variables geographical levels without aggregating . useful check geographical codes missing. Else use options(orgdata.aggregate = FALSE) base Logical value. TRUE use year original data base year recode geographical codes. Default FALSE use available codes geo codebook control Logical value. TRUE file controlled possible errors wide Column(s) reshape wide","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_aggregate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Aggregate Data — do_aggregate","text":"","code":"if (FALSE) { # To aggregate source data with enumeration area codes ie. grunnkrets, to # manucipaltiy ie. kommune dt <- make_file(\"BEFOLKNING\") DT <- do_aggregate(dt, source = \"grunnkrets\", level = \"kommune\") }"},{"path":"https://helseprofil.github.io/orgdata/reference/do_colname.html","id":null,"dir":"Reference","previous_headings":"","what":"Rename Columns — do_colname","title":"Rename Columns — do_colname","text":"Rename standard columns dataset","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_colname.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rename Columns — do_colname","text":"","code":"do_colname(dt = NULL, cols = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_colname.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rename Columns — do_colname","text":"dt Input data preferrably data.table format mandatory cols Old new columns. See output get_colname()","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_column_standard.html","id":null,"dir":"Reference","previous_headings":"","what":"Rename Standard Columns — do_column_standard","title":"Rename Standard Columns — do_column_standard","text":"Renaming standard columns. see standard columns run orgdata:::is_standard_cols().","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_column_standard.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rename Standard Columns — do_column_standard","text":"","code":"do_column_standard(dt = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_column_standard.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rename Standard Columns — do_column_standard","text":"dt Input data preferrably data.table format mandatory spec Specification data list. See output get_column_standard","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_delete_row.html","id":null,"dir":"Reference","previous_headings":"","what":"Delete Selected Rows — do_delete_row","title":"Delete Selected Rows — do_delete_row","text":"Delete selected rows dataset. rows deleted can specified directly Access registration database using minus symbol -","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_delete_row.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Delete Selected Rows — do_delete_row","text":"","code":"do_delete_row(dt = NULL, spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_delete_row.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Delete Selected Rows — do_delete_row","text":"dt Input data preferrably data.table format mandatory spec Specifications data data.frame con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args.html","id":null,"dir":"Reference","previous_headings":"","what":"Execute Extra Arguments — do_extra_args","title":"Execute Extra Arguments — do_extra_args","text":"based input EXTRA column Access registration database. arguments valid can expanded whenever needed. See details section valid arguments used. argument names written CamelCase style. Use symbol | separate multiple arguments.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Execute Extra Arguments — do_extra_args","text":"","code":"do_extra_args(dt = NULL, args = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Execute Extra Arguments — do_extra_args","text":"dt Dataset args Extra arguments specified details section .","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Execute Extra Arguments — do_extra_args","text":"Currently, arguments can used: DeleteNaRow : Delete row consisting NA columns","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args_group.html","id":null,"dir":"Reference","previous_headings":"","what":"Execute Extra Arguments for Filegroup — do_extra_args_group","title":"Execute Extra Arguments for Filegroup — do_extra_args_group","text":"based input EXTRA column Access registration database filegroup. arguments valid can expanded whenever needed. See details section valid arguments used. argument names written CamelCase style. NB! Use symbol | separate multiple arguments eg. DeleteOldBydel | AgeCat(5)","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args_group.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Execute Extra Arguments for Filegroup — do_extra_args_group","text":"","code":"do_extra_args_group(dt = NULL, args = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args_group.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Execute Extra Arguments for Filegroup — do_extra_args_group","text":"dt Dataset args Extra arguments specified details section .","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_extra_args_group.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Execute Extra Arguments for Filegroup — do_extra_args_group","text":"Currently, arguments can used: DeleteOldBydel : Delete bydel codes 2003, except Oslo AgeCat() : Categorise age different groups defined interval. Example can found find_age_category().","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_geo_recode.html","id":null,"dir":"Reference","previous_headings":"","what":"Recode Geographical Codes — do_geo_recode","title":"Recode Geographical Codes — do_geo_recode","text":"Recode geographical codes current year. Codes based norgeo::track_change() function. split geogaphical codes previous year, first code current year code chronological order selected recode.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_geo_recode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recode Geographical Codes — do_geo_recode","text":"","code":"do_geo_recode( dt = NULL, code = NULL, type = c(\"grunnkrets\", \"fylke\", \"kommune\", \"bydel\"), year = NULL, con = NULL, geo = NULL, base = NULL, control = FALSE, ... )"},{"path":"https://helseprofil.github.io/orgdata/reference/do_geo_recode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recode Geographical Codes — do_geo_recode","text":"dt Input data preferrably data.table format mandatory code Code dataset old new codes data.table format. type geographical granularity recoding. dataset output running get_geo_recode() function. year year geograhical codes recoded . empty global option orgdata.year used. con Connection database geo Logical value. Keep old geographical code TRUE. Default FALSE. base Logical value. TRUE use year original data base year recode geographical codes. Default FALSE use available codes geo codebook control Logical value. TRUE file controlled possible errors ... additional arguments","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_geo_recode.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Recode Geographical Codes — do_geo_recode","text":"","code":"if (FALSE) { code <- get_geo_recode(con = geo$dbconn, type = \"grunnkrets\") dt <- make_file(\"BEFOLKNING\", aggregate = FALSE) DT <- do_geo_recode(dt, code) }"},{"path":"https://helseprofil.github.io/orgdata/reference/do_implicit_null.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Implicit Null — do_implicit_null","title":"Create Implicit Null — do_implicit_null","text":"Implicit Null happens variable dataset unequal number categories different years due one several categories zero case. variables except AAR GEO must equal number categories. data handled package aggregated rawdata. categories variables might different different year. elucidate non-existence category rather zero number belonging category. function standardize categories across year.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_implicit_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Implicit Null — do_implicit_null","text":"","code":"do_implicit_null( dt = NULL, level = c(\"grunnkrets\", \"fylke\", \"kommune\", \"bydel\") )"},{"path":"https://helseprofil.github.io/orgdata/reference/do_implicit_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Implicit Null — do_implicit_null","text":"dt Dataset consisting years level Geographical granularity aggregating data. See getOption(\"orgdata.geo.levels\")","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_make_file_each.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Each File — do_make_file_each","title":"Process Each File — do_make_file_each","text":"Process file parallelly","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_make_file_each.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Each File — do_make_file_each","text":"","code":"do_make_file_each( spec, fgspec, aggregate, datacols, year, row, base, duck = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/do_make_file_each.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Each File — do_make_file_each","text":"spec File specification fgspec Filegroup specification aggregate Logical value. Default TRUE. Aggregate data according specification registration database. Global options orgdata.aggregate. datacols Columnames kept year year geograhical codes recoded . empty global option orgdata.year used. row Select specific row(s) numbers . Useful debugging. Please read Debugging article detail. base Logical value. TRUE use year original data base year recode geographical codes. Default FALSE use available codes geo codebook duck R6 object DuckDB","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_manheader.html","id":null,"dir":"Reference","previous_headings":"","what":"Rename Colname Manually — do_manheader","title":"Rename Colname Manually — do_manheader","text":"Rename columns manually based column index.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_manheader.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rename Colname Manually — do_manheader","text":"","code":"do_manheader(dt = NULL, manspec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_manheader.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rename Colname Manually — do_manheader","text":"dt Input data preferrably data.table format mandatory manspec Specification MANHEADER column tbl_Innlesing","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_mutate.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Column — do_mutate","title":"Create Column — do_mutate","text":"Create new column value specified symbols less < > standard columns. example specified KJONN <2>, new column KJONN created value 2. function applicable columns \"GEO\", \"AAR\", \"KJONN\", \"ALDER\", \"UTDANN\", \"LANDSSB\", \"TABS\" \"VALS\".","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_mutate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Column — do_mutate","text":"","code":"do_mutate(dt = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_mutate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Column — do_mutate","text":"dt Input data preferrably data.table format mandatory spec Specifications data data.frame","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode.html","id":null,"dir":"Reference","previous_headings":"","what":"Recode Variables — do_recode","title":"Recode Variables — do_recode","text":"Recode variables based specification tbl_KodeBok ie. codebook. LESID must combined FILGRUPPE create unique reference able recode variables. Specification group ALLE used neither FILGRUPPE LESID specified.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recode Variables — do_recode","text":"","code":"do_recode(dt = NULL, spec = NULL, con = NULL, control = FALSE)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recode Variables — do_recode","text":"dt Input data preferrably data.table format mandatory spec Specifications data data.frame con Connection database control Logical value. TRUE file controlled possible errors","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_aggregate.html","id":null,"dir":"Reference","previous_headings":"","what":"Recode Category Representing All Groups — do_recode_aggregate","title":"Recode Category Representing All Groups — do_recode_aggregate","text":"Recode category aggregating data based specification Codebook. example aggregating category type diagnoses NA produced represent type diagnoses. basically recode NA preferred value 0 Total.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_aggregate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recode Category Representing All Groups — do_recode_aggregate","text":"","code":"do_recode_aggregate( dt = NULL, spec = NULL, con = NULL, aggregate = NULL, control = FALSE )"},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_aggregate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recode Category Representing All Groups — do_recode_aggregate","text":"dt Input data preferrably data.table format mandatory spec Specification tbl_Filgruppe con Connection database aggregate Logical value. Default TRUE. Aggregate data according specification registration database. Global options orgdata.aggregate. control Logical value. TRUE file controlled possible errors","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_post.html","id":null,"dir":"Reference","previous_headings":"","what":"Post Recode Columns — do_recode_post","title":"Post Recode Columns — do_recode_post","text":"Recode selected columns cleaning processing filegroup based specification FILGRUPPE codebook type PS. example columns filegroup values specific year. column value 0. Instead special symbol .. given, representing column missing value available calculation. specify FRA column registration database recode years 1990 2000 TAB1 value foo selected value KOL column ie. AAR = 1990:2000 & TAB1 = \"foo\". Important use symbol & one conditions recode. use R code syntax directly asis, use raw prefix ie. raw(AAR == 1990:2000 & TAB1 == \"foo\"). Selection %%, %chin%, | etc. can used raw prefix.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_post.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Post Recode Columns — do_recode_post","text":"","code":"do_recode_post(dt = NULL, spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_post.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Post Recode Columns — do_recode_post","text":"dt Input data preferrably data.table format mandatory spec Specification tbl_Filgruppe con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_regexp.html","id":null,"dir":"Reference","previous_headings":"","what":"Recode Variables with Regular Expression — do_recode_regexp","title":"Recode Variables with Regular Expression — do_recode_regexp","text":"Recode variables regular expression based specification tbl_KodeBok TYPE RE. specification codebook can specific, common general. Specific LESID FILGRUPPE specified create unique reference able recode variables. Common FILGRUPPE specified LESID left empty general FILGRUPPE specified ALLE LESID left empty.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_regexp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recode Variables with Regular Expression — do_recode_regexp","text":"","code":"do_recode_regexp(dt = NULL, spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_regexp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recode Variables with Regular Expression — do_recode_regexp","text":"dt Input data preferrably data.table format mandatory spec Specifications data data.frame con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_without_aggregate.html","id":null,"dir":"Reference","previous_headings":"","what":"Recode Geo Code Without Aggregate — do_recode_without_aggregate","title":"Recode Geo Code Without Aggregate — do_recode_without_aggregate","text":"Recode geo code without aggregating data. input argument source must lower granularity level level input.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_without_aggregate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recode Geo Code Without Aggregate — do_recode_without_aggregate","text":"","code":"do_recode_without_aggregate( dt = NULL, source = c(\"grunnkrets\", \"fylke\", \"kommune\", \"bydel\"), year = NULL, base = NULL, ... )"},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_without_aggregate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recode Geo Code Without Aggregate — do_recode_without_aggregate","text":"dt Input data preferrably data.table format mandatory source geographical granularity codes available source data. used merging output geo_map() year year geograhical codes recoded . empty global option orgdata.year used. base Logical value. TRUE use year original data base year recode geographical codes. Default FALSE use available codes geo codebook ... additional arguments","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_recode_without_aggregate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Recode Geo Code Without Aggregate — do_recode_without_aggregate","text":"","code":"if (FALSE) { # Source data with enumeration area codes ie. grunnkrets dt <- make_file(\"BEFOLKNING\", aggregate = FALSE) }"},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshape from Wide to Long — do_reshape","title":"Reshape from Wide to Long — do_reshape","text":"Reshape dataset wide format long format.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshape from Wide to Long — do_reshape","text":"","code":"do_reshape(dt = NULL, respec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshape from Wide to Long — do_reshape","text":"dt Dataset reshaped respec Reshape specification id, measure reshape type variables. output get_reshape_id_val()","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_long.html","id":null,"dir":"Reference","previous_headings":"","what":"Special Need Reshape to Long — do_reshape_long","title":"Special Need Reshape to Long — do_reshape_long","text":"function applicable reshape data reshaped wide via Access specification RESHAPE columns.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_long.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Special Need Reshape to Long — do_reshape_long","text":"","code":"do_reshape_long(dt = NULL, respec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_long.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Special Need Reshape to Long — do_reshape_long","text":"dt output dataset do_reshape_wide() respec Reshape specification id value variables. output get_reshape_wide_spec()","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_rename_col.html","id":null,"dir":"Reference","previous_headings":"","what":"Rename Reshaped Column — do_reshape_rename_col","title":"Rename Reshaped Column — do_reshape_rename_col","text":"Reshaping variables dataset wide long produce ID value columns. function rename columns specified RESHAPE_KOL Access registration database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_rename_col.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rename Reshaped Column — do_reshape_rename_col","text":"","code":"do_reshape_rename_col(dt = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_rename_col.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rename Reshaped Column — do_reshape_rename_col","text":"dt Dataset reshaped spec Specification column RESHAPE_KOL tbl_Innlesing","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_wide.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshape from Long to Wide — do_reshape_wide","title":"Reshape from Long to Wide — do_reshape_wide","text":"Reshape dataset long format wide format.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_wide.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshape from Long to Wide — do_reshape_wide","text":"","code":"do_reshape_wide(dt = NULL, respec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_reshape_wide.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshape from Long to Wide — do_reshape_wide","text":"dt Dataset reshaped respec Reshape specification id value variables. output get_reshape_wide_spec()","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/do_split.html","id":null,"dir":"Reference","previous_headings":"","what":"Split Column — do_split","title":"Split Column — do_split","text":"Split columns specified registration database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_split.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split Column — do_split","text":"","code":"do_split(dt = NULL, split = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_split.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split Column — do_split","text":"dt Input data preferrably data.table format mandatory split Split specification list. equivalent output get_split() function","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_year.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Year to Data — do_year","title":"Add Year to Data — do_year","text":"Add column year exist rawdata","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/do_year.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Year to Data — do_year","text":"","code":"do_year(dt = NULL, year = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/do_year.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Year to Data — do_year","text":"dt Input data preferrably data.table format mandatory year Output get_year()","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/emoji.html","id":null,"dir":"Reference","previous_headings":"","what":"Emoji — emoji","title":"Emoji — emoji","text":"Change emoji output messages fun 😄","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/emoji.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Emoji — emoji","text":"","code":"emoji( x = c(\"mark\", \"thumb\", \"write\", \"smile\", \"sad\", \"santa\", \"search\", \"folder\", \"book\") )"},{"path":"https://helseprofil.github.io/orgdata/reference/emoji.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Emoji — emoji","text":"x Emoji choose ie. thumb, smile etc","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/emoji.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Emoji — emoji","text":"","code":"emoji(\"smile\")"},{"path":"https://helseprofil.github.io/orgdata/reference/find_age_category.html","id":null,"dir":"Reference","previous_headings":"","what":"Create age categories — find_age_category","title":"Create age categories — find_age_category","text":"Create age categories either age interval specified age categories. define age categories EXTRA column Access shown example . Age categories can specified follows: Specific interval eg. every 5 years. Interval odd numbers use minimum age 0 maximum age 85+, even number uses maximum age 80+. Specified interval eg. 0-18, 19-44, 45-64, 65-79, 80+","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_age_category.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create age categories — find_age_category","text":"","code":"find_age_category(dt = NULL, interval = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/find_age_category.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create age categories — find_age_category","text":"dt Dataset interval Age interval","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/find_age_category.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create age categories — find_age_category","text":"","code":"if (FALSE) { AgeCat(5) #Group age for every 5 years with min 0 and max 85+ AgeCat(10) #Group age for every 10 years with min 0 and max 80+ AgeCat(0, 19, 45, 65, 80) #Age group of 0-18, 19-44, 45-64, 65-79, 80+ }"},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_input.html","id":null,"dir":"Reference","previous_headings":"","what":"Columns with Single Input — find_column_input","title":"Columns with Single Input — find_column_input","text":"Get value column one input allowed.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Columns with Single Input — find_column_input","text":"","code":"find_column_input( spec = NULL, col = NULL, type = c(\"character\", \"double\", \"integer\") )"},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Columns with Single Input — find_column_input","text":"spec Specifications data data.frame col Column name database table type Type object output ie. double, integer character. Default character.","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_multi.html","id":null,"dir":"Reference","previous_headings":"","what":"Columns with Multiple Inputs — find_column_multi","title":"Columns with Multiple Inputs — find_column_multi","text":"Get arguments selected column multiple arguments find_column_multi(). output character type arguments length. can can used find_column_multi_input() function get value input list object. interested specific argument among arguments column, use find_column_multi_input_arg() function. See example.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_multi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Columns with Multiple Inputs — find_column_multi","text":"","code":"find_column_multi(spec = NULL, col = NULL, sep = c(\",\", \"|\", \":\", \";\", \"&\")) find_column_multi_input(input = NULL) find_column_multi_input_arg(input = NULL, arg = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_multi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Columns with Multiple Inputs — find_column_multi","text":"spec Specifications data data.frame col Column name database table sep Symbols separate arguments eg. \",\" \":\" input Input argument(s) character vector arg Name specific argument column","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_multi.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Columns with Multiple Inputs — find_column_multi","text":"Output: find_column_multi gives character vector arguments separated sep argument find_column_multi_input gives list argument names values find_column_multi_input_arg gives single object value selected argument","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/find_column_multi.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Columns with Multiple Inputs — find_column_multi","text":"","code":"if (FALSE) { args <- find_column_multi(spec, \"INNLESARG\") vals <- find_column_multi_input(args) val <- find_column_multi_input_arg(args, \"header\") }"},{"path":"https://helseprofil.github.io/orgdata/reference/find_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Find Rawdata — find_data","title":"Find Rawdata — find_data","text":"Find rawdata load memory process. requires class attribute file set prior using find_data() method. Otherwise, use read_file() function instead unless specific reason .","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find Rawdata — find_data","text":"","code":"find_data(file = NULL, ...)"},{"path":"https://helseprofil.github.io/orgdata/reference/find_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find Rawdata — find_data","text":"file Input file ... options relevant file type","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find Rawdata — find_data","text":"","code":"if (FALSE) { file <- \"path/to/my-data.csv\" class(file) <- \"csv\" dt <- find_data(file) }"},{"path":"https://helseprofil.github.io/orgdata/reference/find_implicit_col.html","id":null,"dir":"Reference","previous_headings":"","what":"Find Implicit Null Categories — find_implicit_col","title":"Find Implicit Null Categories — find_implicit_col","text":"Find implicit null categories selected columns every selected year","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_implicit_col.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find Implicit Null Categories — find_implicit_col","text":"","code":"find_implicit_col(dt, years, col, ref)"},{"path":"https://helseprofil.github.io/orgdata/reference/find_implicit_col.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find Implicit Null Categories — find_implicit_col","text":"dt Dataset consisting years years years dataset col Selected column controlled implicit null ref Reference values selected column","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/find_implicit_null.html","id":null,"dir":"Reference","previous_headings":"","what":"Dataset for Implicit Null — find_implicit_null","title":"Dataset for Implicit Null — find_implicit_null","text":"Create dataset implicit null every selected columns","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_implicit_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dataset for Implicit Null — find_implicit_null","text":"","code":"find_implicit_null(imp, year, colstr, level)"},{"path":"https://helseprofil.github.io/orgdata/reference/find_implicit_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dataset for Implicit Null — find_implicit_null","text":"imp list implicit null data derived get_implicit_col function year Selected year dataset colstr Column structure Class type level Geographical granularity aggregating data. See getOption(\"orgdata.geo.levels\")","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/find_spec.html","id":null,"dir":"Reference","previous_headings":"","what":"File Specifications in Registration Database — find_spec","title":"File Specifications in Registration Database — find_spec","text":"function find specifications Access registration database via SQL code. example orginal data data restructured aggregated.. etc.. etc.. specifications registered following tables: tbl_Filgruppe - File group specification output tbl_Orgfile - original files tbl_Innlesing - file read R tbl_Koble - Connection original files file groups read tbl_KodeBok - Code book recode value tbl_Compute - Code book create new category existing categories SQL file must written base::sprintf style ie. '%s','%d' etc. Please refer base::sprintf documentation. addition, SQL code must contain comments. Example SQL code '%s': SELECT * tbl_Koble FILGRUPPE = '%s' saved C:/myfile.sql run code example.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_spec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"File Specifications in Registration Database — find_spec","text":"","code":"find_spec( file = NULL, value = NULL, con = NULL, external = FALSE, char = NULL, char2 = NULL, opposite = FALSE )"},{"path":"https://helseprofil.github.io/orgdata/reference/find_spec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"File Specifications in Registration Database — find_spec","text":"file SQL file. external TRUE complete filepath must specified. value value selection SQL code base::sprintf style. example name filgruppe. con Connection database external SQL file outside package. Default FALSE. char First input value added query char2 Second input value added query opposite TRUE second input value read first input value","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_spec.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"File Specifications in Registration Database — find_spec","text":"put data.frame.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/find_spec.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"File Specifications in Registration Database — find_spec","text":"","code":"if (FALSE) { qr <- find_spec(\"C:/myfile.sql\", value = \"BEFOLKNING\", con = dbconn, external = TRUE) qr2 <- find_spec(\"your.sql\", con = dbconn, char = \"BEFOLKNING\", char2 = 14) }"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_levels.html","id":null,"dir":"Reference","previous_headings":"","what":"Granularity of Georgraphical Codes — geo_levels","title":"Granularity of Georgraphical Codes — geo_levels","text":"Create database granularity geographical codes aggregate data accordingly. Implementation function base norgeo::cast_geo() function norgeo package.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/geo_levels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Granularity of Georgraphical Codes — geo_levels","text":"","code":"geo_levels(year = NULL, write = FALSE, append = FALSE, table = \"tblGeo\")"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_levels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Granularity of Georgraphical Codes — geo_levels","text":"year Year valid geographical codes write Write table orgdata.geo database. overwrite table already exists append Append data existing table orgdata.geo table Table name created database. Default tblGeo","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/geo_levels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Granularity of Georgraphical Codes — geo_levels","text":"","code":"if (FALSE) { geo_map(2020, write = TRUE) geo_map(2021, append = TRUE) }"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_map.html","id":null,"dir":"Reference","previous_headings":"","what":"Granularity of Geographical Codes — geo_map","title":"Granularity of Geographical Codes — geo_map","text":"Create database granularity geographical codes aggregate data accordingly. Implementation function base norgeo::cast_geo() function norgeo package.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/geo_map.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Granularity of Geographical Codes — geo_map","text":"","code":"geo_map(year = NULL, write = FALSE, append = FALSE, table = \"tblGeo\")"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_map.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Granularity of Geographical Codes — geo_map","text":"year Year valid geographical codes write Write table orgdata.geo database. overwrite table already exists append Append data existing table orgdata.geo table Table name created database. Default tblGeo","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/geo_map.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Granularity of Geographical Codes — geo_map","text":"","code":"if (FALSE) { geo_map(2020, write = TRUE) geo_map(2021, append = TRUE) }"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_merge.html","id":null,"dir":"Reference","previous_headings":"","what":"Merge Other Geo Level Manually — geo_merge","title":"Merge Other Geo Level Manually — geo_merge","text":"Geo codes downloaded SSB API can merged main geo table ie. tblGeo geocodes database. file must consist id column merge ie. id.file geo codes add ie. geo.col.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/geo_merge.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Merge Other Geo Level Manually — geo_merge","text":"","code":"geo_merge( id.table = NULL, id.file = NULL, geo.col = NULL, geo.level = NULL, file = NULL, year = NULL, write = FALSE, table.name = \"tblGeo\", ... )"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_merge.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Merge Other Geo Level Manually — geo_merge","text":"id.table ID columname merge found database eg. kommune id.file ID columname file merge . depends columnames files. id.table kommune, id.file must columname representing geo codes equivalent kommune codes. id.table id.file used merging codes must unique. geo.col Columname new geo codes eg. new geo codes levekaar, geo.col columname codes levekaar can found. geo.level Geographical level merged file representing eg. \"levekaar\". value column level tblGeo database. file Complete path filename merge year Year code valid . sepecified orgdata.year used. write Write table orgdata.geo database. overwrite table already exists table.name Name table geo recode geocodes database. can found getOptions(\"orgdata.geo\"). default tblGeo. ... possible arguments","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/geo_merge.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Merge Other Geo Level Manually — geo_merge","text":"","code":"if (FALSE) { dt <- geo_merge(id.table = \"grunnkrets\", id.file = \"id\", geo.col = \"col2\", geo.level = \"levekaar\", file = \"C:/path/to/file.csv\", year = 2022) }"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_recode.html","id":null,"dir":"Reference","previous_headings":"","what":"Geographical Codes to Recode — geo_recode","title":"Geographical Codes to Recode — geo_recode","text":"Create table current year geographical codes previous years geogprahical codes. used recode previous years codes current codes. Implementation function base norgeo::track_change() function.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/geo_recode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Geographical Codes to Recode — geo_recode","text":"","code":"geo_recode( type = c(\"grunnkrets\", \"bydel\", \"kommune\", \"fylke\"), from = NULL, to = NULL, write = FALSE, append = FALSE )"},{"path":"https://helseprofil.github.io/orgdata/reference/geo_recode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Geographical Codes to Recode — geo_recode","text":"type Type regional granularity ie. enumeration area (grunnkrets) Starting year range period. Current year default left empty End year range period. Current year default left empty write Write table orgdata.geo database. overwrite table already exists append Append data existing table orgdata.geo","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/geo_recode.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Geographical Codes to Recode — geo_recode","text":"","code":"if (FALSE) { geo_recode(type = \"grunnkrets\", from = 2018, to = 2021, write = TRUE) geo_recode(type = \"grunnkrets\", from = 2018, to = 2021, append = TRUE) }"},{"path":"https://helseprofil.github.io/orgdata/reference/get_aggregate.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Aggregate Specification — get_aggregate","title":"Get Aggregate Specification — get_aggregate","text":"Get specification data aggregated different geographical levels ie. county, manucipality, town etc.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_aggregate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Aggregate Specification — get_aggregate","text":"","code":"get_aggregate(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_aggregate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Aggregate Specification — get_aggregate","text":"group group files (filgruppe) con Connection database spec Specification tbl_Filgruppe","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok.html","id":null,"dir":"Reference","previous_headings":"","what":"Codebook — get_codebok","title":"Codebook — get_codebok","text":"Get codebook recoding variables based FILGRUPPE LESID number. Specification group ALLE used neither FILGRUPPE LESID specified.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Codebook — get_codebok","text":"","code":"get_codebok(spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Codebook — get_codebok","text":"spec Specifications data data.frame con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok_aggregate.html","id":null,"dir":"Reference","previous_headings":"","what":"Codebook for Aggregate Columns — get_codebok_aggregate","title":"Codebook for Aggregate Columns — get_codebok_aggregate","text":"Get codebook recoding aggregated variables based FILGRUPPE. Specification group ALLE used FILGRUPPE specified.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok_aggregate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Codebook for Aggregate Columns — get_codebok_aggregate","text":"","code":"get_codebok_aggregate(spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok_aggregate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Codebook for Aggregate Columns — get_codebok_aggregate","text":"spec Specifications data data.frame con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok_regexp.html","id":null,"dir":"Reference","previous_headings":"","what":"Codebook with Regular Expression — get_codebok_regexp","title":"Codebook with Regular Expression — get_codebok_regexp","text":"Get codebook regular expression recode variables based FILGRUPPE LESID number. Specification group ALLE used neither FILGRUPPE LESID specified.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok_regexp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Codebook with Regular Expression — get_codebok_regexp","text":"","code":"get_codebok_regexp(spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_codebok_regexp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Codebook with Regular Expression — get_codebok_regexp","text":"spec Specifications data data.frame con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_colname.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Renamed Columns — get_colname","title":"Get Renamed Columns — get_colname","text":"Get old new coloumnames renamed dataset.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_colname.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Renamed Columns — get_colname","text":"","code":"get_colname(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_colname.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Renamed Columns — get_colname","text":"group group files (filgruppe) con Connection database spec Specification tbl_Filgruppe","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_colname.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Renamed Columns — get_colname","text":"list consist two variables ie. old new indicating old new columnames","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_column_standard.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Standard Columns — get_column_standard","title":"Get Standard Columns — get_column_standard","text":"Standard columns names rawdata checked standard names options getOption(\"orgdata.columns\"). Nevertheless column GEO special case geo codes derived combination two columns.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_column_standard.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Standard Columns — get_column_standard","text":"","code":"get_column_standard(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_column_standard.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Standard Columns — get_column_standard","text":"group group files (filgruppe) con Connection database spec Specification standard columns tbl_Innlesing","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_column_standard.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Standard Columns — get_column_standard","text":"list old new columnnames","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_delete_row_spec.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Rows for Deletion — get_delete_row_spec","title":"Get Rows for Deletion — get_delete_row_spec","text":"Get rows deleted specified minus - symbol codebook based FILGRUPPE LESID number. Specification group ALLE used neither FILGRUPPE LESID specified.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_delete_row_spec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Rows for Deletion — get_delete_row_spec","text":"","code":"get_delete_row_spec(spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_delete_row_spec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Rows for Deletion — get_delete_row_spec","text":"spec Specifications data data.frame con Connection database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Extra Arguments — get_extra_args","title":"Get Extra Arguments — get_extra_args","text":"based input EXTRA column Access registration database. arguments valid can expanded whenever needed. argument names written CamelCase style. Use comma seperate multiple arguments.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Extra Arguments — get_extra_args","text":"","code":"get_extra_args(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Extra Arguments — get_extra_args","text":"group group files (filgruppe) con Connection database spec Specifications data data.frame","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Extra Arguments — get_extra_args","text":"list names value arguments","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args_group.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Extra Arguments for Filegroup — get_extra_args_group","title":"Get Extra Arguments for Filegroup — get_extra_args_group","text":"based input EXTRA column Access registration database filegroup. arguments valid can expanded whenever needed. argument names written CamelCase style. Use comma seperate multiple arguments.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args_group.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Extra Arguments for Filegroup — get_extra_args_group","text":"","code":"get_extra_args_group(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args_group.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Extra Arguments for Filegroup — get_extra_args_group","text":"group group files (filgruppe) con Connection database spec Specifications data data.frame","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_extra_args_group.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Extra Arguments for Filegroup — get_extra_args_group","text":"list names value arguments","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_geo_recode.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Previous and Current Geo Codes — get_geo_recode","title":"Get Previous and Current Geo Codes — get_geo_recode","text":"Get geographical codes registered geo-database consist old new codes applicable respective year.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_geo_recode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Previous and Current Geo Codes — get_geo_recode","text":"","code":"get_geo_recode( con = NULL, type = c(\"grunnkrets\", \"fylke\", \"kommune\", \"bydel\"), year = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/get_geo_recode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Previous and Current Geo Codes — get_geo_recode","text":"con Connection database type geographical granularity recode year year geograhical codes recoded . empty global option orgdata.year used.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_geo_recode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Previous and Current Geo Codes — get_geo_recode","text":"dataset columns GEO representing GEO codes recoded new code ie. .","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_grunnkrets_dummy.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Dummy Enumeration Area Codes — get_grunnkrets_dummy","title":"Create Dummy Enumeration Area Codes — get_grunnkrets_dummy","text":"downloaded enumeration area codes SSB lack codes missing ie. xxxx9999. function create codes needed recoding older codes current enumeration area codes.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_grunnkrets_dummy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Dummy Enumeration Area Codes — get_grunnkrets_dummy","text":"","code":"get_grunnkrets_dummy(dt, from, to)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_grunnkrets_dummy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Dummy Enumeration Area Codes — get_grunnkrets_dummy","text":"dt Downloaded data norgeo::track_change() Starting year range period. Current year default left empty End year range period. Current year default left empty","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_col.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Implicit Null Categories — get_implicit_col","title":"Get Implicit Null Categories — get_implicit_col","text":"Get categories implicit values selected columns","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_col.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Implicit Null Categories — get_implicit_col","text":"","code":"get_implicit_col(dt, years, cols, refs)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_col.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Implicit Null Categories — get_implicit_col","text":"dt Dataset consisting years years years dataset cols Columns controlled implicit null refs Reference values selected columns","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_per_year.html","id":null,"dir":"Reference","previous_headings":"","what":"Dataset for Implicit Null by Year — get_implicit_per_year","title":"Dataset for Implicit Null by Year — get_implicit_per_year","text":"Create dataset implicit null available year dataset","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_per_year.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dataset for Implicit Null by Year — get_implicit_per_year","text":"","code":"get_implicit_per_year(imp, refs, years, colstr, .env = parent.frame())"},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_per_year.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dataset for Implicit Null by Year — get_implicit_per_year","text":"imp list implicit null data derived get_implicit_col function refs Reference values selected columns years years dataset colstr Column structure Class type .env Inherit object parent frame","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_ref.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Reference Values — get_implicit_ref","title":"Get Reference Values — get_implicit_ref","text":"Get valid values columns controlled possible implicit null.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_ref.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Reference Values — get_implicit_ref","text":"","code":"get_implicit_ref(dt, cols)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_implicit_ref.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Reference Values — get_implicit_ref","text":"dt Dataset consisting years cols Columns controlled implicit null","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_innlesarg.html","id":null,"dir":"Reference","previous_headings":"","what":"Get INNLESARG Specifications — get_innlesarg","title":"Get INNLESARG Specifications — get_innlesarg","text":"function access possible arguments columns INNLESARG table tbl_Innlesing'. Symbol \"|\" MUST used separate arguments one arguments. symbol right top TAB button keyboard. Arguments can used depends file type. Please refer read_file(). example: header=TRUE | sheet=Ark1 | sep=,","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_innlesarg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get INNLESARG Specifications — get_innlesarg","text":"","code":"get_innlesarg(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_innlesarg.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get INNLESARG Specifications — get_innlesarg","text":"group group files (filgruppe) con Connection database spec Specifications data data.frame","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_innlesarg.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get INNLESARG Specifications — get_innlesarg","text":"list names value arguments","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_manheader.html","id":null,"dir":"Reference","previous_headings":"","what":"Get MANHEADER — get_manheader","title":"Get MANHEADER — get_manheader","text":"Get inputs column MANHEADER tbl_Innlesing. input tells want manually rename column various reasons column name rawdata long uses unstandard naming style. input like : 3,6=AGE,EDUCATION means want rename column 3 AGE column 6 EDUCATION.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_manheader.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get MANHEADER — get_manheader","text":"","code":"get_manheader(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_manheader.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get MANHEADER — get_manheader","text":"group group files (filgruppe) con Connection database spec Specifications data data.frame","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_manheader.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get MANHEADER — get_manheader","text":"list containing $index refer column index $col new name selected column index.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_mutate_value.html","id":null,"dir":"Reference","previous_headings":"","what":"Value for New Column — get_mutate_value","title":"Value for New Column — get_mutate_value","text":"Get value new column column fullfilled condition new column.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_mutate_value.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Value for New Column — get_mutate_value","text":"","code":"get_mutate_value(col)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_mutate_value.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Value for New Column — get_mutate_value","text":"col selected column","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_reshape_id_val.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshape Id and Measure — get_reshape_id_val","title":"Reshape Id and Measure — get_reshape_id_val","text":"Get id measure variables reshaping dataset. detail please read data.table::melt.data.table understand id mearsure variables.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_reshape_id_val.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshape Id and Measure — get_reshape_id_val","text":"","code":"get_reshape_id_val(dt = NULL, group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_reshape_id_val.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshape Id and Measure — get_reshape_id_val","text":"dt Dataset reshaped group group files (filgruppe) con Connection database spec Specification tbl_Filgruppe","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_reshape_wide_spec.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshape Wide Specification — get_reshape_wide_spec","title":"Reshape Wide Specification — get_reshape_wide_spec","text":"Get formula value variables reshaping long dataset wide. detail please read data.table::dcast.data.table understand formula value variables.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_reshape_wide_spec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshape Wide Specification — get_reshape_wide_spec","text":"","code":"get_reshape_wide_spec(dt = NULL, group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_reshape_wide_spec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshape Wide Specification — get_reshape_wide_spec","text":"dt Dataset reshaped group group files (filgruppe) con Connection database spec Specification tbl_Filgruppe","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/get_split.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Split Column — get_split","title":"Get Split Column — get_split","text":"Get column splitted column name new splitted columns. already specification find_spec(), arguments group con must NULL.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_split.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Split Column — get_split","text":"","code":"get_split(group = NULL, con = NULL, spec = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_split.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Split Column — get_split","text":"group group files (filgruppe) con Connection database spec Specification tbl_Filgruppe","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_split.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Split Column — get_split","text":"list consist two variables ie. indicating column split new column names ","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_year.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Year of Data — get_year","title":"Get Year of Data — get_year","text":"Get year rawdata either available rawdata manually specified registration database. Check helper function is_defaar(). get_aar() alias get_year()","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_year.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Year of Data — get_year","text":"","code":"get_year(spec = NULL, con = NULL) get_aar(spec = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/get_year.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Year of Data — get_year","text":"spec Specifications data data.frame con Connection database","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/get_year.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Year of Data — get_year","text":"Either character integer value. Character value refering column name raw data value year. Integer value refers year shoule added raw data column name AAR","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_col_num_warn.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert column to numeric with warning — is_col_num_warn","title":"Convert column to numeric with warning — is_col_num_warn","text":"Covert numeric columns expected numeric give warning log coercion","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_col_num_warn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert column to numeric with warning — is_col_num_warn","text":"","code":"is_col_num_warn(dt, cols, koblid = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/is_col_num_warn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert column to numeric with warning — is_col_num_warn","text":"dt Dataset cols Columns converted numeric koblid ID connect file spec","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_col_separate.html","id":null,"dir":"Reference","previous_headings":"","what":"Multiple inputs style — is_col_separate","title":"Multiple inputs style — is_col_separate","text":"Multiple inputs separated , KOLNAVN MANHEADER","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_col_separate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multiple inputs style — is_col_separate","text":"","code":"is_col_separate(input)"},{"path":"https://helseprofil.github.io/orgdata/reference/is_col_separate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multiple inputs style — is_col_separate","text":"input product find_column_input()","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_conn_db.html","id":null,"dir":"Reference","previous_headings":"","what":"Connect to Database — is_conn_db","title":"Connect to Database — is_conn_db","text":"Alternative function produce R6 object connecting database","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_conn_db.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Connect to Database — is_conn_db","text":"","code":"is_conn_db(dbname = NULL, db = c(\"kh\", \"geo\", \"raw\"), .test = FALSE, ...)"},{"path":"https://helseprofil.github.io/orgdata/reference/is_conn_db.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connect to Database — is_conn_db","text":"dbname Database filename complete path db Database file kh (Kommunehelse), geo (Geo code) raw (Raw database) .test Use testing ... arguments","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_defaar.html","id":null,"dir":"Reference","previous_headings":"","what":"Year for The Data — is_defaar","title":"Year for The Data — is_defaar","text":"Find year value column DEFAAR table tbl_Orgfile column year available raw data. indicated $Y column AAR table tbl_Innlesing.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_defaar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Year for The Data — is_defaar","text":"","code":"is_defaar(id = NULL, con = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/is_defaar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Year for The Data — is_defaar","text":"con Connection database","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_defaar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Year for The Data — is_defaar","text":"integer","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_input_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Type of object input — is_input_type","title":"Type of object input — is_input_type","text":"Convert value selected type ie. checked typeof","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_input_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Type of object input — is_input_type","text":"","code":"is_input_type(value, type = c(\"character\", \"double\", \"integer\"))"},{"path":"https://helseprofil.github.io/orgdata/reference/is_input_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Type of object input — is_input_type","text":"value Input value converted","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_process_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Raw Data File — is_process_file","title":"Process Raw Data File — is_process_file","text":"Implement specifications raw data cleaning recoding data.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_process_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Raw Data File — is_process_file","text":"","code":"is_process_file( file, filespec, fgspec, con, verbose = NULL, row = NULL, control = FALSE, duck = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/is_process_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Raw Data File — is_process_file","text":"file File rawdata filespec Specification file tbl_Innlesing fgspec Specification file group con Connection database verbose Make processes explicit. Default FALSE row Select specific row control Logical value. file checked possible errors duck R6 object DuckDB","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_process_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Raw Data File — is_process_file","text":"dataset data.table format","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_query.html","id":null,"dir":"Reference","previous_headings":"","what":"Create the SQL query — is_query","title":"Create the SQL query — is_query","text":"Create SQL query get data specified","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/is_query.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create the SQL query — is_query","text":"","code":"is_query( file = NULL, value = NULL, external = FALSE, char = NULL, char2 = NULL, opposite = FALSE )"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":null,"dir":"Reference","previous_headings":"","what":"Connecting to Database — KHelse","title":"Connecting to Database — KHelse","text":"Connect registration database get necessary information data source cleaning specification. driver applicable Access Database. Calling method KHelse$new(YourFilePath) create object R6 Class. Please refer examples.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"Connecting to Database — KHelse","text":"dbname Database filename. dbtype Database type either Access DuckDB dbyear Production year. relevant DuckDB dbconn Database connection. tblname Table name created database. tblvalue Data inserted table tblname. Data must data.frame data.table format. dbpath Database path conn Create database connection. Default TRUE","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Connecting to Database — KHelse","text":"KHelse$new() KHelse$db_connect() KHelse$db_write() KHelse$db_read() KHelse$db_remove_table() KHelse$db_close()","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Connecting to Database — KHelse","text":"Start connecting database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Connecting to Database — KHelse","text":"","code":"KHelse$new( dbname = NULL, dbtype = \"Access\", dbyear = NULL, dbpath = FALSE, conn = TRUE )"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connecting to Database — KHelse","text":"dbname Database filename. dbtype Database type eg. Access, SQLite, DuckDB etc. dbyear Production year. arg relevant raw database DuckDB dbpath Path database file conn Create database connection. Default TRUE","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Connecting to Database — KHelse","text":"","code":"\\dontrun{ kh <- KHelse$new(file.path(getOption(\"orgdata.drive\"), getOption(\"orgdata.folder.db\"), getOption(\"orgdata.db\"))) kh$dbname kh$db_close() kh$db_connect() }"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"method-db-connect-","dir":"Reference","previous_headings":"","what":"Method db_connect()","title":"Connecting to Database — KHelse","text":"Reconnect database db_close used.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Connecting to Database — KHelse","text":"","code":"KHelse$db_connect()"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"method-db-write-","dir":"Reference","previous_headings":"","what":"Method db_write()","title":"Connecting to Database — KHelse","text":"Write table database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Connecting to Database — KHelse","text":"","code":"KHelse$db_write( name = NULL, value = NULL, write = FALSE, append = FALSE, field.types = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connecting to Database — KHelse","text":"name Table name created database. value data inserted table. write Write table database. overwrite table already exists append Append data existing table database field.types Type data specified column. Must named vector","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"method-db-read-","dir":"Reference","previous_headings":"","what":"Method db_read()","title":"Connecting to Database — KHelse","text":"Read table convert data.table format","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Connecting to Database — KHelse","text":"","code":"KHelse$db_read(name = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connecting to Database — KHelse","text":"name Table name created database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"method-db-remove-table-","dir":"Reference","previous_headings":"","what":"Method db_remove_table()","title":"Connecting to Database — KHelse","text":"Remove table database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Connecting to Database — KHelse","text":"","code":"KHelse$db_remove_table(name = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connecting to Database — KHelse","text":"name Table name created database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"method-db-close-","dir":"Reference","previous_headings":"","what":"Method db_close()","title":"Connecting to Database — KHelse","text":"Close connection database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Connecting to Database — KHelse","text":"","code":"KHelse$db_close()"},{"path":"https://helseprofil.github.io/orgdata/reference/KHelse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Connecting to Database — KHelse","text":"","code":"## ------------------------------------------------ ## Method `KHelse$new` ## ------------------------------------------------ if (FALSE) { kh <- KHelse$new(file.path(getOption(\"orgdata.drive\"), getOption(\"orgdata.folder.db\"), getOption(\"orgdata.db\"))) kh$dbname kh$db_close() kh$db_connect() }"},{"path":"https://helseprofil.github.io/orgdata/reference/log.html","id":null,"dir":"Reference","previous_headings":"","what":"Environment to store log info — log","title":"Environment to store log info — log","text":"Environment store log info","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/log.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Environment to store log info — log","text":"","code":"log"},{"path":"https://helseprofil.github.io/orgdata/reference/log.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Environment to store log info — log","text":"object class environment length 0.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/make_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Implement the Specifications — make_file","title":"Implement the Specifications — make_file","text":"Make csv file specifications Access register database implement raw data selected group files ie. (filgruppe). files selected group affected unless KOBLID argument koblid specified. Specifying koblid useful especially testing purposes. function lag_fil() alias make_file().","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/make_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Implement the Specifications — make_file","text":"","code":"make_file( group = NULL, koblid = NULL, aggregate = NULL, save = FALSE, year = NULL, implicitnull = NULL, row = NULL, base = NULL, parallel = deprecated(), raw = NULL ) lag_fil( group = NULL, koblid = NULL, aggregate = NULL, save = FALSE, year = NULL, implicitnull = NULL, row = NULL, base = NULL, parallel = deprecated(), raw = NULL ) mf( group = NULL, koblid = NULL, aggregate = NULL, save = FALSE, year = NULL, implicitnull = NULL, row = NULL, base = NULL, parallel = deprecated(), raw = NULL )"},{"path":"https://helseprofil.github.io/orgdata/reference/make_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Implement the Specifications — make_file","text":"group group files (filgruppe) koblid KOBLID table tbl_Koble aggregate Logical value. Default TRUE. Aggregate data according specification registration database. Global options orgdata.aggregate. save Logical value. Default FALSE. save .csv format file activating save_file() function. year year geograhical codes recoded . empty global option orgdata.year used. implicitnull Logical value. Default TRUE add implicit null dataset. Global options orgdata.implicit.null. row Select specific row(s) numbers . Useful debugging. Please read Debugging article detail. base Logical value. TRUE use year original data base year recode geographical codes. Default FALSE use available codes geo codebook parallel Logical numeric value. logical value TRUE run parallel using 50% ie. 0.5 local cores. User can decide percentage needed. example use 75% cores specify parallel = 0.75. Nevertheless, maximum cores allowed 80%. Default value FALSE ie. use sequential processing raw Logical value. Default FALSE config. TRUE read original raw data directly source file even dataset already available DuckDB without need unmark KONTROLLERT Access database","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/make_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Implement the Specifications — make_file","text":"","code":"if (FALSE) { dt <- make_file(\"ENPERSON\") dt <- make_file(\"ENPERSON\", raw = TRUE) #Skip DuckDB and read directly from original files dt <- make_file(\"ENPERSON\", koblid = 120:125, parallel = TRUE) #with parallel processing }"},{"path":"https://helseprofil.github.io/orgdata/reference/make_filegroups.html","id":null,"dir":"Reference","previous_headings":"","what":"Make Multiple Filegroups — make_filegroups","title":"Make Multiple Filegroups — make_filegroups","text":"Implement specification registration database several filegroups . function used selected filegroups controlled errors. selected filegroups saved .csv file respective filegroup names folder registration database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/make_filegroups.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make Multiple Filegroups — make_filegroups","text":"","code":"make_filegroups(...) lag_filgrupper(...)"},{"path":"https://helseprofil.github.io/orgdata/reference/make_filegroups.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make Multiple Filegroups — make_filegroups","text":"... Filegroup(s)","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/make_filegroups.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make Multiple Filegroups — make_filegroups","text":"","code":"if (FALSE) { make_filegroups(NEET, TRANGBODD, DODE) fgp <- c(\"NEET\", \"TRANGBODD\",\"DODE\") make_filegroups(fgp) }"},{"path":"https://helseprofil.github.io/orgdata/reference/orgdata-package.html","id":null,"dir":"Reference","previous_headings":"","what":"orgdata: Aggregating Original Data — orgdata-package","title":"orgdata: Aggregating Original Data — orgdata-package","text":"Cleaning, restructuring aggregating original data usually enumerical area codes geographical codes.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/orgdata-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"orgdata: Aggregating Original Data — orgdata-package","text":"Aggregating Original Data (raw data) different geographical levels county, manucipality town.","code":""},{"path":[]},{"path":"https://helseprofil.github.io/orgdata/reference/orgdata-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"orgdata: Aggregating Original Data — orgdata-package","text":"Maintainer: Yusman Kamaleri ybka@fhi.(ORCID) contributors: FHI KHelse group (https://www.fhi./hn/folkehelse) [contributor, reviewer]","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/read_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Read Data File — read_file","title":"Read Data File — read_file","text":"Read rawdata either using FILID value complete file path. uses find_data() generic method. .csv file, data.table::fread() used arguments fread function can used. .xlsx .xls file readxl::read_excel() function arguments. .dta file, haven::read_dta() used arguments read_dta function can used. Nevertheless, used arguments standardized read_file() : nrows display maksimum numbers rows read header FALSE give default columnames V1, V2 etc skip specific number rows reading data trimws trim leading trailing whitespace na character value interpreted NA","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/read_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read Data File — read_file","text":"","code":"read_file(file = NULL, ...) les_fil(file = NULL, ...) rdf(file = NULL, ...)"},{"path":"https://helseprofil.github.io/orgdata/reference/read_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read Data File — read_file","text":"file Use FILID, FILEGROUP complete path filename. Data set .csv extension https:// can also input file arg. ... arguments passed related file format","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/read_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read Data File — read_file","text":"","code":"if (FALSE) { # With FILID DT <- read_file(file = 5) DT <- read_file(file = 5, fill = TRUE, nrows = 10) # With FILEGROUP dt <- read_file(file = \"UTFORE\") # With filepath rdata <- read_file(file = \"/file/path/mydata.xlsx\", sheet = \"S3\", range = cell_rows(1:4)) rdata <- read_file(file = \"/file/path/mydata.csv\", sep = \",\", header = FALSE) }"},{"path":"https://helseprofil.github.io/orgdata/reference/read_log.html","id":null,"dir":"Reference","previous_headings":"","what":"Read Log File — read_log","title":"Read Log File — read_log","text":"Read log file orgdata default path. check default path use orgdata:::is_orgdata_path().","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/read_log.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read Log File — read_log","text":"","code":"read_log(name = NULL, koblid = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/read_log.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read Log File — read_log","text":"name Log filename without file extention koblid Connecting ID KOBLID","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/read_log.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read Log File — read_log","text":"","code":"if (FALSE) { # To list codes with xxxx9999 of koblid 67 read_log(\"code99\", 67) }"},{"path":"https://helseprofil.github.io/orgdata/reference/reset_options.html","id":null,"dir":"Reference","previous_headings":"","what":"Reset options — reset_options","title":"Reset options — reset_options","text":"Reset orgdata options default","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/reset_options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reset options — reset_options","text":"","code":"reset_options() reset_opt()"},{"path":"https://helseprofil.github.io/orgdata/reference/reset_options.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reset options — reset_options","text":"","code":"reset_options()"},{"path":"https://helseprofil.github.io/orgdata/reference/save_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Save Data to CSV file — save_file","title":"Save Data to CSV file — save_file","text":"Save data .csv format file semicolon ; seperator. file saved specified folder path Access regstration database root getOption(\"orgdata.folder.data\"). Use argument save = TRUE make_file() activate save_file() directly. Else can call save_file() save object output make_file(). function wrapper data.table:fwrite().","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/save_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save Data to CSV file — save_file","text":"","code":"save_file( dt = NULL, name = NULL, path = NULL, date = FALSE, fgSpec = NULL, sep = \";\", ... ) lagre_fil( dt = NULL, name = NULL, path = NULL, date = FALSE, fgSpec = NULL, sep = \";\", ... )"},{"path":"https://helseprofil.github.io/orgdata/reference/save_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save Data to CSV file — save_file","text":"dt Input data preferrably data.table format mandatory name Filename .csv file filegroup name path Folder path save file. name valide filegroup (FILGRUPPE) use specified UTMAPPE Access registration database else file saved default folder C:\\Users\\YourUserName\\orgdata_logs. default folder created exist. date Logical value. TRUE use date time part filename. Default FALSE. fgSpec File group specification Access registration database sep separator columns. Default \";\" ... arguments data.table::fwrite","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/save_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save Data to CSV file — save_file","text":"","code":"if (FALSE) { # Save file directly make_file(\"BEFOLKNING\", save = TRUE) # Two steps DF <- make_file(\"BEFOLKNING\") save_file(DF, \"BEFOLKNING\") # Save with different name and specified folder save_file(DF, name = \"myCSVfile\", path = \"C:/MyFolder\") }"},{"path":"https://helseprofil.github.io/orgdata/reference/see_data.html","id":null,"dir":"Reference","previous_headings":"","what":"See Structured Data in the Data Warehouse — see_data","title":"See Structured Data in the Data Warehouse — see_data","text":"See original data clean structured data warehouse. Data saved warehouse column KONTROLLERT marked original file table Access. means dataset cleaned recoded specified INNLESING table Access registration database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/see_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"See Structured Data in the Data Warehouse — see_data","text":"","code":"see_data( group = NULL, koblid = NULL, year = NULL, action = c(\"read\", \"delete\") )"},{"path":"https://helseprofil.github.io/orgdata/reference/see_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"See Structured Data in the Data Warehouse — see_data","text":"group filegroup name (filgruppe) koblid KOBLID table tbl_Koble year year geograhical codes recoded . empty global option orgdata.year used. action read delete data warehouse. Default read.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/see_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"See Structured Data in the Data Warehouse — see_data","text":"","code":"if (FALSE) { dt <- see_data(\"LESEFERD\", koblid = 134) }"},{"path":"https://helseprofil.github.io/orgdata/reference/see_file.html","id":null,"dir":"Reference","previous_headings":"","what":"See Column Categories — see_file","title":"See Column Categories — see_file","text":"See categories available dataset.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/see_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"See Column Categories — see_file","text":"","code":"see_file(dt = NULL, ...) se_fil(dt = NULL, ...)"},{"path":"https://helseprofil.github.io/orgdata/reference/see_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"See Column Categories — see_file","text":"dt Dataset type data.frame data.table ... Columnames column index displayed. missing columns listed.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/see_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"See Column Categories — see_file","text":"","code":"if (FALSE) { DT <- make_file(\"BEFOLKNING\") # Use columnames see_file(DT, KJONN, UTDANN, LANDSSB) dt <- read_file(15) # Use column index see_file(dt) #all columns see_file(dt , c(2,5)) see_file(dt, c(1:3)) #columns 1 to 3 see_file(dt, c(2, 4, 7:9)) }"},{"path":"https://helseprofil.github.io/orgdata/reference/see_org.html","id":null,"dir":"Reference","previous_headings":"","what":"See Original Data in the Database — see_org","title":"See Original Data in the Database — see_org","text":"See original data saved org database column KONTROLLERT marked. means dataset cleaned recoded specified INNLESING table Access registration database.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/see_org.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"See Original Data in the Database — see_org","text":"","code":"see_org(group = NULL, koblid = NULL, year = NULL, action = c(\"read\", \"delete\"))"},{"path":"https://helseprofil.github.io/orgdata/reference/see_org.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"See Original Data in the Database — see_org","text":"group filegroup name (filgruppe) koblid KOBLID table tbl_Koble year year geograhical codes recoded . empty global option orgdata.year used. action read delete data database. Default read.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/see_org.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"See Original Data in the Database — see_org","text":"","code":"if (FALSE) { dt <- see_org(\"LESEFERD\", koblid = 134) }"},{"path":"https://helseprofil.github.io/orgdata/reference/update_orgdata.html","id":null,"dir":"Reference","previous_headings":"","what":"Update package — update_orgdata","title":"Update package — update_orgdata","text":"Update orgdata directly Github repo. Default main branch.","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/update_orgdata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update package — update_orgdata","text":"","code":"update_orgdata(...) upgrade_orgdata(...)"},{"path":"https://helseprofil.github.io/orgdata/reference/update_orgdata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update package — update_orgdata","text":"... arguments remotes::install_github()","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/update_orgdata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Update package — update_orgdata","text":"","code":"if (FALSE) { update_orgdata() #use default update_orgdata(ref = \"dev\") #to upgrade with dev branch }"},{"path":"https://helseprofil.github.io/orgdata/reference/website.html","id":null,"dir":"Reference","previous_headings":"","what":"Show Website — website","title":"Show Website — website","text":"Display website orgdata package ie. https://helseprofil.github.io/orgdata/","code":""},{"path":"https://helseprofil.github.io/orgdata/reference/website.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show Website — website","text":"","code":"website(url = NULL)"},{"path":"https://helseprofil.github.io/orgdata/reference/website.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show Website — website","text":"url URL","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-075","dir":"Changelog","previous_headings":"","what":"orgdata 0.7.5","title":"orgdata 0.7.5","text":"Use either empty tom represent regular expression replace since Access makes symbol \"\" invisible (#285) Change function name see_org() see_data() viewing data data warehouse. Use symbol | separate multiple arguments column EXTRA (#288) Group age specific specified interval AgeCat(). function can use table filegroup EXTRA column (#287 #289)","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-074","dir":"Changelog","previous_headings":"","what":"orgdata 0.7.4","title":"orgdata 0.7.4","text":"Delete raw similar columns multiple specifications (#282) Different ways recode similar column ie. duplicated, defined lesid give error. Show current installed version new release version.","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-073","dir":"Changelog","previous_headings":"","what":"orgdata 0.7.3","title":"orgdata 0.7.3","text":"Testing","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-072","dir":"Changelog","previous_headings":"","what":"orgdata 0.7.2","title":"orgdata 0.7.2","text":"minor text editing. Delete older file DuckDB automatically since new version can’t read older files (#280) Actively ask users update given options new release version available. Control columns numeric don’t contain string. columns controls now dynamic (#281)","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-071","dir":"Changelog","previous_headings":"","what":"orgdata 0.7.1","title":"orgdata 0.7.1","text":"Rename function alias rf() rdf() since rf() already use stats package. Deleting row specification lesid without lesid ie. common filegroup, create errors. fixed (#279) Need update version whenever new release available ensure everyone using latest release. Else users can’t load package.","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-070","dir":"Changelog","previous_headings":"","what":"orgdata 0.7.0","title":"orgdata 0.7.0","text":"Filter active files date done pragmatically ie. files BRUKTIL date 01-01-9999 excluded. Now filtering date compared current date. (#272) Delete dataset database unmark column KONTROLLERT instead updating dataset due time consuming updating . users mark column save read dataset database. (#278) Change default argument raw make_file() FALSE config file.","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-06","dir":"Changelog","previous_headings":"","what":"orgdata 0.6","title":"orgdata 0.6","text":"text editing . Function is_colour_txt() can specify symbol directly without needing rely global options use withr package. Just cosmetic purposes 😃 Standard columns uppercase. Using lowercase creates error GEO comes two separated columns especially handling recode codebook (#277) Standardize arguments names see_org() function. Parallel processing deactivated since doesn’t work smoothly Access DuckDB connection ie. DBI package, due problem -exportable objects future package. Replace SQLite DuckDB due speed DuckDB. since DuckDB active development, new version might work file created older version. situation older DuckDB database deleted re-run newer DuckDB version. loading package, users reminded whenever new version available. Show data frame warning NAs coercion instead just GEO number coercion took place (#274) Replace DuckDB SQLite (#271) Columnames case insensitive (#115) Use ellipsis arguments data.table::fwrite() save_file() function. Implicit null number geo digits moved config file. make easy maintain expand. Use future.apply package conditionally reduce package vulnerability. Deactivate dependency packages parallel processing. Use conditionally ie. install manually needed. Reshape multiple columns containing one VAL handled properly. reshaping multiple columns just one VAL leaving RESHAPE_VAL empty ie. use columns defined RESHAPE_ID work (#269) Give information error reshape data, especially long reshape. time source error defining RESHAPE_KOL RESHAPE_VAL (#268) Can reshape multiple columns reshaping LONG. Applicable multiple columns represent number cases one column represent denominator numerators (#266) Use KOBLID add delete Duck database (#261) Depends norgeo package refers directly CRAN version instead GitHub repo. Use function geo_merge() add geo granularity aren’t API. can csv, xls format accepted read_file (#262) Deactive KONTROLLERT without need umark Access database using argument raw = TRUE using function make_file() (#264)","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-05","dir":"Changelog","previous_headings":"","what":"orgdata 0.5","title":"orgdata 0.5","text":"Use KOBLID table name DuckDB instead FILID since FILID unique number ie. can used multiple KOBLID. Update text website Change function name geo_levels() geo_map() mapping geo codes granularity. Change helper function names read_file(). (#250) Fixed bugs reading file web https (#251) read_file() accept Stata file dta extension (#252) Use yaml format global configuration file ease update. file located config repo (#256) Raw data controlled saved DuckDB database format. increase reading speed especially big files. Mark column KONTROLLERT Access registration database activate function. Unmark read original raw file instead. (#257) Use see_org() read raw data database. Argument action = \"delete\" can used delete data raw database. Function geo_merge() merging geo codes aren’t available API mapping table ie. tblGeo, geo database. data file format accepted read_file() function. data merged must column merged ie. id.file, equivalent column id database ie. id.table. id.file must unique. Handle unbalanced parentheses post recode whenever possible raw used, else give error message. #246 read_file() accept filegroup name argument file read completed file running make_file() function. #247 Debug functions can go deeper show helper functions well debug_opt(\"deep\") options(orgdata.debug = \"deep\") #243 Post recode uses type PS codebook. function used need recode value column dataset clean aggregated. Specification select row recoded uses either standard expression R syntax data.table style. using R syntax value must raw prefix eg. raw(AAR %% c(2000, 2005)). #244 #245 Delete rows \"-\" minus symbol TIL column codebook accepted do_recode_post(). Able aggregate country level addition geographical levels (#240) Download geo code aggregate despite different geographical levels dataset aggregated (#241) Update package via function update_orgdata(). Basically ’s just wrapper remotes::install_github(). Can aggregate country level well (#240) Speed aggregate process (#241) Fixed bugs reshape wide consisting multiple dimensions ie. one TAB columns. (#228) Ensure melting columns converted factor (#234) columns numeric type columns GEO, AAR, KJONN, ALDER VALs. also specify global options orgdata.num. Ensure thise columns numeric give warning well log coercion NA introduced. (#235) Use log file check codes problem. (#237) Warn give logfile GEO can’t converted integer geo recode. (#233 #236) Able read files specific extension coma semicolon separated (#227) Ensure VAL columns numeric type (#229) Give explicit warning GEO codes character can cause coercion resulting converting GEO codes NA (#229) Log files code99 also include koblid. files named code99_koblidxxx (#222) Running parallel processing unstable. sure process crash due MS Access can’t handle constant requests … Anyway, running parallel now use 50% available cores (#224) User can specify less cores 50% needed. use 75% cores specifying parallel = 0.75 argment make_file() global options orgdata.parallel (#225) Connect database common function. (#212) Use global options orgdata.year specify production year using current year. (#216) Use parallel processing make_file() argument parallel = TRUE. (#217)","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-04","dir":"Changelog","previous_headings":"","what":"orgdata 0.4","title":"orgdata 0.4","text":"Get feedback successful unsuccessful filegroups running make_filegroups(). (#199) Reshape wide limited 3 reshape columns . (#200 #201) Create log files default orgdata folder instead occupying REM. (#202) Delete old bydel codes ie. 2003, except Oslo. due unstable geographical recoding bydel. Use EXTRA column filegroup level argument DeleteOldBydel. (#204 #206) Log files use KOBLID specific. (#208) Reshape wide format can now implement multiple reshape dimensions usually one multiple TAB columns. instance LESEFERD tot_elev product mestringsnivå klassetrinn. (#188) output arrange standard column order. (#190) Debugging easier wrapper function debug_opt(). (#196) Fixed #147 implement reshape wide format create denominator. function applicable certain file structure received SSB. example filegroup LESEFERD column tot_elev represents total number student mestringsnivå grand total students. number students mestringsnivå represented column ant_elev. Therefore long format mestringsnivå needs restructured wide value ant_elev ensure summing tot_elev creating denominator create grand total students instead total number students mestringsnivå. (#184) Fixed #162 saving geographical codebook write = TRUE table doesn’t exist geo-code database. Stop looping geographical levels orgdata.debug.geo orgdata.debug.aggregate active make default kommune. (#166) Add batch date codebook reference debugging. (#168) Hide warning messages file controlled possible errors. means column KONTROLLERT table original files marked specific file. (#171) Refactoring function recode geographical codes. (#174) Geo codes enumeration areas towns aren’t able merged converted unknown codes either xxxx9999 xxxx99. (#177) Create default folder C:/Users/YourUserName/orgdata_logs path argument specified save_file(). (#179) Create unknown codes enumeration areas town codes able recode. probably due enumeration codes 2002. Excel file SSB clean unstable used recoding. unknown codes based municipality codes added xxxx99 xxxx9999. #177 recode done municipality codes merging back original dataset. (#182) Add codeDelete log geographical codes aren’t able merged. codes excluded dataset. access deleted codes use log$codeDelete. (#149) Give explicit error message path missing save_file(). (#152) Able select valid year recode geographical codes aggregate accordingly. recoding geographical codes backward isn’t possible. (#153) Error message split long vector exist. (#153) Add column batch date geographical codes downloaded form SSB creating geo codebook geo_map() geo_recode(). (#156) Actively select first geo code old geo code split multiple new geo codes. (#159) Able select base year geo recode based year available original data. available column AAR dataset. Use argument base global option orgdata.recode.base logical input. TRUE select base year recoding geographical code year original file current year. Default FALSE ie. include available geographical codes available codebook. (#157) Fixed #139 orgdata.debug.geo keep original geo codes enumeration areas adding 9999. (#140) Fixed #142 show codes problem recode directly instead row numbers (#144) Save codes problem log environment easy access. list codes either log$code00 log$codeShort Recode geo even argument aggregate = FALSE make_file() function. Rename make_filegroup lag_filgruppe plural ie. make_filegroups lag_filgrupper. Use options orgdata.debug.row select specific row(s) processing. can activated via global options options(orgdata.debug.row = 20:50) via argument row = 20:50 make_file() select row 20 50. Fixed #135 incorrect geo recode. (#131) Make multiple filegroups via make_filegroups. (#137) Fixed #132 LANDSSB must string Convert whitespace NA able delete rows NA Fixed #119 able mutate TABS VALS well (#126) Fixed #122 delete rows NA via EXTRA column (#127) Fixed #118 warning text column(s) aren’t defined FILGRUPPE deleted (#128) Edit error message columns existing NA value aggregating. Total value NA conflict allready existing NA category aggregated column(s). Therefore existing NA value selected column(s) must recoded valid value.","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-03","dir":"Changelog","previous_headings":"","what":"orgdata 0.3","title":"orgdata 0.3","text":"Use options(orgdata.debug.geo = TRUE) keep old geo codes debuging (#120) Use reset_options() reset default options. Warn process discontinued due debugging. Add vignettes Standardize git Debugging Fixed #121 recode geographical code split codes (#120) Change database filename raw-database_BE.accdb Fixed #106 split long messages (#107) Fixed #108 #112 grunnkrets codes changed 2002 available via API SSB code changes municipality includes changes 1977. Check SSB website. use municipality codes create uspesified grunnkrets codes data 2002 (#109 #113) Fixed #110 updating SQL code new table name codebook (#111) Check columns aggregate possible NA (#98). Columns NA recoded uoppgitt something equivalent since leaving category NA conflict NA representing total value aggregating. Fixed #100 grunnkrets ends 00 correspond codes SSB API. Need add manually (#101) Fixed #99 geo codes fails recoded row index shown (#103) Geo codes ends 4 zeros xxxx0000 neither equivalent codes SSB representing correct coding structure called Delområde ends 2 zeros xxxxxx00. avoid missing information, geo codes recoded xxxx9999 function is_grunnkrets_0000() PR (#103). see_file() accepts just single numeric well. Fixed #85 see_file() list columns columnames column indexes specified. variables sorted whenever possible. (#87) Add function tests (#88) Exclude LANDSSB aggregate split LANDBAK INNVKAT. code 0 recoded 20 split causes unnecessary rows (#84) Delete deprecated functions. Fixed #93 source level can’t identified due NA. Fixed #95 grunnkrets codes aren’t missing less number digits ie. less 7 digits. Assuming codes municipality 9999 added end codes (#96) Gives row number GEO codes get coerced NA converted integer. make easy check original raw data (#96) Aggregate now give total dimensions including specified AGGKOL (#82) Function see_file() accept column index well (#83) Recode variables using regular expression defined codebook type RE. Finding pattern can either written ordinary regular expression ie. \\\\d{4}.* rex() package. (#78) New feature checking categories variables see_file() (#75) Fixed #65 make TABS VALS dynamic easy extension columns (#66) Fixed #64 recode variable different class (#68) Fixed #63 implicit null includes possible VAL columns exist (#69) Fixed #70 recode GEO different object class (#71) Fixed #67 aggregate total values standard variables ie. UTDANN, LANDSSB, LANDBAK INNVKAT (#72) Fixed #61 use AGGKOL Access registration database specify columns aggregate standard eg. KJONN, TAB1, TAB2 etc. (#73) Fixed #55 recode standard variables via codebook instead hard coded (#58) Fixed #52 skip split specified (#59) Fixed #57 split column duplicated values keep original column (#60) Fixed #56 aggregate VAL columns whenever specified specific VAL1 (#62) Edit verbose messages Reshape dataset wide long. Reshape can one measure variables. Please read specified Access registration database. Split columns must equal number values defined SPLITTIL. Duplicate value less maximum SPLITTIL. example value 0 column LANDSSB split LANDBAK INNVKAT, value duplicated 00 avoid split value NA. Recode LANDBAK INNVKAT aggregating done internally ie. hard coded, do_aggregate_recode_standard(). Total coded 20. eventuality future change also look related functions is_aggregate_standard_cols() is_col_num().","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-02","dir":"Changelog","previous_headings":"","what":"orgdata 0.2","title":"orgdata 0.2","text":"Change argument parameter find_spec() function. Update text document several places. Add colour type warn2 warning message without Warning: prefix. Request (#43) messages specific colour Fixed (#46) recode string even though columns type integer numeric. Unknown bydel ie. (uoppgitt) added enumeration areas codes ie. (grunnkrets) bydel XXXX9999 function geo_level(). Add unknown grunnkrets kommune available since datasets unknown grunnkrets aren’t listed API downloaded data (#39). Exclude TAB1, TAB2 TAB3 aggregated. (#44) Recode aggregated variables uses AG TYPE column codebook instead FILGRUPPE AGGREGATE implemented ver 0.2.0. make possible specify FILGRUPPE LESID implement principle GENERAL, COMMON SPECIFIC variables. Change function name do_aggregate_recode do_aggregate_recode_standard standard variables. Recode aggregated categories can defined Recode form ie. codebook, use AGGREGATE specification FILGRUPPE Delete rows defined codebook using minus symbol TIL column. Similar principles implemented GENERAL, COMMON SPECIFIC feature recode. Read detail ver 0.0.5 - alpha. Display columnames recoded found dataset aren’t found defined ALLE codebook user aware existence. Standardize used arguments read_file() nrows, header, skip, trimws na. Read details read_file() function description. Output read_file() data.table class. Use standard columnames V1, V2 etc argment header = FALSE specified. Error message list unmatch columns do_column_standard(). Give clearer message debug message eg. Execute: read_file(). Change MAPPE UTMAPPE make explicit path specification save file. Defun orgdata.active global options use columnames original dataset. Use global options options(orgdata.debug.nrow = TRUE) read first 20 rows. Suitable debug purposes. Fix (#28) GEO derived two columns empty INNLESARG. Add column LEVEL granularity level ie. grunnkrets, fylke, kommune, bydel etc","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata-001---alpha-version","dir":"Changelog","previous_headings":"","what":"orgdata 0.0.1 - alpha version","title":"orgdata 0.0.1 - alpha version","text":"MANHEADER used new columname must specified respective standard column (#21) Deprecated arguments geo val make_file. Output data must use standard columnames instead keeping columnames original dataset. Rename functions read_raw lesraw make_file lag_fil (#27) Alle functions uses underscore “_” english norwegian. Add new columns one standard columns missing original data. value inserted new column must use symbol less < >. instance column KJONN doesn’t exist original data, can specify <2> column KJONN Access registration database. output add new column KJONN value 2. (#15) Fix #13 #18 Default orgdata.verbose TRUE. Options orgdata.implicit.null default TRUE. Use options(orgdata.implicit.null = FALSE) deactivate (#19) Changes PR #11 #12 following: Implicit zero (#11). Discussion Gist Use version specific imported packages. Rename standard column LANDBAK LANDSSB column original data received SOB containing information country origin. Save file specified column MAPPE Access registration database specify path argument function save_file. (#12) Changes PR #8 following: Create GEO code two separate columns. defined Access registration GEO comma separated eg. nameGeoCol1, nameGeoCol2. Order standard columns output dataset order first four columns: GEO, AAR, ALDER, KJONN Change norwegian name save_file lagfil lagrefil. Use column name KOLNAVN instead ADDKOL. Rename function do_addcols get_addcols do_colname get_colname consistent changes Access registration database. Changes PR #4 following: Recode variables specification tbl_KodeBok uses: GENERAL variables defined FILGRUPPE ALLE used recode variables groups. COMMON variables FILGRUPPE specified empty LESID. recode variables within selected group. SPECIFIC variables FILGRUPPE LESID specified. recode variables specified FILGRUPPE specified FILID. three specification exist tbl_KodeBok: SPECIFIC variables overrule COMMON variables COMMON variables overrule GENERAL variables Write codebook column FRA specifying missing variables indicating missing column recoded value column TIL. differentiate real missing real column value NA. (#5) Error message given LESID specified without FILGRUPPE since LESID unique ID.","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata---alpha-0-0-1","dir":"Changelog","previous_headings":"","what":"orgdata 0.0.4 - alpha","title":"orgdata 0.0.1 - alpha version","text":"MANHEADER KOLNAVN uses common helper function is_col_separate() MANHEADER old convert integer use index columns Changes PR #2","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata---alpha-0-0-1-1","dir":"Changelog","previous_headings":"","what":"orgdata 0.0.3 - alpha","title":"orgdata 0.0.1 - alpha version","text":"LESID unique id combination LESID FILGRUPPE Standard columns include 3 TABS 3 VALS KOLNAVN input uses comma separate VAL1=TOTAL, TAB1=ICDis valid input Changes PR #1","code":""},{"path":"https://helseprofil.github.io/orgdata/news/index.html","id":"orgdata---alpha-0-0-1-2","dir":"Changelog","previous_headings":"","what":"orgdata 0.0.2 - alpha","title":"orgdata 0.0.1 - alpha version","text":"Things implemented Bla.. bla.. bla..","code":""}] diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 7263f101..961102f3 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -120,6 +120,9 @@ https://helseprofil.github.io/orgdata/reference/emoji.html + + https://helseprofil.github.io/orgdata/reference/find_age_category.html + https://helseprofil.github.io/orgdata/reference/find_column_input.html diff --git a/man/age_category.Rd b/man/age_category.Rd deleted file mode 100644 index b62971dd..00000000 --- a/man/age_category.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/age-group.R -\name{age_category} -\alias{age_category} -\title{Create age categories} -\usage{ -age_category(dt = NULL, interval = NULL) -} -\arguments{ -\item{dt}{Dataset} - -\item{interval}{Age interval} -} -\description{ -Create age categories either by interval or specified age categories. -} -\examples{ -\dontrun{ -dd -} -} diff --git a/man/do_extra_args.Rd b/man/do_extra_args.Rd index c1556895..b997abd4 100644 --- a/man/do_extra_args.Rd +++ b/man/do_extra_args.Rd @@ -27,6 +27,7 @@ Currently, these arguments can be used: \seealso{ Other extra arguments: \code{\link{do_extra_args_group}()}, +\code{\link{find_age_category}()}, \code{\link{get_extra_args_group}()}, \code{\link{get_extra_args}()} } diff --git a/man/do_extra_args_group.Rd b/man/do_extra_args_group.Rd index 836004c9..510f3bf3 100644 --- a/man/do_extra_args_group.Rd +++ b/man/do_extra_args_group.Rd @@ -15,18 +15,21 @@ do_extra_args_group(dt = NULL, args = NULL) This is based on the input in \code{EXTRA} column from Access registration database on filegroup. The arguments that are valid here can be expanded whenever needed. See details section for valid arguments to be -used. All argument names are written in \code{CamelCase} style. Use symbol \code{|} -to separate multiple arguments. +used. All argument names are written in \code{CamelCase} style. + +NB! Use symbol \code{|} to separate multiple arguments eg. \code{DeleteOldBydel | AgeCat(5)} } \details{ Currently, these arguments can be used: \itemize{ \item \code{DeleteOldBydel} : Delete bydel codes before 2003, except for Oslo +\item \code{AgeCat()} : Categorise age to different groups with defined interval. Example can be found in \code{find_age_category()}. } } \seealso{ Other extra arguments: \code{\link{do_extra_args}()}, +\code{\link{find_age_category}()}, \code{\link{get_extra_args_group}()}, \code{\link{get_extra_args}()} } diff --git a/man/find_age_category.Rd b/man/find_age_category.Rd new file mode 100644 index 00000000..7e67e23e --- /dev/null +++ b/man/find_age_category.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/age-group.R +\name{find_age_category} +\alias{find_age_category} +\title{Create age categories} +\usage{ +find_age_category(dt = NULL, interval = NULL) +} +\arguments{ +\item{dt}{Dataset} + +\item{interval}{Age interval} +} +\description{ +Create age categories either by age interval or specified age +categories. How to define the age categories in \code{EXTRA} column in Access is +shown in the example below. + +Age categories can be specified as follows: +\itemize{ +\item Specific interval eg. every 5 years. Interval with odd numbers will use minimum age of 0 and maximum age is 85+, while even number uses maximum age of 80+. +\item Specified interval eg. 0-18, 19-44, 45-64, 65-79, 80+ +} +} +\examples{ +\dontrun{ +AgeCat(5) #Group age for every 5 years with min 0 and max 85+ +AgeCat(10) #Group age for every 10 years with min 0 and max 80+ +AgeCat(0, 19, 45, 65, 80) #Age group of 0-18, 19-44, 45-64, 65-79, 80+ +} +} +\seealso{ +Other extra arguments: +\code{\link{do_extra_args_group}()}, +\code{\link{do_extra_args}()}, +\code{\link{get_extra_args_group}()}, +\code{\link{get_extra_args}()} +} +\concept{extra arguments} diff --git a/man/get_extra_args.Rd b/man/get_extra_args.Rd index 882880b6..0fc1dd7d 100644 --- a/man/get_extra_args.Rd +++ b/man/get_extra_args.Rd @@ -25,6 +25,7 @@ in \code{CamelCase} style. Use comma to seperate multiple arguments. Other extra arguments: \code{\link{do_extra_args_group}()}, \code{\link{do_extra_args}()}, +\code{\link{find_age_category}()}, \code{\link{get_extra_args_group}()} } \concept{extra arguments} diff --git a/man/get_extra_args_group.Rd b/man/get_extra_args_group.Rd index da579262..07b23dc6 100644 --- a/man/get_extra_args_group.Rd +++ b/man/get_extra_args_group.Rd @@ -26,6 +26,7 @@ style. Use comma to seperate multiple arguments. Other extra arguments: \code{\link{do_extra_args_group}()}, \code{\link{do_extra_args}()}, +\code{\link{find_age_category}()}, \code{\link{get_extra_args}()} } \concept{extra arguments}