stRoke/docs/search.json
2023-04-13 07:57:37 +02:00

2 lines
99 KiB
JSON
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[{"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. documenting testing package, used OpenAIs chatgpt gpttools. chatgpt interesting tool, way perfect, helps tedious tasks. gpttools gptstudio interesting implementations R RStudio.","code":""},{"path":"/articles/Toolbox.html","id":"cpr-intro","dir":"Articles","previous_headings":"A toolbox","what":"CPR manipulations","title":"Toolbox","text":"Note , handled, CPR numbers (social security numbers) handled care considered highly sensitive data. CPR number structured DDMMYY-XXXX, 1st X designating decade birth, last X designate binary gender (biological sex) dependent even/uneven female/male, last digits used modulus calculation verify validity CPR number. Foreigners unidentified persons given temporary CPR numbers including letters. information can found cpr.dk. Note, CPR numbers used examples publicly known non-organic.","code":""},{"path":"/articles/Toolbox.html","id":"age_calc","dir":"Articles","previous_headings":"A toolbox > CPR manipulations","what":"age_calc()","title":"Toolbox","text":"age_calc() function created learning exercise functions similarly lubridate::time_length().","code":"(age <- age_calc(as.Date(\"1945-10-23\"), as.Date(\"2018-09-30\"))) #> [1] 72.93699 trunc(age) #> [1] 72"},{"path":"/articles/Toolbox.html","id":"cpr_check","dir":"Articles","previous_headings":"A toolbox > CPR manipulations","what":"cpr_check()","title":"Toolbox","text":"Checks validity CPR numbers according modulus 11 rule. Note due limitations possible available CPR numbers, rule apply CPR numbers 2007. Including CPR numbers letters gives warning NA, can checked modulus 11 function. used care, see message.","code":"cpr_check( c( \"2310450637\", \"010190-2000\", \"010115-4000\", \"300450-1030\", \"010150-4021\", \"010150-4AA1\" ) ) #> OBS: as per 2007 not all valid CPR numbers apply to modulus 11 rule. #> #> See the vignette 'Toolbox' #> Warning in matrix(as.numeric(unlist(strsplit(cpr_short, \"\"))), nrow = 10): NAs #> introduced by coercion #> [1] TRUE FALSE FALSE FALSE FALSE NA"},{"path":"/articles/Toolbox.html","id":"cpr_dob","dir":"Articles","previous_headings":"A toolbox > CPR manipulations","what":"cpr_dob()","title":"Toolbox","text":"Extracts date birth (DOB) CPR number. Accounts decade birth. See earlier.","code":"cpr_dob(c( \"2310450637\", \"010190-2000\", \"010115-4000\", \"300450-1030\", \"010150-4021\" )) #> [1] \"23-10-1945\" \"01-01-1990\" \"01-01-2015\" \"30-04-1950\" \"01-01-1950\""},{"path":"/articles/Toolbox.html","id":"cpr_female","dir":"Articles","previous_headings":"A toolbox > CPR manipulations","what":"cpr_female()","title":"Toolbox","text":"Gives logical vector whether female gender last digit CPR.","code":"table(cpr_female(stRoke::cprs[, 1])) #> #> FALSE TRUE #> 98 102"},{"path":[]},{"path":"/articles/Toolbox.html","id":"ci_plot","dir":"Articles","previous_headings":"A toolbox > Plotting","what":"ci_plot()","title":"Toolbox","text":"Plots odds ratios 95 % confidence intervals. Performs binary logistic regression outcome factors two (2) levels ordinal logistic regression outcome factors two levels. Mind relevant assumptions. Outputs ggplot element manipulation.","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":"/articles/Toolbox.html","id":"generic_stroke","dir":"Articles","previous_headings":"A toolbox > Plotting","what":"generic_stroke()","title":"Toolbox","text":"learning purposes. Uses annonymized data TALOS trial output Table 1 (gtsummary::tbl_summary()), plotting -called grotta-bars based mRS scores (rankinPlot::grottaBar()) ordinal logistic regression model plot (stRoke::ci_plot()).","code":"generic_stroke(stRoke::talos, \"rtreat\", \"mrs_6\", variables = c(\"hypertension\", \"diabetes\", \"civil\")) #> Waiting for profiling to be done... #> $`Table 1` #> <div id=\"zlonxkjxpy\" style=\"padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;\"> #> <style>html { #> font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif; #> } #> #> #zlonxkjxpy .gt_table { #> display: table; #> border-collapse: collapse; #> margin-left: auto; #> margin-right: auto; #> color: #333333; #> font-size: 16px; #> font-weight: normal; #> font-style: normal; #> background-color: #FFFFFF; #> width: auto; #> border-top-style: solid; #> border-top-width: 2px; #> border-top-color: #A8A8A8; #> border-right-style: none; #> border-right-width: 2px; #> border-right-color: #D3D3D3; #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #A8A8A8; #> border-left-style: none; #> border-left-width: 2px; #> border-left-color: #D3D3D3; #> } #> #> #zlonxkjxpy .gt_heading { #> background-color: #FFFFFF; #> text-align: center; #> border-bottom-color: #FFFFFF; #> border-left-style: none; #> border-left-width: 1px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 1px; #> border-right-color: #D3D3D3; #> } #> #> #zlonxkjxpy .gt_caption { #> padding-top: 4px; #> padding-bottom: 4px; #> } #> #> #zlonxkjxpy .gt_title { #> color: #333333; #> font-size: 125%; #> font-weight: initial; #> padding-top: 4px; #> padding-bottom: 4px; #> padding-left: 5px; #> padding-right: 5px; #> border-bottom-color: #FFFFFF; #> border-bottom-width: 0; #> } #> #> #zlonxkjxpy .gt_subtitle { #> color: #333333; #> font-size: 85%; #> font-weight: initial; #> padding-top: 0; #> padding-bottom: 6px; #> padding-left: 5px; #> padding-right: 5px; #> border-top-color: #FFFFFF; #> border-top-width: 0; #> } #> #> #zlonxkjxpy .gt_bottom_border { #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> } #> #> #zlonxkjxpy .gt_col_headings { #> border-top-style: solid; #> border-top-width: 2px; #> border-top-color: #D3D3D3; #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> border-left-style: none; #> border-left-width: 1px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 1px; #> border-right-color: #D3D3D3; #> } #> #> #zlonxkjxpy .gt_col_heading { #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; #> font-weight: normal; #> text-transform: inherit; #> border-left-style: none; #> border-left-width: 1px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 1px; #> border-right-color: #D3D3D3; #> vertical-align: bottom; #> padding-top: 5px; #> padding-bottom: 6px; #> padding-left: 5px; #> padding-right: 5px; #> overflow-x: hidden; #> } #> #> #zlonxkjxpy .gt_column_spanner_outer { #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; #> font-weight: normal; #> text-transform: inherit; #> padding-top: 0; #> padding-bottom: 0; #> padding-left: 4px; #> padding-right: 4px; #> } #> #> #zlonxkjxpy .gt_column_spanner_outer:first-child { #> padding-left: 0; #> } #> #> #zlonxkjxpy .gt_column_spanner_outer:last-child { #> padding-right: 0; #> } #> #> #zlonxkjxpy .gt_column_spanner { #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> vertical-align: bottom; #> padding-top: 5px; #> padding-bottom: 5px; #> overflow-x: hidden; #> display: inline-block; #> width: 100%; #> } #> #> #zlonxkjxpy .gt_group_heading { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; #> font-weight: initial; #> text-transform: inherit; #> border-top-style: solid; #> border-top-width: 2px; #> border-top-color: #D3D3D3; #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> border-left-style: none; #> border-left-width: 1px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 1px; #> border-right-color: #D3D3D3; #> vertical-align: middle; #> text-align: left; #> } #> #> #zlonxkjxpy .gt_empty_group_heading { #> padding: 0.5px; #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; #> font-weight: initial; #> border-top-style: solid; #> border-top-width: 2px; #> border-top-color: #D3D3D3; #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> vertical-align: middle; #> } #> #> #zlonxkjxpy .gt_from_md > :first-child { #> margin-top: 0; #> } #> #> #zlonxkjxpy .gt_from_md > :last-child { #> margin-bottom: 0; #> } #> #> #zlonxkjxpy .gt_row { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> margin: 10px; #> border-top-style: solid; #> border-top-width: 1px; #> border-top-color: #D3D3D3; #> border-left-style: none; #> border-left-width: 1px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 1px; #> border-right-color: #D3D3D3; #> vertical-align: middle; #> overflow-x: hidden; #> } #> #> #zlonxkjxpy .gt_stub { #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; #> font-weight: initial; #> text-transform: inherit; #> border-right-style: solid; #> border-right-width: 2px; #> border-right-color: #D3D3D3; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #zlonxkjxpy .gt_stub_row_group { #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; #> font-weight: initial; #> text-transform: inherit; #> border-right-style: solid; #> border-right-width: 2px; #> border-right-color: #D3D3D3; #> padding-left: 5px; #> padding-right: 5px; #> vertical-align: top; #> } #> #> #zlonxkjxpy .gt_row_group_first td { #> border-top-width: 2px; #> } #> #> #zlonxkjxpy .gt_summary_row { #> color: #333333; #> background-color: #FFFFFF; #> text-transform: inherit; #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #zlonxkjxpy .gt_first_summary_row { #> border-top-style: solid; #> border-top-color: #D3D3D3; #> } #> #> #zlonxkjxpy .gt_first_summary_row.thick { #> border-top-width: 2px; #> } #> #> #zlonxkjxpy .gt_last_summary_row { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> } #> #> #zlonxkjxpy .gt_grand_summary_row { #> color: #333333; #> background-color: #FFFFFF; #> text-transform: inherit; #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #zlonxkjxpy .gt_first_grand_summary_row { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> border-top-style: double; #> border-top-width: 6px; #> border-top-color: #D3D3D3; #> } #> #> #zlonxkjxpy .gt_striped { #> background-color: rgba(128, 128, 128, 0.05); #> } #> #> #zlonxkjxpy .gt_table_body { #> border-top-style: solid; #> border-top-width: 2px; #> border-top-color: #D3D3D3; #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> } #> #> #zlonxkjxpy .gt_footnotes { #> color: #333333; #> background-color: #FFFFFF; #> border-bottom-style: none; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> border-left-style: none; #> border-left-width: 2px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 2px; #> border-right-color: #D3D3D3; #> } #> #> #zlonxkjxpy .gt_footnote { #> margin: 0px; #> font-size: 90%; #> padding-left: 4px; #> padding-right: 4px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #zlonxkjxpy .gt_sourcenotes { #> color: #333333; #> background-color: #FFFFFF; #> border-bottom-style: none; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> border-left-style: none; #> border-left-width: 2px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 2px; #> border-right-color: #D3D3D3; #> } #> #> #zlonxkjxpy .gt_sourcenote { #> font-size: 90%; #> padding-top: 4px; #> padding-bottom: 4px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #zlonxkjxpy .gt_left { #> text-align: left; #> } #> #> #zlonxkjxpy .gt_center { #> text-align: center; #> } #> #> #zlonxkjxpy .gt_right { #> text-align: right; #> font-variant-numeric: tabular-nums; #> } #> #> #zlonxkjxpy .gt_font_normal { #> font-weight: normal; #> } #> #> #zlonxkjxpy .gt_font_bold { #> font-weight: bold; #> } #> #> #zlonxkjxpy .gt_font_italic { #> font-style: italic; #> } #> #> #zlonxkjxpy .gt_super { #> font-size: 65%; #> } #> #> #zlonxkjxpy .gt_footnote_marks { #> font-style: italic; #> font-weight: normal; #> font-size: 75%; #> vertical-align: 0.4em; #> } #> #> #zlonxkjxpy .gt_asterisk { #> font-size: 100%; #> vertical-align: 0; #> } #> #> #zlonxkjxpy .gt_indent_1 { #> text-indent: 5px; #> } #> #> #zlonxkjxpy .gt_indent_2 { #> text-indent: 10px; #> } #> #> #zlonxkjxpy .gt_indent_3 { #> text-indent: 15px; #> } #> #> #zlonxkjxpy .gt_indent_4 { #> text-indent: 20px; #> } #> #> #zlonxkjxpy .gt_indent_5 { #> text-indent: 25px; #> } #> <\/style> #> <table class=\"gt_table\"> #> #> <thead class=\"gt_col_headings\"> #> <tr> #> <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"&lt;strong&gt;Characteristic&lt;/strong&gt;\"><strong>Characteristic<\/strong><\/th> #> <th class=\"gt_col_heading gt_columns_bottom_border gt_center\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"&lt;strong&gt;Overall&lt;/strong&gt;, N = 200&lt;sup class=&quot;gt_footnote_marks&quot;&gt;1&lt;/sup&gt;\"><strong>Overall<\/strong>, N = 200<sup class=\"gt_footnote_marks\">1<\/sup><\/th> #> <th class=\"gt_col_heading gt_columns_bottom_border gt_center\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"&lt;strong&gt;Active&lt;/strong&gt;, N = 79&lt;sup class=&quot;gt_footnote_marks&quot;&gt;1&lt;/sup&gt;\"><strong>Active<\/strong>, N = 79<sup class=\"gt_footnote_marks\">1<\/sup><\/th> #> <th class=\"gt_col_heading gt_columns_bottom_border gt_center\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"&lt;strong&gt;Placebo&lt;/strong&gt;, N = 121&lt;sup class=&quot;gt_footnote_marks&quot;&gt;1&lt;/sup&gt;\"><strong>Placebo<\/strong>, N = 121<sup class=\"gt_footnote_marks\">1<\/sup><\/th> #> <\/tr> #> <\/thead> #> <tbody class=\"gt_table_body\"> #> <tr><td headers=\"label\" class=\"gt_row gt_left\">hypertension<\/td> #> <td headers=\"stat_0\" class=\"gt_row gt_center\">101 (50%)<\/td> #> <td headers=\"stat_1\" class=\"gt_row gt_center\">38 (48%)<\/td> #> <td headers=\"stat_2\" class=\"gt_row gt_center\">63 (52%)<\/td><\/tr> #> <tr><td headers=\"label\" class=\"gt_row gt_left\">diabetes<\/td> #> <td headers=\"stat_0\" class=\"gt_row gt_center\">23 (12%)<\/td> #> <td headers=\"stat_1\" class=\"gt_row gt_center\">9 (11%)<\/td> #> <td headers=\"stat_2\" class=\"gt_row gt_center\">14 (12%)<\/td><\/tr> #> <tr><td headers=\"label\" class=\"gt_row gt_left\">civil<\/td> #> <td headers=\"stat_0\" class=\"gt_row gt_center\"><\/td> #> <td headers=\"stat_1\" class=\"gt_row gt_center\"><\/td> #> <td headers=\"stat_2\" class=\"gt_row gt_center\"><\/td><\/tr> #> <tr><td headers=\"label\" class=\"gt_row gt_left\">    alone<\/td> #> <td headers=\"stat_0\" class=\"gt_row gt_center\">59 (30%)<\/td> #> <td headers=\"stat_1\" class=\"gt_row gt_center\">22 (28%)<\/td> #> <td headers=\"stat_2\" class=\"gt_row gt_center\">37 (31%)<\/td><\/tr> #> <tr><td headers=\"label\" class=\"gt_row gt_left\">    partner<\/td> #> <td headers=\"stat_0\" class=\"gt_row gt_center\">141 (70%)<\/td> #> <td headers=\"stat_1\" class=\"gt_row gt_center\">57 (72%)<\/td> #> <td headers=\"stat_2\" class=\"gt_row gt_center\">84 (69%)<\/td><\/tr> #> <\/tbody> #> #> <tfoot class=\"gt_footnotes\"> #> <tr> #> <td class=\"gt_footnote\" colspan=\"4\"><sup class=\"gt_footnote_marks\">1<\/sup> n (%)<\/td> #> <\/tr> #> <\/tfoot> #> <\/table> #> <\/div> #> #> $`Figure 1` #> #> $`Figure 2`"},{"path":"/articles/Toolbox.html","id":"index_plot","dir":"Articles","previous_headings":"A toolbox > Plotting","what":"index_plot()","title":"Toolbox","text":"Used plotting scores multi dimensional patient test.","code":"index_plot(stRoke::score[score$event == \"A\", ])"},{"path":"/articles/Toolbox.html","id":"win_prob","dir":"Articles","previous_headings":"A toolbox > Plotting","what":"win_prob()","title":"Toolbox","text":"win_prob() implementation Tournament Method calculating probability winning suggested Zou et al 2022. authors included spreadsheet supplementary materials. function aims mimic functionality. function also includes print() extension nice printing.","code":"win_prob( data = stRoke::talos, response = \"mrs_6\", group = \"rtreat\", sample.size = TRUE, print.tables = TRUE ) #> $list_cum #> $list_cum$Active #> mrs_6 rtreat Freq prop overall_rank rank win_frac #> 1 0 Active 14 0.17721519 175.0 72.5 0.847107438 #> 2 1 Active 29 0.36708861 113.5 51.0 0.516528926 #> 3 2 Active 22 0.27848101 49.0 25.5 0.194214876 #> 4 3 Active 9 0.11392405 15.0 10.0 0.041322314 #> 5 4 Active 3 0.03797468 7.0 4.0 0.024793388 #> 6 6 Active 2 0.02531646 2.5 1.5 0.008264463 #> #> $list_cum$Placebo #> mrs_6 rtreat Freq prop overall_rank rank win_frac #> 7 0 Placebo 37 0.30578512 175.0 103.0 0.91139241 #> 8 1 Placebo 43 0.35537190 113.5 63.0 0.63924051 #> 9 2 Placebo 35 0.28925620 49.0 24.0 0.31645570 #> 10 3 Placebo 2 0.01652893 15.0 5.5 0.12025316 #> 11 4 Placebo 2 0.01652893 7.0 3.5 0.04430380 #> 12 6 Placebo 2 0.01652893 2.5 1.5 0.01265823 #> #> #> $group_levels #> [1] \"Active\" \"Placebo\" #> #> $sum_a #> [1] 79 #> #> $sum_b #> [1] 121 #> #> $winP_a #> [1] 0.3996757 #> #> $winP_b #> [1] 0.6003243 #> #> $var_win_frac_a #> [1] 0.07609113 #> #> $var_win_frac_b #> [1] 0.06806341 #> #> $var_win_prob #> [1] 0.001525686 #> #> $se_win_prob #> [1] 0.03906004 #> #> $conf.int #> [1] 0.6124886 0.3724300 #> #> $test_stat #> [1] 2.498962 #> #> $p_val #> [1] 0.01245577 #> #> $nnt #> [1] -9.967675 #> #> $ss_n #> [1] 238 #> #> $param.record #> $param.record$data #> rtreat mrs_1 mrs_6 hypertension diabetes civil #> 38 Active 1 1 no no partner #> 434 Active 1 1 yes no partner #> 588 Active 2 2 yes no partner #> 42 Active 0 0 yes no partner #> 160 Placebo 1 1 yes no partner #> 174 Active 0 1 yes no alone #> 11 Placebo 2 1 yes yes alone #> 601 Placebo 1 1 no no partner #> 412 Active 0 0 yes no partner #> 88 Placebo 1 1 yes yes partner #> 56 Placebo 0 0 no no alone #> 235 Placebo 2 1 yes yes alone #> 205 Active 3 3 no no partner #> 62 Active 2 2 yes no alone #> 593 Placebo 2 2 no no alone #> 143 Active 2 1 yes no partner #> 520 Active 2 2 no yes partner #> 144 Placebo 1 0 yes no partner #> 383 Active 2 3 no no alone #> 347 Placebo 1 0 yes yes partner #> 346 Active 1 2 yes no partner #> 318 Placebo 2 2 no no partner #> 231 Placebo 2 2 no no partner #> 190 Active 1 1 yes no partner #> 287 Placebo 2 2 yes no partner #> 633 Placebo 1 1 no no partner #> 228 Placebo 4 3 yes no partner #> 409 Active 1 2 yes no partner #> 603 Placebo 2 1 no no alone #> 628 Placebo 1 2 no no partner #> 91 Active 1 0 yes no partner #> 537 Placebo 4 4 no no partner #> 75 Placebo 1 2 yes no partner #> 282 Placebo 1 0 no no partner #> 249 Active 1 1 no no alone #> 72 Active 2 3 yes no partner #> 222 Active 2 2 yes no partner #> 258 Placebo 0 1 no no partner #> 134 Active 4 4 no no partner #> 117 Active 1 1 no yes partner #> 377 Active 2 1 no no partner #> 583 Placebo 3 2 yes no partner #> 552 Active 3 1 yes no alone #> 124 Placebo 2 2 yes yes partner #> 189 Placebo 1 0 no yes partner #> 521 Placebo 1 2 yes yes alone #> 429 Active 2 1 no no partner #> 203 Placebo 1 1 yes no partner #> 172 Active 1 2 no no partner #> 402 Placebo 2 2 yes no partner #> 574 Placebo 1 1 yes no partner #> 271 Active 4 3 no no partner #> 50 Placebo 3 2 no no alone #> 264 Active 4 2 no no alone #> 571 Active 2 0 yes no partner #> 239 Active 3 3 yes no alone #> 262 Placebo 2 1 yes no partner #> 236 Placebo 1 1 no no partner #> 94 Placebo 1 1 no no partner #> 275 Placebo 0 0 no no partner #> 26 Placebo 2 4 no no alone #> 476 Placebo 1 1 no no alone #> 427 Active 2 3 yes no alone #> 359 Placebo 1 2 yes no alone #> 341 Active 4 3 yes no alone #> 457 Active 1 1 yes yes partner #> 485 Placebo 0 0 no no partner #> 171 Placebo 2 2 no no partner #> 97 Placebo 2 1 yes no partner #> 635 Placebo 1 2 no no alone #> 472 Placebo 1 0 yes no partner #> 408 Active 1 1 yes yes partner #> 158 Placebo 0 0 no no partner #> 63 Placebo 1 0 no yes alone #> 557 Active 2 2 no no partner #> 73 Active 1 1 yes no partner #> 425 Placebo 2 0 yes no partner #> 423 Placebo 2 2 yes yes partner #> 272 Active 2 1 yes no alone #> 122 Active 1 0 no no partner #> 370 Active 0 1 no no partner #> 274 Placebo 0 0 no no partner #> 407 Active 0 0 no no partner #> 482 Placebo 1 1 no no partner #> 586 Active 6 6 yes yes partner #> 20 Placebo 1 2 no no alone #> 568 Active 1 0 no no partner #> 331 Placebo 1 1 no no alone #> 133 Placebo 1 1 no no partner #> 563 Active 4 4 yes no partner #> 349 Placebo 1 2 yes yes alone #> 381 Placebo 1 1 yes no partner #> 549 Placebo 1 1 no no alone #> 34 Active 1 1 no no alone #> 33 Placebo 0 0 yes no alone #> 531 Placebo 2 2 yes no alone #> 389 Active 1 0 no no alone #> 64 Active 1 1 yes yes alone #> 428 Active 2 1 yes no partner #> 403 Placebo 2 2 yes no alone #> 343 Placebo 1 0 no no partner #> 294 Active 2 2 no no alone #> 76 Placebo 3 1 no no alone #> 166 Placebo 1 0 yes no partner #> 209 Placebo 0 1 yes no partner #> 626 Active 2 2 yes no alone #> 481 Active 5 3 no no partner #> 376 Active 2 2 yes yes partner #> 67 Active 3 2 no no partner #> 130 Placebo 2 1 no no partner #> 250 Active 2 1 yes no partner #> 609 Active 2 2 no no partner #> 545 Placebo 3 2 yes no partner #> 226 Placebo 2 1 no no partner #> 276 Placebo 1 2 no no partner #> 305 Placebo 0 0 yes no partner #> 202 Placebo 1 0 yes no alone #> 245 Placebo 1 1 no no partner #> 131 Active 3 1 no no partner #> 505 Active 2 1 no no partner #> 546 Placebo 2 2 yes no alone #> 639 Placebo 1 1 yes yes partner #> 219 Active 2 1 yes no partner #> 244 Placebo 2 2 yes no alone #> 348 Placebo 0 0 no no partner #> 280 Placebo 0 0 yes no partner #> 504 Placebo 2 2 yes no partner #> 51 Placebo 1 1 no no alone #> 493 Active 6 6 no no alone #> 167 Placebo 0 1 yes no partner #> 58 Placebo 1 0 no no partner #> 169 Active 0 0 no no partner #> 293 Active 1 0 no no partner #> 334 Placebo 6 6 no no partner #> 28 Active 2 2 yes no partner #> 1 Placebo 0 0 yes no partner #> 463 Active 2 1 yes no alone #> 445 Placebo 1 2 yes no alone #> 320 Placebo 1 2 yes yes alone #> 500 Placebo 0 0 no no alone #> 175 Placebo 1 2 yes no partner #> 201 Placebo 0 0 yes no partner #> 142 Active 2 0 no no partner #> 278 Active 0 1 yes no alone #> 181 Placebo 0 0 no no partner #> 193 Placebo 2 1 yes no alone #> 321 Active 2 0 no no partner #> 598 Active 0 1 no no partner #> 217 Placebo 0 0 yes no partner #> 13 Active 1 1 yes no partner #> 242 Placebo 2 0 yes no partner #> 513 Placebo 1 1 no no partner #> 518 Placebo 2 2 yes no partner #> 304 Placebo 2 2 no no partner #> 587 Placebo 1 2 no no alone #> 497 Placebo 0 1 yes no partner #> 296 Placebo 0 0 yes no partner #> 526 Active 1 1 no no partner #> 2 Placebo 2 1 no no partner #> 627 Active 2 2 no yes partner #> 126 Placebo 2 1 yes no partner #> 420 Placebo 2 0 yes no partner #> 392 Active 2 2 yes no partner #> 522 Placebo 3 2 yes no alone #> 312 Active 4 4 no yes partner #> 9 Placebo 1 1 no no partner #> 29 Placebo 2 2 no no alone #> 7 Placebo 1 1 yes no partner #> 49 Placebo 2 1 no yes partner #> 439 Placebo 3 2 no no alone #> 46 Active 0 0 yes no alone #> 80 Active 1 1 no no partner #> 237 Placebo 0 0 yes no partner #> 306 Placebo 2 0 no no alone #> 345 Placebo 0 0 yes no partner #> 153 Active 2 2 no no partner #> 98 Placebo 1 0 yes no partner #> 44 Placebo 2 1 yes no partner #> 458 Active 3 2 no no partner #> 585 Placebo 1 1 yes no partner #> 211 Placebo 3 2 no yes partner #> 610 Active 1 1 no no alone #> 310 Placebo 0 0 no no alone #> 541 Active 4 2 yes no partner #> 161 Placebo 1 1 no no partner #> 641 Placebo 1 1 no no partner #> 538 Placebo 1 1 no no partner #> 281 Placebo 1 0 no no partner #> 301 Active 3 2 yes no partner #> 356 Active 3 2 no no alone #> 59 Active 3 3 no no alone #> 302 Placebo 1 0 yes no partner #> 116 Active 1 0 no no partner #> 547 Placebo 2 2 no no partner #> 22 Placebo 2 1 no no partner #> 517 Placebo 4 3 yes no partner #> 344 Placebo 1 1 yes no partner #> 48 Placebo 2 0 yes no alone #> 100 Placebo 1 0 yes no alone #> 93 Placebo 6 6 yes no alone #> #> $param.record$response #> [1] \"mrs_6\" #> #> $param.record$group #> [1] \"rtreat\" #> #> $param.record$alpha #> [1] 0.05 #> #> $param.record$beta #> [1] 0.2 #> #> $param.record$group.ratio #> [1] 1 #> #> $param.record$sample.size #> [1] TRUE #> #> $param.record$print.tables #> [1] TRUE #> #> $param.record$dec #> [1] 3 #> #> #> attr(,\"class\") #> [1] \"win_Prop\" \"list\""},{"path":"/articles/ds2dd.html","id":"easy-data-set-to-data-base-workflow","dir":"Articles","previous_headings":"","what":"Easy data set to data base workflow","title":"ds2dd","text":"function can used simple tool creating data base metadata file REDCap (called DataDictionary) based given data set file.","code":""},{"path":"/articles/ds2dd.html","id":"step-1---load-your-data-set","dir":"Articles","previous_headings":"Easy data set to data base workflow","what":"Step 1 - Load your data set","title":"ds2dd","text":"ll use sample TALOS dataset included package.","code":"data(\"talos\") ds <- talos # As the data set lacks an ID column, one is added ds$id <- seq_len(nrow(ds))"},{"path":"/articles/ds2dd.html","id":"step-2---create-the-datadictionary","dir":"Articles","previous_headings":"Easy data set to data base workflow","what":"Step 2 - Create the DataDictionary","title":"ds2dd","text":"Now additional specifications DataDictionary can made manually, can uploaded modified manually graphical user interface web page. function transform column names lower case substitute spaces underscores. output list DataDictionary vector new column names dataset fit meta data.","code":"datadictionary <- ds2dd(ds,record.id = \"id\",include.column.names = TRUE)"},{"path":"/articles/ds2dd.html","id":"step-3---meta-data-upload","dir":"Articles","previous_headings":"Easy data set to data base workflow","what":"Step 3 - Meta data upload","title":"ds2dd","text":"Now DataDictionary can exported spreadsheet uploaded can uploaded using REDCapR package (projects “Development” status). Use one two approaches :","code":""},{"path":"/articles/ds2dd.html","id":"manual-upload","dir":"Articles","previous_headings":"Easy data set to data base workflow > Step 3 - Meta data upload","what":"Manual upload","title":"ds2dd","text":"","code":"write.csv(datadictionary$DataDictionary,\"datadictionary.csv\")"},{"path":"/articles/ds2dd.html","id":"upload-with-redcapr","dir":"Articles","previous_headings":"Easy data set to data base workflow > Step 3 - Meta data upload","what":"Upload with REDCapR","title":"ds2dd","text":"“REDCap R Handbook” written interfacing REDCap R using library(keyring)store credentials chapter 1.1.","code":"REDCapR::redcap_metadata_write( datadictionary$DataDictionary, redcap_uri = keyring::key_get(\"DB_URI\"), token = keyring::key_get(\"DB_TOKEN\") )"},{"path":"/articles/ds2dd.html","id":"step-4---data-upload","dir":"Articles","previous_headings":"Easy data set to data base workflow","what":"Step 4 - Data upload","title":"ds2dd","text":"two options available data upload meta data upload: manual og REDCapR. latter shown .","code":"# new column nams are applied colnames(ds) <- datadictionary$`Column names` REDCapR::redcap_write( ds, redcap_uri = keyring::key_get(\"DB_URI\"), token = keyring::key_get(\"DB_TOKEN\") )"},{"path":"/articles/redcap.html","id":"initial-note","dir":"Articles","previous_headings":"","what":"Initial note","title":"Simple REDCap workflow","text":"Please refer book “neuRo-group” thorough guide using R REDCap together data analysis, also notes advices build REDCap database. Note, book work progress goal “completion”.","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":"added","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. https://agdamsbo.github.io/stRoke/, https://github.com/agdamsbo/stRoke.","code":"@Manual{, title = {stRoke: Clinical Stroke Research}, author = {Andreas Gammelgaard Damsbo}, year = {2023}, note = {https://agdamsbo.github.io/stRoke/, https://github.com/agdamsbo/stRoke}, }"},{"path":"/index.html","id":"stroke-package-","dir":"","previous_headings":"","what":"Clinical Stroke Research","title":"Clinical Stroke Research","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":"contribute","dir":"","previous_headings":"","what":"Contribute","title":"Clinical Stroke Research","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","text":"package can installed directly CRAN: latest version development can installed GitHub:","code":"install.packages(\"stRoke\") 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":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Calculate age in years, months, or days — age_calc","text":"doi:10.18637/jss.v093.i02","code":""},{"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.","code":""},{"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":"trunc(age_calc(as.Date(\"1945-10-23\"),as.Date(\"2018-09-30\"))) #> [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 = NULL, y = NULL, vars = NULL, dec = 3, lbls = NULL, title = NULL, method = \"auto\" )"},{"path":"/reference/ci_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Confidence interval plot with point estimate — ci_plot","text":"ds main input, either data set logistic model 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. method Character vector. method regression. Can c(\"auto\", \"model\").","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":"# Auto plot 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... ## Model plot # iris$ord<-factor(sample(1:3,size=nrow(iris),replace=TRUE),ordered=TRUE) # lm <- MASS::polr(ord~., data=iris, Hess=TRUE, method=\"logistic\") # ci_plot(ds = lm, method=\"model\")"},{"path":"/reference/contrast_text.html","id":null,"dir":"Reference","previous_headings":"","what":"Contrast Text Color — contrast_text","title":"Contrast Text Color — contrast_text","text":"Calculates best contrast text color given background color.","code":""},{"path":"/reference/contrast_text.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Contrast Text Color — contrast_text","text":"","code":"contrast_text( background, light_text = \"white\", dark_text = \"black\", threshold = 0.5, method = \"perceived_2\" )"},{"path":"/reference/contrast_text.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Contrast Text Color — contrast_text","text":"background hex/named color value represents background. light_text hex/named color value represents light text color. dark_text hex/named color value represents dark text color. threshold numeric value 0 1 used determine luminance threshold background color text color. method character string specifies method calculating luminance. Three different methods available: c(\"relative\",\"perceived\",\"perceived_2\")","code":""},{"path":"/reference/contrast_text.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Contrast Text Color — contrast_text","text":"character string contains best contrast text color.","code":""},{"path":"/reference/contrast_text.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Contrast Text Color — contrast_text","text":"function aids deciding font color print given background. function based example provided teppo: https://stackoverflow.com//66669838/21019325. different methods provided based methods outlined StackOverflow thread: https://stackoverflow.com/questions/596216/formula--determine-perceived-brightness--rgb-color","code":""},{"path":"/reference/contrast_text.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Contrast Text Color — contrast_text","text":"","code":"contrast_text(c(\"#F2F2F2\", \"blue\")) #> [1] \"black\" \"white\" contrast_text(c(\"#F2F2F2\", \"blue\"), method=\"relative\") #> [1] \"black\" \"white\""},{"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: as per 2007 not all valid CPR numbers apply to modulus 11 rule. #> #> See the vignette 'Toolbox' #> [1] TRUE cpr_check(fsd) #> OBS: as per 2007 not all valid CPR numbers apply to modulus 11 rule. #> #> See the vignette 'Toolbox' #> [1] TRUE FALSE FALSE FALSE FALSE all(cpr_check(fsd)) #> OBS: as per 2007 not all valid CPR numbers apply to modulus 11 rule. #> #> See the vignette 'Toolbox' #> [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, format = \"%d-%m-%Y\")"},{"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. format character string dob date format. Default \"%d-%m-%Y\".","code":""},{"path":"/reference/cpr_dob.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extracting date of birth from CPR — cpr_dob","text":"character vector","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] \"23-10-1945\" fsd<-c(\"2310450637\", \"010190-2000\", \"010115-4000\", \"300450-1030\",\"010150-4021\") cpr_dob(fsd) #> [1] \"23-10-1945\" \"01-01-1990\" \"01-01-2015\" \"30-04-1950\" \"01-01-1950\""},{"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":[]},{"path":"/reference/ds2dd.html","id":null,"dir":"Reference","previous_headings":"","what":"Data set to data dictionary function — ds2dd","title":"Data set to data dictionary function — ds2dd","text":"Data set data dictionary function","code":""},{"path":"/reference/ds2dd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Data set to data dictionary function — ds2dd","text":"","code":"ds2dd( ds, record.id = \"record_id\", form.name = \"basis\", field.type = \"text\", field.label = NULL, include.column.names = FALSE )"},{"path":"/reference/ds2dd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Data set to data dictionary function — ds2dd","text":"ds data set record.id name column number id variable, moved first row data dictionary, character integer. Default \"record_id\". form.name vector form names, character string, length 1 length equal number variables. Default \"basis\". field.type vector field types, character string, length 1 length equal number variables. Default \"text. field.label vector form names, character string, length 1 length equal number variables. Default NULL identical field names. include.column.names Flag give detailed output including new column names original data set upload.","code":""},{"path":"/reference/ds2dd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Data set to data dictionary function — ds2dd","text":"data.frame list data.frame vector","code":""},{"path":"/reference/ds2dd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Data set to data dictionary function — ds2dd","text":"","code":"talos$id <- seq_len(nrow(talos)) ds2dd(talos, record.id=\"id\",include.column.names=FALSE) #> field_name form_name section_header field_type field_label #> 1 id basis NA text id #> 2 rtreat basis NA text rtreat #> 3 mrs_1 basis NA text mrs_1 #> 4 mrs_6 basis NA text mrs_6 #> 5 hypertension basis NA text hypertension #> 6 diabetes basis NA text diabetes #> 7 civil basis NA text civil #> select_choices_or_calculations field_note #> 1 NA NA #> 2 NA NA #> 3 NA NA #> 4 NA NA #> 5 NA NA #> 6 NA NA #> 7 NA NA #> text_validation_type_or_show_slider_number text_validation_min #> 1 NA NA #> 2 NA NA #> 3 NA NA #> 4 NA NA #> 5 NA NA #> 6 NA NA #> 7 NA NA #> text_validation_max identifier branching_logic required_field #> 1 NA NA NA NA #> 2 NA NA NA NA #> 3 NA NA NA NA #> 4 NA NA NA NA #> 5 NA NA NA NA #> 6 NA NA NA NA #> 7 NA NA NA NA #> custom_alignment question_number matrix_group_name matrix_ranking #> 1 NA NA NA NA #> 2 NA NA NA NA #> 3 NA NA NA NA #> 4 NA NA NA NA #> 5 NA NA NA NA #> 6 NA NA NA NA #> 7 NA NA NA NA #> field_annotation #> 1 NA #> 2 NA #> 3 NA #> 4 NA #> 5 NA #> 6 NA #> 7 NA"},{"path":"/reference/files_filter.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter files in a folder — files_filter","title":"Filter files in a folder — files_filter","text":"function filters files folder based provided filter.","code":""},{"path":"/reference/files_filter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter files in a folder — files_filter","text":"","code":"files_filter(folder.path, filter.by, full.names = TRUE)"},{"path":"/reference/files_filter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter files in a folder — files_filter","text":"folder.path character. Path folder filtered filter.character. Filter applied files full.names logical. Whether return full file names ","code":""},{"path":"/reference/files_filter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter files in a folder — files_filter","text":"character vector. Filtered files","code":""},{"path":"/reference/files_filter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Filter files in a folder — files_filter","text":"","code":"# Gives path to files/folders with \"tests\" in the name in the # working directory files_filter(getwd(),\"tests\") #> character(0)"},{"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(df = stRoke::talos, group = \"rtreat\", score = \"mrs_6\", # variables = c(\"hypertension\",\"diabetes\",\"civil\"))"},{"path":"/reference/gt_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot a gt or gtsummary table as ggplot object — gt_plot","title":"Plot a gt or gtsummary table as ggplot object — gt_plot","text":"Relying library(magick) library(webshot2)","code":""},{"path":"/reference/gt_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot a gt or gtsummary table as ggplot object — gt_plot","text":"","code":"gt_plot(x, ...)"},{"path":"/reference/gt_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot a gt or gtsummary table as ggplot object — gt_plot","text":"x 'gt' 'gtsummary' table ... Additional arguments passed gt::gtsave","code":""},{"path":"/reference/gt_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot a gt or gtsummary table as ggplot object — gt_plot","text":"gg/ggplot element","code":""},{"path":"/reference/gt_plot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Plot a gt or gtsummary table as ggplot object — gt_plot","text":"Please refer MSKCC-Epi-Bio/bstfun","code":""},{"path":"/reference/gt_plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot a gt or gtsummary table as ggplot object — gt_plot","text":"","code":"#gt_plot(mtcars |> gtsummary::tbl_summary())"},{"path":"/reference/index_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot multidimensional cognitive test scores — index_plot","title":"Plot multidimensional cognitive test scores — index_plot","text":"Plot index scores five dimensional cognitive testing. Includes option facet.","code":""},{"path":"/reference/index_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot multidimensional cognitive test scores — index_plot","text":"","code":"index_plot( ds, id = \"id\", sub_plot = \"_is\", scores = c(\"_is\", \"_lo\", \"_up\", \"_per\"), dom_names = c(\"immediate\", \"visuospatial\", \"verbal\", \"attention\", \"delayed\", \"total\"), facet.by = NULL )"},{"path":"/reference/index_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot multidimensional cognitive test scores — index_plot","text":"ds complete data frame id colname id column. Base colouring sub_plot main outcome scores variable plot scores variables subset plotting. follow standard naming (changed) dom_names domain names axis naming facet.variable base facet_grid ","code":""},{"path":"/reference/index_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot multidimensional cognitive test scores — index_plot","text":"ggplot element","code":""},{"path":"/reference/index_plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot multidimensional cognitive test scores — index_plot","text":"","code":"index_plot(stRoke::score[score$event==\"A\",])"},{"path":"/reference/label_select.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper function for labels in gtsummary — label_select","title":"Helper function for labels in gtsummary — label_select","text":"Function select labels list label pairs (format: age~\"Age\"). Alternative use attributes, eg library(Hmisc).","code":""},{"path":"/reference/label_select.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper function for labels in gtsummary — label_select","text":"","code":"label_select(lst, vec)"},{"path":"/reference/label_select.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper function for labels in gtsummary — label_select","text":"lst List variables labels (format: age~\"Age\") vec Vector variables subset list","code":""},{"path":"/reference/label_select.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper function for labels in gtsummary — label_select","text":"List labels ordered like vec, formatted like lst","code":""},{"path":"/reference/label_select.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Helper function for labels in gtsummary — label_select","text":"","code":"vars<-c(\"hypertension\", \"diabetes\", \"mrs_1\") labels_all<-list(rtreat~\"Trial treatment\", civil~\"Cohabitation\", diabetes~\"Known diabetes\", hypertension~\"Known hypertension\", mrs_1~\"One month mRS\", mrs_6~\"Six months mRS\", '[Intercept]'~\"Intercept\") label_select(labels_all,vars) #> [[1]] #> hypertension ~ \"Known hypertension\" #> <environment: 0x7ff03334c010> #> #> [[2]] #> diabetes ~ \"Known diabetes\" #> <environment: 0x7ff03334c010> #> #> [[3]] #> mrs_1 ~ \"One month mRS\" #> <environment: 0x7ff03334c010> #> ## With gtsummary::tbl_summary() #stRoke::talos[vars] |> #gtsummary::tbl_summary(label = label_select(labels_all,vars))"},{"path":"/reference/metadata_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Vector of REDCap metadata headers — metadata_names","title":"Vector of REDCap metadata headers — metadata_names","text":"Vector REDCap metadata headers","code":""},{"path":"/reference/metadata_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Vector of REDCap metadata headers — metadata_names","text":"","code":"data(metadata_names)"},{"path":"/reference/metadata_names.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Vector of REDCap metadata headers — metadata_names","text":"Vector length 18 REDCap metadata headers: metadata_names characterstrings","code":""},{"path":[]},{"path":"/reference/plot_olr.html","id":null,"dir":"Reference","previous_headings":"","what":"Forest plot from ordinal logistic regression. — plot_olr","title":"Forest plot from ordinal logistic regression. — plot_olr","text":"Heavily inspired https://www.r-bloggers.com/plotting-odds-ratios-aka--forrestplot--ggplot2/","code":""},{"path":"/reference/plot_olr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forest plot from ordinal logistic regression. — plot_olr","text":"","code":"plot_olr( x, title = NULL, dec = 3, lbls = NULL, hori = \"OR (95 % CI)\", vert = \"Variables\", short = FALSE, input = c(\"model\", \"df\") )"},{"path":"/reference/plot_olr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forest plot from ordinal logistic regression. — plot_olr","text":"x input data. title plot title dec decimals labels lbls labels variable names. Careful, right order checked automatically! hori labels horizontal axis (y axis plot rotated) vert labels horizontal axis (x axis plot rotated) short flag half number ticks horizontal axis. input can either \"model\", olr model (polr()), \"df\", data frame three columns , lower CI upper CI.","code":""},{"path":"/reference/plot_olr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forest plot from ordinal logistic regression. — plot_olr","text":"gg object","code":""},{"path":"/reference/plot_olr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forest plot from ordinal logistic regression. — plot_olr","text":"","code":"iris$ord<-factor(sample(1:3,size=nrow(iris),replace=TRUE),ordered=TRUE) lm <- MASS::polr(ord~., data=iris, Hess=TRUE, method=\"logistic\") plot_olr(lm, input=\"model\") #> Waiting for profiling to be done..."},{"path":"/reference/plot_ord_odds.html","id":null,"dir":"Reference","previous_headings":"","what":"Forrest plot from ordinal logistic regression. — plot_ord_odds","title":"Forrest plot from ordinal logistic regression. — plot_ord_odds","text":"Heavily inspired https://www.r-bloggers.com/plotting-odds-ratios-aka--forrestplot--ggplot2/","code":""},{"path":"/reference/plot_ord_odds.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forrest plot from ordinal logistic regression. — plot_ord_odds","text":"","code":"plot_ord_odds( x, title = NULL, dec = 3, lbls = NULL, hori = \"OR (95 % CI)\", vert = \"Variables\", short = FALSE, input = c(\"model\", \"df\") )"},{"path":"/reference/plot_ord_odds.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forrest plot from ordinal logistic regression. — plot_ord_odds","text":"x input data. title plot title dec decimals labels lbls labels variable names. Carefull, right order checked automatically! hori labels horizontal axis (y axis plot rotated) vert labels horizontal axis (x axis plot rotated) short flag half number ticks horizontal axis. input can either \"model\", olr model (polr()), \"df\", dataframe whith three columns , lower CI upper CI.","code":""},{"path":"/reference/plot_ord_odds.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forrest plot from ordinal logistic regression. — plot_ord_odds","text":"gg object","code":""},{"path":"/reference/quantile_cut.html","id":null,"dir":"Reference","previous_headings":"","what":"Easy function for splitting numeric variable in quantiles — quantile_cut","title":"Easy function for splitting numeric variable in quantiles — quantile_cut","text":"Using base/stats functions cut() quantile().","code":""},{"path":"/reference/quantile_cut.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Easy function for splitting numeric variable in quantiles — quantile_cut","text":"","code":"quantile_cut( x, groups, y = NULL, na.rm = TRUE, group.names = NULL, ordered.f = FALSE, inc.outs = FALSE, detail.list = FALSE )"},{"path":"/reference/quantile_cut.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Easy function for splitting numeric variable in quantiles — quantile_cut","text":"x Variable cut. groups Number groups. y alternative vector draw quantile cuts . Limits within x. Default NULL. na.rm Remove NA's. Default TRUE. group.names Names groups split . Default NULL, giving intervals names. ordered.f Set resulting vector ordered. Default FALSE. inc.outs Flag include min(x) max(x) borders case y!=NULL. detail.list flag include details ","code":""},{"path":"/reference/quantile_cut.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Easy function for splitting numeric variable in quantiles — quantile_cut","text":"vector list vector details (length 2)","code":""},{"path":"/reference/quantile_cut.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Easy function for splitting numeric variable in quantiles — quantile_cut","text":"","code":"aa <- as.numeric(sample(1:1000,2000,replace = TRUE)) x <- 1:450 y <- 6:750 summary(quantile_cut(aa,groups=4,detail.list=FALSE)) ## Cuts quartiles #> [1,259] (259,514] (514,753] (753,1e+03] #> 500 502 499 499"},{"path":"/reference/read_redcap_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Download REDCap data — read_redcap_data","title":"Download REDCap data — read_redcap_data","text":"Wrapper function using REDCapR::redcap_read REDCapRITS::REDCap_split including clean-. Handles","code":""},{"path":"/reference/read_redcap_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download REDCap data — read_redcap_data","text":"","code":"read_redcap_data( uri, token, records = NULL, fields = NULL, events = NULL, forms = NULL, generics = c(\"record_id\", \"redcap_event_name\", \"redcap_repeat_instrument\", \"redcap_repeat_instance\") )"},{"path":"/reference/read_redcap_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download REDCap data — read_redcap_data","text":"uri REDCap database uri token API token records records download fields fields download events events download forms forms download generics vector auto-generated generic variable names ignore discarding empty rows","code":""},{"path":"/reference/read_redcap_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download REDCap data — read_redcap_data","text":"list instruments","code":""},{"path":"/reference/read_redcap_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download REDCap data — read_redcap_data","text":"","code":"# Examples will be provided later"},{"path":"/reference/read_redcap_tables.html","id":null,"dir":"Reference","previous_headings":"","what":"Download REDCap data — read_redcap_tables","title":"Download REDCap data — read_redcap_tables","text":"Wrapper function using REDCapR::redcap_read REDCapRITS::REDCap_split including clean-. Works longitudinal projects repeating instruments.","code":""},{"path":"/reference/read_redcap_tables.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download REDCap data — read_redcap_tables","text":"","code":"read_redcap_tables( uri, token, records = NULL, fields = NULL, events = NULL, forms = NULL, generics = c(\"record_id\", \"redcap_event_name\", \"redcap_repeat_instrument\", \"redcap_repeat_instance\") )"},{"path":"/reference/read_redcap_tables.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download REDCap data — read_redcap_tables","text":"uri REDCap database uri token API token records records download fields fields download events events download forms forms download generics vector auto-generated generic variable names ignore discarding empty rows","code":""},{"path":"/reference/read_redcap_tables.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download REDCap data — read_redcap_tables","text":"list instruments","code":""},{"path":"/reference/read_redcap_tables.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download REDCap data — read_redcap_tables","text":"","code":"# Examples will be provided later"},{"path":"/reference/score.html","id":null,"dir":"Reference","previous_headings":"","what":"Data frame with sample data of cognitive testing score — score","title":"Data frame with sample data of cognitive testing score — score","text":"Contains non-identifiable organic trial data five-dimensional cognitive test.","code":""},{"path":"/reference/score.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Data frame with sample data of cognitive testing score — score","text":"","code":"data(score)"},{"path":"/reference/score.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Data frame with sample data of cognitive testing score — score","text":"data frame 20 rows 26 variables: id id event event a_is domain index score b_is domain b index score c_is domain c index score d_is domain d index score e_is domain e index score i_is total index score a_lo domain lower ci b_lo domain b lower ci c_lo domain c lower ci d_lo domain d lower ci e_lo domain e lower ci i_lo total lower ci a_up domain upper ci b_up domain b upper ci c_up domain c upper ci d_up domain d upper ci e_up domain e upper ci i_up total upper ci a_per domain percentile b_per domain b percentile c_per domain c percentile d_per domain d percentile e_per domain e percentile i_per total percentile","code":""},{"path":"/reference/source_lines.html","id":null,"dir":"Reference","previous_headings":"","what":"Source Lines from a File — source_lines","title":"Source Lines from a File — source_lines","text":"Sources specific lines file","code":""},{"path":"/reference/source_lines.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Source Lines from a File — source_lines","text":"","code":"source_lines(file, lines, ...)"},{"path":"/reference/source_lines.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Source Lines from a File — source_lines","text":"file character string giving path file sourced. lines numeric vector line numbers sourced. ... Additional arguments passed source.","code":""},{"path":"/reference/source_lines.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Source Lines from a File — source_lines","text":"result source.","code":""},{"path":[]},{"path":"/reference/source_lines.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Source Lines from a File — source_lines","text":"","code":"test_file <- tempfile(fileext = \".R\") writeLines(c(\"# Line 1\", \"2+2\", \"# Line 3\"), test_file) source_lines(test_file, 1:2, echo=TRUE) #> #> > 2 + 2 #> [1] 4"},{"path":"/reference/stRoke-package.html","id":null,"dir":"Reference","previous_headings":"","what":"stRoke: Clinical Stroke Research — stRoke-package","title":"stRoke: Clinical Stroke Research — stRoke-package","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', new functions added. Version follows months year. See NEWS/Changelog release notes. package includes sampled data TALOS trial (Kraglund et al (2018) doi:10.1161/STROKEAHA.117.020067 ). win_prob() function based work Zou et al (2022) doi:10.1161/STROKEAHA.121.037744 . age_calc() function based work Becker (2020) doi:10.18637/jss.v093.i02 .","code":""},{"path":[]},{"path":"/reference/stRoke-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"stRoke: Clinical Stroke Research — stRoke-package","text":"Maintainer: Andreas Gammelgaard Damsbo agdamsbo@clin.au.dk (ORCID)","code":""},{"path":"/reference/talos.html","id":null,"dir":"Reference","previous_headings":"","what":"Data frame with sample of TALOS data — talos","title":"Data frame with sample of TALOS data — talos","text":"Contains non-identifiable subset data TALOS trial.","code":""},{"path":"/reference/talos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Data frame with sample of TALOS data — talos","text":"","code":"data(talos)"},{"path":"/reference/talos.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Data frame with sample of TALOS data — talos","text":"data frame 200 rows 6 variables: rtreat Randomisation mrs_1 Modified Rankin scale score follow-mrs_6 Modified Rankin scale score end study hypertension Known hypertension diabetes Known diabetes civil Cohabitation status","code":""},{"path":"/reference/talos.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Data frame with sample of TALOS data — talos","text":"doi:10.1161/STROKEAHA.117.020067","code":""},{"path":"/reference/win_prob.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculates the probability of winning — win_prob","title":"Calculates the probability of winning — win_prob","text":"Calculates probability winning (winP). referenced article Zou et al (2022) proposes method calculating probability winning confidence interval p-value testing.","code":""},{"path":"/reference/win_prob.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculates the probability of winning — win_prob","text":"","code":"win_prob( data, response = NULL, group = NULL, alpha = 0.05, beta = 0.2, group.ratio = 1, sample.size = FALSE, print.tables = FALSE, dec = 3 )"},{"path":"/reference/win_prob.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Calculates the probability of winning — win_prob","text":"doi:10.1161/STROKEAHA.121.037744","code":""},{"path":"/reference/win_prob.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculates the probability of winning — win_prob","text":"data data frame containing response group variable. response name response variable. Takes first column empty. group name group variable. Takes second column empty. alpha alpha level hypothesis test. Default 0.05. beta beta level sample size calculation. Default 0.2. group.ratio ratio group sizes. Default 1. sample.size Flag include sample size calculation. Default FALSE. print.tables Flag print cumulative tables. Default FALSE. dec Numeric decimals print. Default 3.","code":""},{"path":"/reference/win_prob.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculates the probability of winning — win_prob","text":"list containing win_prob statistics.","code":""},{"path":"/reference/win_prob.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculates the probability of winning — win_prob","text":"","code":"win_prob(data=stRoke::talos,response=\"mrs_6\",group=\"rtreat\") #> $list_cum #> $list_cum$Active #> mrs_6 rtreat Freq prop overall_rank rank win_frac #> 1 0 Active 14 0.17721519 175.0 72.5 0.847107438 #> 2 1 Active 29 0.36708861 113.5 51.0 0.516528926 #> 3 2 Active 22 0.27848101 49.0 25.5 0.194214876 #> 4 3 Active 9 0.11392405 15.0 10.0 0.041322314 #> 5 4 Active 3 0.03797468 7.0 4.0 0.024793388 #> 6 6 Active 2 0.02531646 2.5 1.5 0.008264463 #> #> $list_cum$Placebo #> mrs_6 rtreat Freq prop overall_rank rank win_frac #> 7 0 Placebo 37 0.30578512 175.0 103.0 0.91139241 #> 8 1 Placebo 43 0.35537190 113.5 63.0 0.63924051 #> 9 2 Placebo 35 0.28925620 49.0 24.0 0.31645570 #> 10 3 Placebo 2 0.01652893 15.0 5.5 0.12025316 #> 11 4 Placebo 2 0.01652893 7.0 3.5 0.04430380 #> 12 6 Placebo 2 0.01652893 2.5 1.5 0.01265823 #> #> #> $group_levels #> [1] \"Active\" \"Placebo\" #> #> $sum_a #> [1] 79 #> #> $sum_b #> [1] 121 #> #> $winP_a #> [1] 0.3996757 #> #> $winP_b #> [1] 0.6003243 #> #> $var_win_frac_a #> [1] 0.07609113 #> #> $var_win_frac_b #> [1] 0.06806341 #> #> $var_win_prob #> [1] 0.001525686 #> #> $se_win_prob #> [1] 0.03906004 #> #> $conf.int #> [1] 0.6124886 0.3724300 #> #> $test_stat #> [1] 2.498962 #> #> $p_val #> [1] 0.01245577 #> #> $nnt #> [1] -9.967675 #> #> $ss_n #> [1] NA #> #> $param.record #> $param.record$data #> rtreat mrs_1 mrs_6 hypertension diabetes civil #> 38 Active 1 1 no no partner #> 434 Active 1 1 yes no partner #> 588 Active 2 2 yes no partner #> 42 Active 0 0 yes no partner #> 160 Placebo 1 1 yes no partner #> 174 Active 0 1 yes no alone #> 11 Placebo 2 1 yes yes alone #> 601 Placebo 1 1 no no partner #> 412 Active 0 0 yes no partner #> 88 Placebo 1 1 yes yes partner #> 56 Placebo 0 0 no no alone #> 235 Placebo 2 1 yes yes alone #> 205 Active 3 3 no no partner #> 62 Active 2 2 yes no alone #> 593 Placebo 2 2 no no alone #> 143 Active 2 1 yes no partner #> 520 Active 2 2 no yes partner #> 144 Placebo 1 0 yes no partner #> 383 Active 2 3 no no alone #> 347 Placebo 1 0 yes yes partner #> 346 Active 1 2 yes no partner #> 318 Placebo 2 2 no no partner #> 231 Placebo 2 2 no no partner #> 190 Active 1 1 yes no partner #> 287 Placebo 2 2 yes no partner #> 633 Placebo 1 1 no no partner #> 228 Placebo 4 3 yes no partner #> 409 Active 1 2 yes no partner #> 603 Placebo 2 1 no no alone #> 628 Placebo 1 2 no no partner #> 91 Active 1 0 yes no partner #> 537 Placebo 4 4 no no partner #> 75 Placebo 1 2 yes no partner #> 282 Placebo 1 0 no no partner #> 249 Active 1 1 no no alone #> 72 Active 2 3 yes no partner #> 222 Active 2 2 yes no partner #> 258 Placebo 0 1 no no partner #> 134 Active 4 4 no no partner #> 117 Active 1 1 no yes partner #> 377 Active 2 1 no no partner #> 583 Placebo 3 2 yes no partner #> 552 Active 3 1 yes no alone #> 124 Placebo 2 2 yes yes partner #> 189 Placebo 1 0 no yes partner #> 521 Placebo 1 2 yes yes alone #> 429 Active 2 1 no no partner #> 203 Placebo 1 1 yes no partner #> 172 Active 1 2 no no partner #> 402 Placebo 2 2 yes no partner #> 574 Placebo 1 1 yes no partner #> 271 Active 4 3 no no partner #> 50 Placebo 3 2 no no alone #> 264 Active 4 2 no no alone #> 571 Active 2 0 yes no partner #> 239 Active 3 3 yes no alone #> 262 Placebo 2 1 yes no partner #> 236 Placebo 1 1 no no partner #> 94 Placebo 1 1 no no partner #> 275 Placebo 0 0 no no partner #> 26 Placebo 2 4 no no alone #> 476 Placebo 1 1 no no alone #> 427 Active 2 3 yes no alone #> 359 Placebo 1 2 yes no alone #> 341 Active 4 3 yes no alone #> 457 Active 1 1 yes yes partner #> 485 Placebo 0 0 no no partner #> 171 Placebo 2 2 no no partner #> 97 Placebo 2 1 yes no partner #> 635 Placebo 1 2 no no alone #> 472 Placebo 1 0 yes no partner #> 408 Active 1 1 yes yes partner #> 158 Placebo 0 0 no no partner #> 63 Placebo 1 0 no yes alone #> 557 Active 2 2 no no partner #> 73 Active 1 1 yes no partner #> 425 Placebo 2 0 yes no partner #> 423 Placebo 2 2 yes yes partner #> 272 Active 2 1 yes no alone #> 122 Active 1 0 no no partner #> 370 Active 0 1 no no partner #> 274 Placebo 0 0 no no partner #> 407 Active 0 0 no no partner #> 482 Placebo 1 1 no no partner #> 586 Active 6 6 yes yes partner #> 20 Placebo 1 2 no no alone #> 568 Active 1 0 no no partner #> 331 Placebo 1 1 no no alone #> 133 Placebo 1 1 no no partner #> 563 Active 4 4 yes no partner #> 349 Placebo 1 2 yes yes alone #> 381 Placebo 1 1 yes no partner #> 549 Placebo 1 1 no no alone #> 34 Active 1 1 no no alone #> 33 Placebo 0 0 yes no alone #> 531 Placebo 2 2 yes no alone #> 389 Active 1 0 no no alone #> 64 Active 1 1 yes yes alone #> 428 Active 2 1 yes no partner #> 403 Placebo 2 2 yes no alone #> 343 Placebo 1 0 no no partner #> 294 Active 2 2 no no alone #> 76 Placebo 3 1 no no alone #> 166 Placebo 1 0 yes no partner #> 209 Placebo 0 1 yes no partner #> 626 Active 2 2 yes no alone #> 481 Active 5 3 no no partner #> 376 Active 2 2 yes yes partner #> 67 Active 3 2 no no partner #> 130 Placebo 2 1 no no partner #> 250 Active 2 1 yes no partner #> 609 Active 2 2 no no partner #> 545 Placebo 3 2 yes no partner #> 226 Placebo 2 1 no no partner #> 276 Placebo 1 2 no no partner #> 305 Placebo 0 0 yes no partner #> 202 Placebo 1 0 yes no alone #> 245 Placebo 1 1 no no partner #> 131 Active 3 1 no no partner #> 505 Active 2 1 no no partner #> 546 Placebo 2 2 yes no alone #> 639 Placebo 1 1 yes yes partner #> 219 Active 2 1 yes no partner #> 244 Placebo 2 2 yes no alone #> 348 Placebo 0 0 no no partner #> 280 Placebo 0 0 yes no partner #> 504 Placebo 2 2 yes no partner #> 51 Placebo 1 1 no no alone #> 493 Active 6 6 no no alone #> 167 Placebo 0 1 yes no partner #> 58 Placebo 1 0 no no partner #> 169 Active 0 0 no no partner #> 293 Active 1 0 no no partner #> 334 Placebo 6 6 no no partner #> 28 Active 2 2 yes no partner #> 1 Placebo 0 0 yes no partner #> 463 Active 2 1 yes no alone #> 445 Placebo 1 2 yes no alone #> 320 Placebo 1 2 yes yes alone #> 500 Placebo 0 0 no no alone #> 175 Placebo 1 2 yes no partner #> 201 Placebo 0 0 yes no partner #> 142 Active 2 0 no no partner #> 278 Active 0 1 yes no alone #> 181 Placebo 0 0 no no partner #> 193 Placebo 2 1 yes no alone #> 321 Active 2 0 no no partner #> 598 Active 0 1 no no partner #> 217 Placebo 0 0 yes no partner #> 13 Active 1 1 yes no partner #> 242 Placebo 2 0 yes no partner #> 513 Placebo 1 1 no no partner #> 518 Placebo 2 2 yes no partner #> 304 Placebo 2 2 no no partner #> 587 Placebo 1 2 no no alone #> 497 Placebo 0 1 yes no partner #> 296 Placebo 0 0 yes no partner #> 526 Active 1 1 no no partner #> 2 Placebo 2 1 no no partner #> 627 Active 2 2 no yes partner #> 126 Placebo 2 1 yes no partner #> 420 Placebo 2 0 yes no partner #> 392 Active 2 2 yes no partner #> 522 Placebo 3 2 yes no alone #> 312 Active 4 4 no yes partner #> 9 Placebo 1 1 no no partner #> 29 Placebo 2 2 no no alone #> 7 Placebo 1 1 yes no partner #> 49 Placebo 2 1 no yes partner #> 439 Placebo 3 2 no no alone #> 46 Active 0 0 yes no alone #> 80 Active 1 1 no no partner #> 237 Placebo 0 0 yes no partner #> 306 Placebo 2 0 no no alone #> 345 Placebo 0 0 yes no partner #> 153 Active 2 2 no no partner #> 98 Placebo 1 0 yes no partner #> 44 Placebo 2 1 yes no partner #> 458 Active 3 2 no no partner #> 585 Placebo 1 1 yes no partner #> 211 Placebo 3 2 no yes partner #> 610 Active 1 1 no no alone #> 310 Placebo 0 0 no no alone #> 541 Active 4 2 yes no partner #> 161 Placebo 1 1 no no partner #> 641 Placebo 1 1 no no partner #> 538 Placebo 1 1 no no partner #> 281 Placebo 1 0 no no partner #> 301 Active 3 2 yes no partner #> 356 Active 3 2 no no alone #> 59 Active 3 3 no no alone #> 302 Placebo 1 0 yes no partner #> 116 Active 1 0 no no partner #> 547 Placebo 2 2 no no partner #> 22 Placebo 2 1 no no partner #> 517 Placebo 4 3 yes no partner #> 344 Placebo 1 1 yes no partner #> 48 Placebo 2 0 yes no alone #> 100 Placebo 1 0 yes no alone #> 93 Placebo 6 6 yes no alone #> #> $param.record$response #> [1] \"mrs_6\" #> #> $param.record$group #> [1] \"rtreat\" #> #> $param.record$alpha #> [1] 0.05 #> #> $param.record$beta #> [1] 0.2 #> #> $param.record$group.ratio #> [1] 1 #> #> $param.record$sample.size #> [1] FALSE #> #> $param.record$print.tables #> [1] FALSE #> #> $param.record$dec #> [1] 3 #> #> #> attr(,\"class\") #> [1] \"win_Prop\" \"list\""},{"path":"/reference/write_ical.html","id":null,"dir":"Reference","previous_headings":"","what":"Write ical object — write_ical","title":"Write ical object — write_ical","text":"function creates ical file based data frame mixed events. Export .ics file using calendar::ic_write().","code":""},{"path":"/reference/write_ical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Write ical object — write_ical","text":"","code":"write_ical( df, date = \"date\", date.end = NA, title = \"title\", time.start = \"start\", time.end = \"end\", place = NA, place.def = NA, time.def = \"10:00:00\", time.dur = 60, descr = NA, link = NA, t.zone = \"CET\" )"},{"path":"/reference/write_ical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Write ical object — write_ical","text":"df data frame calendar data date name event date column data frame date.end name end date column data frame title name title column data frame time.start name start time column data frame time.end name end time column data frame place name place column data frame place.def Default location use place NA time.def Default start time use time.start NA time.dur Default duration event minutes, time.end NA descr Name description/notes column . link Name link column, . t.zone character string time zone events. string must time zone recognized user's OS.","code":""},{"path":"/reference/write_ical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Write ical object — write_ical","text":"ical object","code":""},{"path":[]},{"path":"/reference/write_ical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Write ical object — write_ical","text":"","code":"df <- data.frame( date = c(\"2020-02-10\", \"2020-02-11\"), date.end = c(\"2020-02-13\",NA), title = c(\"Conference\", \"Lunch\"), start = c(\"12:00:00\", NA), time.end = c(\"13:00:00\", NA), note = c(\"Hi there\",\"Remember to come\"), link = c(\"https://icalendar.org\",\"https://agdamsbo.github.io/stRoke/\") ) write_ical( df, date = \"date\", date.end = \"date.end\", title = \"title\", time.start = \"start\", time.end = \"time.end\", place.def = \"Conference Room\", descr = \"note\", link = \"link\" ) #> # A tibble: 2 × 7 #> SUMMARY DTSTART DTEND UID LOCAT…¹ URL DESCR…² #> <chr> <dttm> <dttm> <chr> <chr> <chr> <chr> #> 1 Conference 2020-02-10 12:00:00 2020-02-13 13:00:00 ical… Confer… http… Hi the… #> 2 Lunch 2020-02-11 10:00:00 2020-02-11 11:00:00 ical… Confer… http… Rememb… #> # … with abbreviated variable names ¹LOCATION, ²DESCRIPTION"},{"path":[]},{"path":"/news/index.html","id":"functions-23-4-1","dir":"Changelog","previous_headings":"","what":"Functions:","title":"stRoke 23.4.1","text":"NEW: ds2dd() creates REDCap data dictionary based data set easy upload. new vignette provided example use. separate vignette added.","code":""},{"path":"/news/index.html","id":"notes-23-4-1","dir":"Changelog","previous_headings":"","what":"Notes:","title":"stRoke 23.4.1","text":"newer additions package, functions clearly potential use also outside stroke research. new vector REDCap metadata headers added. Can called data(metadata_names).","code":""},{"path":[]},{"path":"/news/index.html","id":"functions-23-1-8","dir":"Changelog","previous_headings":"","what":"Functions:","title":"stRoke 23.1.8","text":"write_ical() easy use implementation package library(calendar) easy conversion spreadsheets ical object. Export .ics file using calendar::ic_write(). contrast_text() calculates best contrast text color given background color. use graphics.","code":""},{"path":"/news/index.html","id":"notes-23-1-8","dir":"Changelog","previous_headings":"","what":"Notes:","title":"stRoke 23.1.8","text":"first update CRAN.","code":""},{"path":"/news/index.html","id":"documentation-23-1-8","dir":"Changelog","previous_headings":"","what":"Documentation","title":"stRoke 23.1.8","text":"Badges, lots badges","code":""},{"path":"/news/index.html","id":"stroke-2317","dir":"Changelog","previous_headings":"","what":"stRoke 23.1.7","title":"stRoke 23.1.7","text":"CRAN release: 2023-01-24","code":""},{"path":"/news/index.html","id":"notes-23-1-7","dir":"Changelog","previous_headings":"","what":"Notes:","title":"stRoke 23.1.7","text":"version first published CRAN 24.jan.2023. also version first published zenodo.org, corresponding doi: 10.5281/zenodo.7572023.","code":""},{"path":"/news/index.html","id":"functions-23-1-7","dir":"Changelog","previous_headings":"","what":"Functions:","title":"stRoke 23.1.7","text":"redcap_read_tables() removed package now. Looking add back later minimal data acquisition tool.","code":""},{"path":[]},{"path":[]},{"path":"/news/index.html","id":"functions-23-1-6","dir":"Changelog","previous_headings":"","what":"Functions:","title":"stRoke 23.1.6 - failed due to dependencies","text":"win_prop() added implement suggested methods DOI: 10.1161/STROKEAHA.121.037744, implementation “Tournament Methods” also found library(genodds). function based spreadsheet provided authors. print.win_Prop also added printing.","code":""},{"path":"/news/index.html","id":"notes-23-1-6","dir":"Changelog","previous_headings":"","what":"Notes:","title":"stRoke 23.1.6 - failed due to dependencies","text":"23.1.5 failed CRAN due gt_plot(). function dropped. Find as_ggplot() elsewhere. agdamsbo/REDCapRITS added “Additional_repositories”. Included references listed authors.","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":"/news/index.html","id":"functions-0-23-1-4","dir":"Changelog","previous_headings":"","what":"Functions:","title":"stRoke 0.23.1.4","text":"plot_olr() deprecated removed. ci_plot() functionality extended include logistic model plotting. age_calc() use vapply() instead sapply() gt_plot() function added plot gt elements ggplots. bstfun. done satisfied layout patchwork.","code":""},{"path":"/news/index.html","id":"documentation-0-23-1-4","dir":"Changelog","previous_headings":"","what":"Documentation","title":"stRoke 0.23.1.4","text":"Trying complete flags goodpractice inteRgrate","code":""},{"path":[]},{"path":"/news/index.html","id":"functions-0-23-1-3","dir":"Changelog","previous_headings":"","what":"Functions:","title":"stRoke 0.23.1.3","text":"files_filter() added. Simple function get file names path specified filter. updated cpr_dob give warnings format recognised return NAs. ci_plot() updated actually handle binary factors. Uses glm(), lm().","code":""},{"path":"/news/index.html","id":"documentation-0-23-1-3","dir":"Changelog","previous_headings":"","what":"Documentation:","title":"stRoke 0.23.1.3","text":"test, test tests satisfy codecov , course, ensure higher quality changes comply goodpractices::gp() …probably .","code":""},{"path":[]},{"path":"/news/index.html","id":"functions-0-23-1-2","dir":"Changelog","previous_headings":"","what":"Functions:","title":"stRoke 0.23.1.2","text":"cpr_dob() now includes format=. minor updates.","code":""},{"path":"/news/index.html","id":"documentation-0-23-1-2","dir":"Changelog","previous_headings":"","what":"Documentation:","title":"stRoke 0.23.1.2","text":"Two new vignettes Taking last steps documenting releasing CRAN","code":""},{"path":"/news/index.html","id":"other-0-23-1-2","dir":"Changelog","previous_headings":"","what":"Other:","title":"stRoke 0.23.1.2","text":"New hex logo","code":""},{"path":[]},{"path":"/news/index.html","id":"functions-0-23-1-1","dir":"Changelog","previous_headings":"","what":"Functions:","title":"stRoke 0.23.1.1","text":"age_calc() now also outputs numeric vector units=“days”, character vector difftime() .","code":""},{"path":"/news/index.html","id":"documentation-0-23-1-1","dir":"Changelog","previous_headings":"","what":"Documentation:","title":"stRoke 0.23.1.1","text":"Added NEWS.md file track changes package. Added codecov Added tests help gpttools","code":""}]