[{"path":"/articles/Simple REDCap workflow.html","id":"working-with-data-from-redcap","dir":"Articles","previous_headings":"","what":"Working with data from REDCap","title":"Simple REDCap workflow","text":"REDCap excellent tool clinical data acquisition storage. widely used world wide standard tool medical research data Denmark. case analysing data directly whole storing data REDCap, API functionality convenient secure, storing (possibly) sensitive data permanently computer. using “events” “repeated instruments” functionality REDCap, data storage format little confusing work , accustomed tidy data. library(REDCapR) provides simple way working data, however, package just exports data standard format.","code":""},{"path":"/articles/Simple REDCap workflow.html","id":"examples","dir":"Articles","previous_headings":"Working with data from REDCap","what":"Examples","title":"Simple REDCap workflow","text":"","code":"library(REDCapR) # Returns the variables \"record_id\" and \"age\". ds_some_vars <- redcap_read( redcap_uri = \"https://redcap.au.dk/api/\", # This is the address for projects at the AU-server token = \"YOUR_API_KEY_GOES_HERE\", fields = c(\"record_id\", \"age\") )$data # Return only records with IDs of 1 and 4 ds_some_rows <- redcap_read( redcap_uri = \"https://redcap.au.dk/api/\", # This is the address for projects at the AU-server token = \"YOUR_API_KEY_GOES_HERE\", records = c(1, 4) )$data"},{"path":"/articles/Toolbox.html","id":"a-toolbox","dir":"Articles","previous_headings":"","what":"A toolbox","title":"Toolbox","text":"toolbox small workshop mix old, worn, well proven tools newcomers. package seen something like . tried collect tools functions packages use regularly addition functions written fill use cases, able find solutions elsewhere.","code":""},{"path":"/articles/redcap.html","id":"working-with-data-from-redcap","dir":"Articles","previous_headings":"","what":"Working with data from REDCap","title":"Simple REDCap workflow","text":"REDCap excellent tool clinical data acquisition storage. widely used world wide standard tool medical research data Denmark. case analysing data directly whole storing data REDCap, API functionality convenient secure, storing (possibly) sensitive data permanently computer. using “events” “repeated instruments” functionality REDCap, data storage format little confusing work , accustomed tidy data. library(REDCapR) provides simple way working data, however, package just exports data standard format.","code":""},{"path":"/articles/redcap.html","id":"examples","dir":"Articles","previous_headings":"Working with data from REDCap","what":"Examples","title":"Simple REDCap workflow","text":"","code":"library(REDCapR) # Returns the variables \"record_id\" and \"age\". ds_some_vars <- redcap_read( redcap_uri = \"https://redcap.au.dk/api/\", # This is the address for projects at the AU-server token = \"YOUR_API_KEY_GOES_HERE\", fields = c(\"record_id\", \"age\") )$data # Return only records with IDs of 1 and 4 ds_some_rows <- redcap_read( redcap_uri = \"https://redcap.au.dk/api/\", # This is the address for projects at the AU-server token = \"YOUR_API_KEY_GOES_HERE\", records = c(1, 4) )$data"},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Andreas Gammelgaard Damsbo. Author, maintainer.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Damsbo (2023). stRoke: Clinical stroke research toolbox. https://agdamsbo.github.io/stRoke/, https://github.com/agdamsbo/stRoke, https://agdamsbo.github.io/neuRo-group/.","code":"@Manual{, title = {stRoke: Clinical stroke research toolbox}, author = {Andreas Gammelgaard Damsbo}, year = {2023}, note = {https://agdamsbo.github.io/stRoke/, https://github.com/agdamsbo/stRoke, https://agdamsbo.github.io/neuRo-group/}, }"},{"path":"/index.html","id":"stroke-package-","dir":"","previous_headings":"","what":"Clinical stroke research toolbox","title":"Clinical stroke research toolbox","text":"R-toolbox custom functions convenient data management analysis clinical health research teaching. package mainly collected personal use, use beyond encouraged. package migrated functions agdamsbo/daDoctoR-package, new functions added.","code":""},{"path":"/index.html","id":"a-few-notes","dir":"","previous_headings":"","what":"A few notes","title":"Clinical stroke research toolbox","text":"function generic_stroke()can used data(talos) custom data set illustrate classic analysis mRS outcome stroke trials. documenting testing package, used OpenAI’s chatgpt gpttools. chatgpt interesting tool, way perfect, helps tedious tasks. gpttools gptstudio interesting implementations R RStudio.","code":""},{"path":"/index.html","id":"source","dir":"","previous_headings":"","what":"Source","title":"Clinical stroke research toolbox","text":"package shared GitHub, welcome contribute opening issue pull request.","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Clinical stroke research toolbox","text":"package can installed GitHub:","code":"remotes::install_github(\"agdamsbo/stRoke\")"},{"path":"/reference/age_calc.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate age in years, months, or days — age_calc","title":"Calculate age in years, months, or days — age_calc","text":"Calculate age years, months, days","code":""},{"path":"/reference/age_calc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate age in years, months, or days — age_calc","text":"","code":"age_calc(dob, enddate = Sys.Date(), units = \"years\", precise = TRUE)"},{"path":"/reference/age_calc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate age in years, months, or days — age_calc","text":"dob Date birth enddate End date age calculation (default Sys.Date()) units Units age calculation (default \"years\"). Can c(\"days\", \"months\", \"years\") precise Option calculate age precisely (default TRUE)","code":""},{"path":"/reference/age_calc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate age in years, months, or days — age_calc","text":"numeric vector length 1","code":""},{"path":"/reference/age_calc.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate age in years, months, or days — age_calc","text":"Becker, J.P. (2020). eeptools: R Package Teaching Learning Ecology Evolutionary Biology. Journal Statistical Software, 93(2), 1-27. doi: 10.18637/jss.v093.i02","code":""},{"path":[]},{"path":"/reference/age_calc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate age in years, months, or days — age_calc","text":"","code":"age_calc(dob = as.Date(\"1995-04-25\"), enddate = as.Date(\"2020-04-25\"), units = \"years\") #> [1] 25 # Kim Larsen (cpr is known from album) dob<-as.Date(\"1945-10-23\") date<-as.Date(\"2018-09-30\") trunc(age_calc(dob,date)) #> [1] 72"},{"path":"/reference/ci_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Confidence interval plot with point estimate — ci_plot","title":"Confidence interval plot with point estimate — ci_plot","text":"Horizontal forest plot point estimate confidence intervals. Includes dichotomous olr, depending number levels \"x\". Title axis labels can added ggplot afterwards.","code":""},{"path":"/reference/ci_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Confidence interval plot with point estimate — ci_plot","text":"","code":"ci_plot(ds, x, y, vars = NULL, dec = 3, lbls = NULL, title = NULL)"},{"path":"/reference/ci_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Confidence interval plot with point estimate — ci_plot","text":"ds data set x text string main exposure variable y text string outcome variable vars variables multivariate analysis. dec Decimals labels lbls Labels variable names title Plot title. Can specified later.","code":""},{"path":"/reference/ci_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Confidence interval plot with point estimate — ci_plot","text":"ggplot element","code":""},{"path":"/reference/ci_plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Confidence interval plot with point estimate — ci_plot","text":"","code":"data(talos) talos[,\"mrs_1\"]<-factor(talos[,\"mrs_1\"],ordered=TRUE) ci_plot(ds = talos, x = \"rtreat\", y = \"mrs_1\", vars = c(\"hypertension\",\"diabetes\")) #> Waiting for profiling to be done..."},{"path":"/reference/cpr_check.html","id":null,"dir":"Reference","previous_headings":"","what":"CPR check — cpr_check","title":"CPR check — cpr_check","text":"Checking validity cpr number. Vectorised.","code":""},{"path":"/reference/cpr_check.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CPR check — cpr_check","text":"","code":"cpr_check(cpr)"},{"path":"/reference/cpr_check.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CPR check — cpr_check","text":"cpr cpr-numbers ddmmyy\"-.\"xxxx ddmmyyxxxx. Also mixed formatting. Vector data frame column.","code":""},{"path":"/reference/cpr_check.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CPR check — cpr_check","text":"Logical vector cpr validity","code":""},{"path":"/reference/cpr_check.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"CPR check — cpr_check","text":"","code":"fsd<-c(\"2310450637\", \"010190-2000\", \"010115-4000\",\"300450-1030\",\"010150-4021\") cpr_check(\"2310450637\") #> OBS: according to new description, not all valid CPR numbers apply to this modulus 11 rule. #> Please refer to: https://cpr.dk/media/12066/personnummeret-i-cpr.pdf #> [1] TRUE cpr_check(fsd) #> OBS: according to new description, not all valid CPR numbers apply to this modulus 11 rule. #> Please refer to: https://cpr.dk/media/12066/personnummeret-i-cpr.pdf #> [1] TRUE FALSE FALSE FALSE FALSE all(cpr_check(fsd)) #> OBS: according to new description, not all valid CPR numbers apply to this modulus 11 rule. #> Please refer to: https://cpr.dk/media/12066/personnummeret-i-cpr.pdf #> [1] FALSE"},{"path":"/reference/cpr_dob.html","id":null,"dir":"Reference","previous_headings":"","what":"Extracting date of birth from CPR — cpr_dob","title":"Extracting date of birth from CPR — cpr_dob","text":"easy calculation. handle cprs letters (interim cpr)","code":""},{"path":"/reference/cpr_dob.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extracting date of birth from CPR — cpr_dob","text":"","code":"cpr_dob(cpr)"},{"path":"/reference/cpr_dob.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extracting date of birth from CPR — cpr_dob","text":"cpr cpr-numbers ddmmyy\"-.\"xxxx ddmmyyxxxx. Also mixed formatting. Vector data frame column.","code":""},{"path":"/reference/cpr_dob.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extracting date of birth from CPR — cpr_dob","text":"vector Date elements. Format yyyy-mm-dd","code":""},{"path":"/reference/cpr_dob.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extracting date of birth from CPR — cpr_dob","text":"","code":"cpr_dob(\"231045-0637\") #> [1] \"1945-10-23\" fsd<-c(\"2310450637\", \"010190-2000\", \"010115-4000\",\"300450-1030\",\"010150-4021\") cpr_dob(fsd) #> [1] \"1945-10-23\" \"1990-01-01\" \"2015-01-01\" \"1950-04-30\" \"1950-01-01\""},{"path":"/reference/cpr_female.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine female sex from CPR — cpr_female","title":"Determine female sex from CPR — cpr_female","text":"Just checking last number string equal .","code":""},{"path":"/reference/cpr_female.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine female sex from CPR — cpr_female","text":"","code":"cpr_female(cpr)"},{"path":"/reference/cpr_female.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine female sex from CPR — cpr_female","text":"cpr Vector. cpr-numbers ddmmyy\"-.\"xxxx ddmmyyxxxx. Also mixed formatting. Vector data frame column.","code":""},{"path":"/reference/cpr_female.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine female sex from CPR — cpr_female","text":"Logical vector","code":""},{"path":"/reference/cpr_female.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Determine female sex from CPR — cpr_female","text":"","code":"cpr_female(stRoke::cprs[,1]) #> [1] FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE TRUE FALSE FALSE #> [13] TRUE TRUE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE FALSE TRUE #> [25] TRUE TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE #> [37] TRUE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE TRUE TRUE #> [49] FALSE TRUE FALSE FALSE TRUE FALSE FALSE TRUE TRUE TRUE FALSE FALSE #> [61] FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE #> [73] TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE TRUE TRUE TRUE #> [85] TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE #> [97] TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE TRUE FALSE TRUE #> [109] TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE #> [121] TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE FALSE #> [133] FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE TRUE FALSE FALSE #> [145] TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE #> [157] TRUE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE #> [169] TRUE TRUE FALSE FALSE FALSE TRUE FALSE FALSE TRUE TRUE TRUE TRUE #> [181] FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE FALSE TRUE FALSE #> [193] TRUE TRUE TRUE TRUE FALSE FALSE FALSE TRUE"},{"path":"/reference/cprs.html","id":null,"dir":"Reference","previous_headings":"","what":"Data frame of 200 cpr numbers — cprs","title":"Data frame of 200 cpr numbers — cprs","text":"just repeated sample 8 synthesized cpr-numbers testing purposes.","code":""},{"path":"/reference/cprs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Data frame of 200 cpr numbers — cprs","text":"","code":"data(cprs)"},{"path":"/reference/cprs.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Data frame of 200 cpr numbers — cprs","text":"data frame 200 rows 1 variable: cpr Mixed format cpr-numbers, characters","code":""},{"path":"/reference/cprs.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Data frame of 200 cpr numbers — cprs","text":"https://da.wikipedia.org/wiki/231045-0637/","code":""},{"path":"/reference/generic_stroke.html","id":null,"dir":"Reference","previous_headings":"","what":"Generic stroke study outcome — generic_stroke","title":"Generic stroke study outcome — generic_stroke","text":"Includes table 1, grotta bars ordinal logistic regression plot. Please just use function illustration purposes. dos: modify grottaBar include function.","code":""},{"path":"/reference/generic_stroke.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generic stroke study outcome — generic_stroke","text":"","code":"generic_stroke(df, group, score, strata = NULL, variables = NULL)"},{"path":"/reference/generic_stroke.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generic stroke study outcome — generic_stroke","text":"df Data set data frame group Variable group score Outcome measure variable strata Optional variable stratify variables String variable names include adjusted OLR-analysis","code":""},{"path":"/reference/generic_stroke.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generic stroke study outcome — generic_stroke","text":"Returns list three elements","code":""},{"path":"/reference/generic_stroke.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generic stroke study outcome — generic_stroke","text":"","code":"generic_stroke(stRoke::talos, \"rtreat\", \"mrs_6\", variables = c(\"hypertension\",\"diabetes\",\"civil\")) #> Waiting for profiling to be done... #> $`Table 1` #>
#>