mirror of
https://github.com/agdamsbo/stRoke.git
synced 2024-11-21 20:40:22 +01:00
2 lines
91 KiB
JSON
2 lines
91 KiB
JSON
[{"path":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/articles/toolbox.html","id":"generic_stroke","dir":"Articles","previous_headings":"A toolbox > Plotting","what":"generic_stroke()","title":"Toolbox","text":"learning purposes. Uses anonymized 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=\"mwlefoodfi\" style=\"padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;\"> #> <style>#mwlefoodfi table { #> font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; #> -webkit-font-smoothing: antialiased; #> -moz-osx-font-smoothing: grayscale; #> } #> #> #mwlefoodfi thead, #mwlefoodfi tbody, #mwlefoodfi tfoot, #mwlefoodfi tr, #mwlefoodfi td, #mwlefoodfi th { #> border-style: none; #> } #> #> #mwlefoodfi p { #> margin: 0; #> padding: 0; #> } #> #> #mwlefoodfi .gt_table { #> display: table; #> border-collapse: collapse; #> line-height: normal; #> 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; #> } #> #> #mwlefoodfi .gt_caption { #> padding-top: 4px; #> padding-bottom: 4px; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_subtitle { #> color: #333333; #> font-size: 85%; #> font-weight: initial; #> padding-top: 3px; #> padding-bottom: 5px; #> padding-left: 5px; #> padding-right: 5px; #> border-top-color: #FFFFFF; #> border-top-width: 0; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_bottom_border { #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_column_spanner_outer:first-child { #> padding-left: 0; #> } #> #> #mwlefoodfi .gt_column_spanner_outer:last-child { #> padding-right: 0; #> } #> #> #mwlefoodfi .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%; #> } #> #> #mwlefoodfi .gt_spanner_row { #> border-bottom-style: hidden; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_from_md > :first-child { #> margin-top: 0; #> } #> #> #mwlefoodfi .gt_from_md > :last-child { #> margin-bottom: 0; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_row_group_first td { #> border-top-width: 2px; #> } #> #> #mwlefoodfi .gt_row_group_first th { #> border-top-width: 2px; #> } #> #> #mwlefoodfi .gt_summary_row { #> color: #333333; #> background-color: #FFFFFF; #> text-transform: inherit; #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #mwlefoodfi .gt_first_summary_row { #> border-top-style: solid; #> border-top-color: #D3D3D3; #> } #> #> #mwlefoodfi .gt_first_summary_row.thick { #> border-top-width: 2px; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_grand_summary_row { #> color: #333333; #> background-color: #FFFFFF; #> text-transform: inherit; #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_last_grand_summary_row_top { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> border-bottom-style: double; #> border-bottom-width: 6px; #> border-bottom-color: #D3D3D3; #> } #> #> #mwlefoodfi .gt_striped { #> background-color: rgba(128, 128, 128, 0.05); #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_footnote { #> margin: 0px; #> font-size: 90%; #> padding-top: 4px; #> padding-bottom: 4px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_sourcenote { #> font-size: 90%; #> padding-top: 4px; #> padding-bottom: 4px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #mwlefoodfi .gt_left { #> text-align: left; #> } #> #> #mwlefoodfi .gt_center { #> text-align: center; #> } #> #> #mwlefoodfi .gt_right { #> text-align: right; #> font-variant-numeric: tabular-nums; #> } #> #> #mwlefoodfi .gt_font_normal { #> font-weight: normal; #> } #> #> #mwlefoodfi .gt_font_bold { #> font-weight: bold; #> } #> #> #mwlefoodfi .gt_font_italic { #> font-style: italic; #> } #> #> #mwlefoodfi .gt_super { #> font-size: 65%; #> } #> #> #mwlefoodfi .gt_footnote_marks { #> font-size: 75%; #> vertical-align: 0.4em; #> position: initial; #> } #> #> #mwlefoodfi .gt_asterisk { #> font-size: 100%; #> vertical-align: 0; #> } #> #> #mwlefoodfi .gt_indent_1 { #> text-indent: 5px; #> } #> #> #mwlefoodfi .gt_indent_2 { #> text-indent: 10px; #> } #> #> #mwlefoodfi .gt_indent_3 { #> text-indent: 15px; #> } #> #> #mwlefoodfi .gt_indent_4 { #> text-indent: 20px; #> } #> #> #mwlefoodfi .gt_indent_5 { #> text-indent: 25px; #> } #> #> #mwlefoodfi .katex-display { #> display: inline-flex !important; #> margin-bottom: 0.75em !important; #> } #> #> #mwlefoodfi div.Reactable > div.rt-table > div.rt-thead > div.rt-tr.rt-tr-group-header > div.rt-th-group:after { #> height: 0px !important; #> } #> <\/style> #> <table class=\"gt_table\" data-quarto-disable-processing=\"false\" data-quarto-bootstrap=\"false\"> #> <thead> #> <tr class=\"gt_col_headings\"> #> <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"label\"><span class='gt_from_md'><strong>Characteristic<\/strong><\/span><\/th> #> <th class=\"gt_col_heading gt_columns_bottom_border gt_center\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"stat_0\"><span class='gt_from_md'><strong>Overall<\/strong><br /> #> N = 200<\/span><span class=\"gt_footnote_marks\" style=\"white-space:nowrap;font-style:italic;font-weight:normal;line-height:0;\"><sup>1<\/sup><\/span><\/th> #> <th class=\"gt_col_heading gt_columns_bottom_border gt_center\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"stat_1\"><span class='gt_from_md'><strong>Active<\/strong><br /> #> N = 79<\/span><span class=\"gt_footnote_marks\" style=\"white-space:nowrap;font-style:italic;font-weight:normal;line-height:0;\"><sup>1<\/sup><\/span><\/th> #> <th class=\"gt_col_heading gt_columns_bottom_border gt_center\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"stat_2\"><span class='gt_from_md'><strong>Placebo<\/strong><br /> #> N = 121<\/span><span class=\"gt_footnote_marks\" style=\"white-space:nowrap;font-style:italic;font-weight:normal;line-height:0;\"><sup>1<\/sup><\/span><\/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 (51%)<\/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\"><br /><\/td> #> <td headers=\"stat_1\" class=\"gt_row gt_center\"><br /><\/td> #> <td headers=\"stat_2\" class=\"gt_row gt_center\"><br /><\/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 (71%)<\/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\"><span class=\"gt_footnote_marks\" style=\"white-space:nowrap;font-style:italic;font-weight:normal;line-height:0;\"><sup>1<\/sup><\/span> <span class='gt_from_md'>n (%)<\/span><\/td> #> <\/tr> #> <\/tfoot> #> <\/table> #> <\/div> #> #> $`Figure 1` #> #> $`Figure 2`"},{"path":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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 ) #> Zou et al's winP (doi: 10.1161/STROKEAHA.121.037744) #> #> Probability of a random observation in Placebo group #> will have a higher response score than a random #> observation in Active group: #> #> winP: 0.400 (0.612, 0.372) p=0.0125 #> -------------------------------------------- #> #> The numbers needed to treat (NNT) are: -9 #> #> #> -------------------------------------------- #> #> With Active/Placebo ratio = 1 and beta = 0.2 #> the sample size needed is: 238 #> #> #> -------------------------------------------- #> #> Results for the Active group: #> |mrs_6 | Freq| prop| overall_rank| rank| win_frac| #> |:-----|----:|-----:|------------:|----:|--------:| #> |0 | 14| 0.177| 175.0| 72.5| 0.847| #> |1 | 29| 0.367| 113.5| 51.0| 0.517| #> |2 | 22| 0.278| 49.0| 25.5| 0.194| #> |3 | 9| 0.114| 15.0| 10.0| 0.041| #> |4 | 3| 0.038| 7.0| 4.0| 0.025| #> |6 | 2| 0.025| 2.5| 1.5| 0.008| #> #> Results for the Placebo group: #> |mrs_6 | Freq| prop| overall_rank| rank| win_frac| #> |:-----|----:|-----:|------------:|-----:|--------:| #> |0 | 37| 0.306| 175.0| 103.0| 0.911| #> |1 | 43| 0.355| 113.5| 63.0| 0.639| #> |2 | 35| 0.289| 49.0| 24.0| 0.316| #> |3 | 2| 0.017| 15.0| 5.5| 0.120| #> |4 | 2| 0.017| 7.0| 3.5| 0.044| #> |6 | 2| 0.017| 2.5| 1.5| 0.013|"},{"path":"https://agdamsbo.github.io/stRoke/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Andreas Gammelgaard Damsbo. Author, maintainer.","code":""},{"path":"https://agdamsbo.github.io/stRoke/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Damsbo (2024). stRoke: Clinical Stroke Research. R package version 24.10.1, https://github.com/agdamsbo/stRoke, https://agdamsbo.github.io/stRoke/.","code":"@Manual{, title = {stRoke: Clinical Stroke Research}, author = {Andreas Gammelgaard Damsbo}, year = {2024}, note = {R package version 24.10.1, https://github.com/agdamsbo/stRoke}, url = {https://agdamsbo.github.io/stRoke/}, }"},{"path":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/reference/add_padding.html","id":null,"dir":"Reference","previous_headings":"","what":"MOVED Add padding to string — add_padding","title":"MOVED Add padding to string — add_padding","text":"MOVED Add padding string","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/add_padding.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"MOVED Add padding to string — add_padding","text":"","code":"add_padding( d, length = NULL, after = FALSE, pad = \"0\", lead = NULL, tail = NULL )"},{"path":"https://agdamsbo.github.io/stRoke/reference/add_padding.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"MOVED Add padding to string — add_padding","text":"d vector strings numbers length final string length padding added opposed default pad padding string length 1 lead leading string . Number character vector. Cycled. tail tailing string . Number character vector. Cycled.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/add_padding.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"MOVED Add padding to string — add_padding","text":"vector character strings length.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/add_padding.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"MOVED Add padding to string — add_padding","text":"","code":"add_padding(sample(1:200,5),tail=\"AA\",lead=c(2,3,\"e\")) #> [1] \"2173AA\" \"3151AA\" \"e063AA\" \"2102AA\" \"3111AA\""},{"path":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/reference/chunks_of_n.html","id":null,"dir":"Reference","previous_headings":"","what":"MOVED Split to chunks of size n — chunks_of_n","title":"MOVED Split to chunks of size n — chunks_of_n","text":"MOVED Split chunks size n","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/chunks_of_n.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"MOVED Split to chunks of size n — chunks_of_n","text":"","code":"chunks_of_n(d, n, label = NULL, even = FALSE, pattern = NULL)"},{"path":"https://agdamsbo.github.io/stRoke/reference/chunks_of_n.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"MOVED Split to chunks of size n — chunks_of_n","text":"d data. Can vector data frame. n number chunks label naming prefix chunk names even boolean set size chunks evenly distributed. pattern regex pattern extract names provided vector. data frame, assume first column name.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/chunks_of_n.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"MOVED Split to chunks of size n — chunks_of_n","text":"List length n","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/chunks_of_n.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"MOVED Split to chunks of size n — chunks_of_n","text":"","code":"tail(chunks_of_n(seq_len(100),7),3) #> $`13` #> [1] 85 86 87 88 89 90 91 #> #> $`14` #> [1] 92 93 94 95 96 97 98 #> #> $`15` #> [1] 99 100 #> tail(chunks_of_n(seq_len(100),7,even=TRUE),3) #> $`13` #> [1] 83 84 85 86 87 88 #> #> $`14` #> [1] 89 90 91 92 93 94 #> #> $`15` #> [1] 95 96 97 98 99 100 #> ds <- data.frame(nm=paste0(\"Sub\", add_padding(rownames(stRoke::talos))),stRoke::talos) head(chunks_of_n(ds,7,pattern=\"Sub[0-9]{3}\",label=\"grp\"),2) #> $`grp-Sub038-Sub011` #> nm rtreat mrs_1 mrs_6 hypertension diabetes civil #> 38 Sub038 Active 1 1 no no partner #> 434 Sub434 Active 1 1 yes no partner #> 588 Sub588 Active 2 2 yes no partner #> 42 Sub042 Active 0 0 yes no partner #> 160 Sub160 Placebo 1 1 yes no partner #> 174 Sub174 Active 0 1 yes no alone #> 11 Sub011 Placebo 2 1 yes yes alone #> #> $`grp-Sub601-Sub062` #> nm rtreat mrs_1 mrs_6 hypertension diabetes civil #> 601 Sub601 Placebo 1 1 no no partner #> 412 Sub412 Active 0 0 yes no partner #> 88 Sub088 Placebo 1 1 yes yes partner #> 56 Sub056 Placebo 0 0 no no alone #> 235 Sub235 Placebo 2 1 yes yes alone #> 205 Sub205 Active 3 3 no no partner #> 62 Sub062 Active 2 2 yes no alone #> ## Please notice that no sorting is performed. This is on purpose to preserve ## original sorting. If sorting is intended, try something like this: ds[order(ds$nm),] |> chunks_of_n(7,pattern=\"Sub[0-9]{3}\",label=\"grp\") |> head(2) #> $`grp-Sub001-Sub020` #> nm rtreat mrs_1 mrs_6 hypertension diabetes civil #> 1 Sub001 Placebo 0 0 yes no partner #> 2 Sub002 Placebo 2 1 no no partner #> 7 Sub007 Placebo 1 1 yes no partner #> 9 Sub009 Placebo 1 1 no no partner #> 11 Sub011 Placebo 2 1 yes yes alone #> 13 Sub013 Active 1 1 yes no partner #> 20 Sub020 Placebo 1 2 no no alone #> #> $`grp-Sub022-Sub038` #> nm rtreat mrs_1 mrs_6 hypertension diabetes civil #> 22 Sub022 Placebo 2 1 no no partner #> 26 Sub026 Placebo 2 4 no no alone #> 28 Sub028 Active 2 2 yes no partner #> 29 Sub029 Placebo 2 2 no no alone #> 33 Sub033 Placebo 0 0 yes no alone #> 34 Sub034 Active 1 1 no no alone #> 38 Sub038 Active 1 1 no no partner #>"},{"path":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/reference/color_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot color examples with contrasting text — color_plot","title":"Plot color examples with contrasting text — color_plot","text":"Plots color examples contrasting text. Parameters passed contrast_text.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/color_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot color examples with contrasting text — color_plot","text":"","code":"color_plot( colors, labels = TRUE, borders = NULL, cex_label = 1, ncol = NULL, ... )"},{"path":"https://agdamsbo.github.io/stRoke/reference/color_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot color examples with contrasting text — color_plot","text":"colors Vector colors plot labels Show color names. Default TRUE borders Border parameter 'rect()' function. Default NULL cex_label Label size. Default 1. ncol Desired number columns. Default ceiling square root length 'colors' vector provided. ... Parameters ","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/color_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot color examples with contrasting text — color_plot","text":"base plot","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/color_plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot color examples with contrasting text — color_plot","text":"","code":"par(bg=NULL) #> named list() colors <- sample(colors(),size = 20) color_plot(colors, method=\"relative\")"},{"path":"https://agdamsbo.github.io/stRoke/reference/contrast_text.html","id":null,"dir":"Reference","previous_headings":"","what":"MOVED Contrast Text Color — contrast_text","title":"MOVED Contrast Text Color — contrast_text","text":"Calculates best contrast text color given background color.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/contrast_text.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"MOVED Contrast Text Color — contrast_text","text":"","code":"contrast_text( background, light_text = \"white\", dark_text = \"black\", threshold = 0.5, method = \"perceived_2\", ... )"},{"path":"https://agdamsbo.github.io/stRoke/reference/contrast_text.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"MOVED 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\") ... parameter overflow. Ignored.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/contrast_text.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"MOVED Contrast Text Color — contrast_text","text":"character string contains best contrast text color.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/contrast_text.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"MOVED 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":"https://agdamsbo.github.io/stRoke/reference/contrast_text.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"MOVED 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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/reference/cpr_check.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CPR check — cpr_check","text":"","code":"cpr_check(cpr)"},{"path":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/reference/cpr_check.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CPR check — cpr_check","text":"Logical vector cpr validity","code":""},{"path":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/reference/ds2dd.html","id":null,"dir":"Reference","previous_headings":"","what":"DEPRECATED Moved to REDCapCAST::ds2dd() | Data set to data dictionary function — ds2dd","title":"DEPRECATED Moved to REDCapCAST::ds2dd() | Data set to data dictionary function — ds2dd","text":"DEPRECATED Moved REDCapCAST::ds2dd() | Data set data dictionary function","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/ds2dd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"DEPRECATED Moved to REDCapCAST::ds2dd() | 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, metadata = stRoke::metadata_names )"},{"path":"https://agdamsbo.github.io/stRoke/reference/ds2dd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"DEPRECATED Moved to REDCapCAST::ds2dd() | 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. metadata Metadata dataframe. Default included stRoke::metadata_names.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/ds2dd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"DEPRECATED Moved to REDCapCAST::ds2dd() | Data set to data dictionary function — ds2dd","text":"data.frame list data.frame vector","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/ds2dd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"DEPRECATED Moved to REDCapCAST::ds2dd() | 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":"https://agdamsbo.github.io/stRoke/reference/files_filter.html","id":null,"dir":"Reference","previous_headings":"","what":"MOVED Filter files in a folder — files_filter","title":"MOVED Filter files in a folder — files_filter","text":"function filters files folder based provided filter.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/files_filter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"MOVED Filter files in a folder — files_filter","text":"","code":"files_filter(folder.path, filter.by, full.names = TRUE)"},{"path":"https://agdamsbo.github.io/stRoke/reference/files_filter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"MOVED 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":"https://agdamsbo.github.io/stRoke/reference/files_filter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"MOVED Filter files in a folder — files_filter","text":"character vector. Filtered files","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/files_filter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"MOVED 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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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: 0x55aed9403ea8> #> #> [[2]] #> diabetes ~ \"Known diabetes\" #> <environment: 0x55aed9403ea8> #> #> [[3]] #> mrs_1 ~ \"One month mRS\" #> <environment: 0x55aed9403ea8> #> ## With gtsummary::tbl_summary() #stRoke::talos[vars] |> #gtsummary::tbl_summary(label = label_select(labels_all,vars))"},{"path":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/reference/mfi_domains.html","id":null,"dir":"Reference","previous_headings":"","what":"MFI domain score calculator — mfi_domains","title":"MFI domain score calculator — mfi_domains","text":"MFI domain score calculator","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/mfi_domains.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"MFI domain score calculator — mfi_domains","text":"","code":"mfi_domains( ds, reverse = TRUE, reverse.vars = c(2, 5, 9, 10, 13, 14, 16, 17, 18, 19) )"},{"path":"https://agdamsbo.github.io/stRoke/reference/mfi_domains.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"MFI domain score calculator — mfi_domains","text":"ds data set MFI scores, 20 columns reverse reverse scoring reverse.vars variables/columns reverse","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/mfi_domains.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"MFI domain score calculator — mfi_domains","text":"tibble domain scores","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/mfi_domains.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"MFI domain score calculator — mfi_domains","text":"","code":"mfi_mess <- data.frame(matrix( sample(c(\" 1. \", \"2. -A\", \"3.\", \" 4 \", \"5.\", NA),200,replace=TRUE),ncol=20)) mfi_mess |> mfi_domains() #> # A tibble: 10 × 5 #> act gen men mot phy #> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 15 13 NA NA 10 #> 2 NA NA NA 12 NA #> 3 NA 10 NA 9 10 #> 4 16 NA 14 9 13 #> 5 15 14 NA NA NA #> 6 9 14 11 NA NA #> 7 9 13 12 17 NA #> 8 12 NA NA 9 NA #> 9 10 12 NA 16 8 #> 10 18 NA 14 NA 20"},{"path":"https://agdamsbo.github.io/stRoke/reference/multi_rev.html","id":null,"dir":"Reference","previous_headings":"","what":"Reverses relevant MFI subscores — multi_rev","title":"Reverses relevant MFI subscores — multi_rev","text":"Reverses relevant MFI subscores","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/multi_rev.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reverses relevant MFI subscores — multi_rev","text":"","code":"multi_rev(d, var)"},{"path":"https://agdamsbo.github.io/stRoke/reference/multi_rev.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reverses relevant MFI subscores — multi_rev","text":"d data frame tibble var numeric vector indices columns reverse","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/multi_rev.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reverses relevant MFI subscores — multi_rev","text":"data.frame tibble depending input","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/multi_rev.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reverses relevant MFI subscores — multi_rev","text":"","code":"# rep_len(sample(1:5),length.out = 100) |> matrix(ncol=10) |> multi_rev(2:4)"},{"path":"https://agdamsbo.github.io/stRoke/reference/n_chunks.html","id":null,"dir":"Reference","previous_headings":"","what":"Splits in n chunks — n_chunks","title":"Splits in n chunks — n_chunks","text":"Splits n chunks","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/n_chunks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Splits in n chunks — n_chunks","text":"","code":"n_chunks(d, n, ...)"},{"path":"https://agdamsbo.github.io/stRoke/reference/n_chunks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Splits in n chunks — n_chunks","text":"d data n number chunks ... arguments passed internal chunks_of_n()","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/n_chunks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Splits in n chunks — n_chunks","text":"List chunks","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/n_chunks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Splits in n chunks — n_chunks","text":"","code":"lengths(n_chunks(d=seq_len(100),n=7,even=TRUE)) #> 1 2 3 4 5 6 7 #> 15 15 14 14 14 14 14 lengths(n_chunks(d=seq_len(100),n=7,even=FALSE)) #> 1 2 3 4 5 6 7 #> 15 15 15 15 15 15 10"},{"path":"https://agdamsbo.github.io/stRoke/reference/pase.html","id":null,"dir":"Reference","previous_headings":"","what":"Data frame with sample data of PASE score questionnaire — pase","title":"Data frame with sample data of PASE score questionnaire — pase","text":"Contains non-identifiable organic trial data. Sample data labels Danish.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/pase.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Data frame with sample data of PASE score questionnaire — pase","text":"","code":"data(pase)"},{"path":"https://agdamsbo.github.io/stRoke/reference/pase.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Data frame with sample data of PASE score questionnaire — pase","text":"data frame 200 rows 21 variables: sample_pase01 item 01, factor sample_pase01b item 01b, factor sample_pase02 item 02, factor sample_pase02a item 02a, factor sample_pase03 item 03, factor sample_pase03b item 03b, factor sample_pase04 item 04, factor sample_pase04b item 04b, factor sample_pase05 item 05, factor sample_pase05b item 05b, factor sample_pase06 item 06, factor sample_pase06b item 06b, factor sample_pase07 item 07, factor sample_pase08 item 08, factor sample_pase09a item 09a, factor sample_pase09b item 09b, factor sample_pase09c item 09c, factor sample_pase09d item 09d, factor sample_pase10 item 10, factor sample_pase10a item 10a, numeric sample_pase10b item 10b, factor","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/pase_calc.html","id":null,"dir":"Reference","previous_headings":"","what":"PASE score calculator — pase_calc","title":"PASE score calculator — pase_calc","text":"Calculates PASE score raw questionnaire data.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/pase_calc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"PASE score calculator — pase_calc","text":"","code":"pase_calc(ds, adjust_work = FALSE, consider.missing = c(\"Not available\"))"},{"path":"https://agdamsbo.github.io/stRoke/reference/pase_calc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"PASE score calculator — pase_calc","text":"ds data set adjust_work flag set whether include 10b type 1. consider.missing character vector values considered missing. Default TRUE.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/pase_calc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"PASE score calculator — pase_calc","text":"data.frame","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/pase_calc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"PASE score calculator — pase_calc","text":"Labelling defined questionnaire. 02-06 start 0:3, 02a-06b start 1:4.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/pase_calc.html","id":"regarding-work-scoring","dir":"Reference","previous_headings":"","what":"Regarding work scoring","title":"PASE score calculator — pase_calc","text":"score calculation manual available PASE questionnaire, types work included. According article Washburn RA. et al (1999) sitting work included item 10 score. differentiation added option set adjust_work exclude item 10b category 1 work (set TRUE).","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/pase_calc.html","id":"regarding-output","dir":"Reference","previous_headings":"","what":"Regarding output","title":"PASE score calculator — pase_calc","text":"Output includes sub scores well sums, also columns assessing data quality completeness. field filled, score_incompletes return TRUE. measures missing score_missings TRUE. adjust_work==TRUE, 10b filled, score_incompletes set TRUE.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/pase_calc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"PASE score calculator — pase_calc","text":"","code":"summary(pase_calc(stRoke::pase)[,13]) #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 0.0 75.0 128.6 138.9 195.9 574.3 str(pase_calc(stRoke::pase)) #> 'data.frame':\t642 obs. of 15 variables: #> $ pase_score_02 : num 85.8 5 25.8 25.8 2.2 15 0 51.4 51.4 15 ... #> $ pase_score_03 : num 53.97 0 6.72 2.31 2.31 ... #> $ pase_score_04 : num 98.67 0 0 0 2.53 ... #> $ pase_score_05 : num 0 0 0 0 0 0 0 0 0 0 ... #> $ pase_score_06 : num 0 0 0 0 0 0 0 0 0 0 ... #> $ pase_score_07 : num 25 25 25 25 25 25 25 25 25 0 ... #> $ pase_score_08 : num 25 0 25 25 25 0 25 25 25 0 ... #> $ pase_score_09a : num 0 0 0 0 0 0 0 0 0 0 ... #> $ pase_score_09b : num 36 0 0 36 0 0 0 0 36 0 ... #> $ pase_score_09c : num 20 0 20 20 0 0 0 0 20 0 ... #> $ pase_score_09d : num 0 35 35 35 0 0 0 0 0 0 ... #> $ pase_score_10 : num 12 NA NA 105 9 NA NA 240 NA NA ... #> $ pase_score_sum : num 356 65 138 274 66 ... #> $ pase_score_missings : logi FALSE FALSE FALSE FALSE FALSE FALSE ... #> $ pase_score_incompletes: logi FALSE FALSE FALSE FALSE FALSE FALSE ..."},{"path":"https://agdamsbo.github.io/stRoke/reference/print.win_Prob.html","id":null,"dir":"Reference","previous_headings":"","what":"Prints win_prob results — print.win_Prob","title":"Prints win_prob results — print.win_Prob","text":"Prints win_prob results","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/print.win_Prob.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prints win_prob results — print.win_Prob","text":"","code":"# S3 method for class 'win_Prob' print(x, ...)"},{"path":"https://agdamsbo.github.io/stRoke/reference/print.win_Prob.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prints win_prob results — print.win_Prob","text":"x win_prob results. ... ignored now","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/print.win_Prob.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prints win_prob results — print.win_Prob","text":"Prints win_prob statistics.","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/quantile_cut.html","id":null,"dir":"Reference","previous_headings":"","what":"MOVED Easy function for splitting numeric variable in quantiles — quantile_cut","title":"MOVED Easy function for splitting numeric variable in quantiles — quantile_cut","text":"Using base/stats functions cut() quantile().","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/quantile_cut.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"MOVED 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":"https://agdamsbo.github.io/stRoke/reference/quantile_cut.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"MOVED 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":"https://agdamsbo.github.io/stRoke/reference/quantile_cut.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"MOVED Easy function for splitting numeric variable in quantiles — quantile_cut","text":"vector list vector details (length 2)","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/quantile_cut.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"MOVED 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,245] (245,486] (486,741] (741,1e+03] #> 502 498 500 500"},{"path":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"collection tools clinical trial data management analysis 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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/reference/str_extract.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract string based on regex pattern — str_extract","title":"Extract string based on regex pattern — str_extract","text":"DEPRECATION: moved agdamsbo/project.aid","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/str_extract.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract string based on regex pattern — str_extract","text":"","code":"str_extract(d, pattern)"},{"path":"https://agdamsbo.github.io/stRoke/reference/str_extract.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract string based on regex pattern — str_extract","text":"d vector character strings pattern regex pattern match","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/str_extract.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract string based on regex pattern — str_extract","text":"vector character strings","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/str_extract.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract string based on regex pattern — str_extract","text":"Use base::strsplit ","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/str_extract.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract string based on regex pattern — str_extract","text":"","code":"ls <- do.call(c,lapply(sample(4:8,20,TRUE),function(i){ paste(sample(letters,i,TRUE),collapse = \"\")})) ds <- do.call(c,lapply(1:20,function(i){ paste(sample(ls,1),i,sample(ls,1),\"23\",sep = \"_\")})) str_extract(ds,\"([0-9]+)\") #> [1] \"1\" \"2\" \"3\" \"4\" \"5\" \"6\" \"7\" \"8\" \"9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" #> [16] \"16\" \"17\" \"18\" \"19\" \"20\""},{"path":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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\") #> \t Zou et al's winP (doi: 10.1161/STROKEAHA.121.037744) #> #> Probability of a random observation in Placebo group #> will have a higher response score than a random #> observation in Active group: #> #> \t winP: 0.400 (0.612, 0.372) p=0.0125 #> -------------------------------------------- #> #> The numbers needed to treat (NNT) are: -9 #> #> #>"},{"path":"https://agdamsbo.github.io/stRoke/reference/write_ical.html","id":null,"dir":"Reference","previous_headings":"","what":"MOVED Write ical object — write_ical","title":"MOVED Write ical object — write_ical","text":"function creates ical file based data frame mixed events. Export .ics file using calendar::ic_write().","code":""},{"path":"https://agdamsbo.github.io/stRoke/reference/write_ical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"MOVED 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":"https://agdamsbo.github.io/stRoke/reference/write_ical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"MOVED 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":"https://agdamsbo.github.io/stRoke/reference/write_ical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"MOVED Write ical object — write_ical","text":"ical object","code":""},{"path":[]},{"path":"https://agdamsbo.github.io/stRoke/reference/write_ical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"MOVED 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 LOCATION URL #> <chr> <dttm> <dttm> <chr> <chr> <chr> #> 1 Conference 2020-02-10 12:00:00 2020-02-13 13:00:00 ical-6c018f… Confere… http… #> 2 Lunch 2020-02-11 10:00:00 2020-02-11 11:00:00 ical-acc32d… Confere… http… #> # ℹ 1 more variable: DESCRIPTION <chr>"},{"path":"https://agdamsbo.github.io/stRoke/news/index.html","id":"stroke-24101","dir":"Changelog","previous_headings":"","what":"stRoke 24.10.1","title":"stRoke 24.10.1","text":"version marks significant change contents focus package. Going forward include functions focus handling clinical trial data stroke research. functions general data management project management migrated project.aid package, moving towards CRAN submission. Install dev-version pak::pak(\"agdamsbo/project.aid\").","code":""},{"path":"https://agdamsbo.github.io/stRoke/news/index.html","id":"functions-24-10-1","dir":"Changelog","previous_headings":"","what":"Functions:","title":"stRoke 24.10.1","text":"UPDATE: pase_calc() updated uniform column naming output well streamlining function bit. Moving: following functions moved agdamsbo/project.aid focus (stroke) trial related functions: str_extract(), add_padding(), age_calc(), chunks_of_n(), contrast_text(), files_filter(), quantile_cut(), write_ical(). NEW: mfi_calc() calculates domain scores MFI questionnaire. Takes data frame 20 ordered questionnaire. Default reverse questions reverse scoring. Checks set rhub v2","code":""},{"path":"https://agdamsbo.github.io/stRoke/news/index.html","id":"stroke-2391","dir":"Changelog","previous_headings":"","what":"stRoke 23.9.1","title":"stRoke 23.9.1","text":"CRAN release: 2023-09-07","code":""},{"path":"https://agdamsbo.github.io/stRoke/news/index.html","id":"functions-23-9-1","dir":"Changelog","previous_headings":"","what":"Functions:","title":"stRoke 23.9.1","text":"NEW: chunks_of_n() uses split() separate supplied vector data frame chunks n. Flags set last chunks exactly size n, evenly sized max n. Labels can provided including regex pattern subject naming include chunk names. NEW: n_chunks() opposite chunks_of_n() simply wrapper function create list n chunks based provided vector data frame. NEW: str_extract() extract substring character string given regex pattern. Came helper function labelling chunks chunks_of_n(), useful . functions exists, take using base R. Draws REDCapCAST::strsplitx(), splits can performed around pattern. NEW: add_padding() created frustration. wanted add padding using sprintf(\"%0s\",string), examples , fail rendering Windows. Say hello another function. Just small. Defaults adding leading zeros, get string equal length longer string supplied. Deprecation: ds2dd() moved REDCapCAST::ds2dd() belongs.","code":""},{"path":"https://agdamsbo.github.io/stRoke/news/index.html","id":"stroke-2363","dir":"Changelog","previous_headings":"","what":"stRoke 23.6.3","title":"stRoke 23.6.3","text":"CRAN release: 2023-07-03","code":""},{"path":"https://agdamsbo.github.io/stRoke/news/index.html","id":"bug-23-6-3","dir":"Changelog","previous_headings":"","what":"Bug","title":"stRoke 23.6.3","text":"Fixed ds2dd() bug first practical implementation.","code":""},{"path":[]},{"path":"https://agdamsbo.github.io/stRoke/news/index.html","id":"functions-23-6-2","dir":"Changelog","previous_headings":"","what":"Functions:","title":"stRoke 23.6.2","text":"NEW: pase_calc() function calculates PASE scores raw questionnaire data. Gives sub scores well returns basic data quality completeness checks. Acknowledges difference scoring manual article Washburn PA. et al. (1999) including sitting work score calculations.","code":""},{"path":"https://agdamsbo.github.io/stRoke/news/index.html","id":"data-23-6-2","dir":"Changelog","previous_headings":"","what":"Data:","title":"stRoke 23.6.2","text":"NEW: pase sample questionnaire data. Non-identifiable use pase_calc() function.","code":""},{"path":[]},{"path":"https://agdamsbo.github.io/stRoke/news/index.html","id":"functions-23-6-1","dir":"Changelog","previous_headings":"","what":"Functions:","title":"stRoke 23.6.1","text":"NEW: ‘color_plot()’ function implements ‘contrast_text()’ much inspired ‘scales::show_col()’. Passes arguments internal ‘contrast_text()’. Tests . Took way longer intended.","code":""},{"path":"https://agdamsbo.github.io/stRoke/news/index.html","id":"stroke-2341","dir":"Changelog","previous_headings":"","what":"stRoke 23.4.1","title":"stRoke 23.4.1","text":"CRAN release: 2023-04-13","code":""},{"path":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":"https://agdamsbo.github.io/stRoke/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":""}]
|