From 9d600bf1711a286c7c86808ddd47b0f4bc332ed0 Mon Sep 17 00:00:00 2001 From: agdamsbo <43278243+agdamsbo@users.noreply.github.com> Date: Tue, 5 Sep 2023 17:11:47 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20agdamsbo?= =?UTF-8?q?/stRoke@aed6ef02b0abf271112c697709db35829a1f9b3b=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 2 +- articles/ds2dd.html | 4 +- articles/index.html | 2 +- articles/toolbox.html | 110 +++++++-------- authors.html | 2 +- deps/bootstrap-5.2.2/bootstrap.min.css | 4 +- index.html | 2 +- news/index.html | 14 +- pkgdown.yml | 2 +- reference/age_calc.html | 2 +- reference/chunks_of_n.html | 184 +++++++++++++++++++++++++ reference/ci_plot.html | 2 +- reference/color_plot-1.png | Bin 69695 -> 63907 bytes reference/color_plot.html | 2 +- reference/contrast_text.html | 2 +- reference/cpr_check.html | 2 +- reference/cpr_dob.html | 2 +- reference/cpr_female.html | 2 +- reference/cprs.html | 2 +- reference/ds2dd.html | 8 +- reference/files_filter.html | 2 +- reference/generic_stroke.html | 2 +- reference/index.html | 19 ++- reference/index_plot.html | 2 +- reference/label_select.html | 8 +- reference/metadata_names.html | 2 +- reference/n_chunks.html | 114 +++++++++++++++ reference/pase.html | 2 +- reference/pase_calc.html | 2 +- reference/print.win_Prob.html | 2 +- reference/quantile_cut.html | 6 +- reference/score.html | 2 +- reference/source_lines.html | 2 +- reference/stRoke-package.html | 2 +- reference/str_extract.html | 111 +++++++++++++++ reference/talos.html | 2 +- reference/win_prob.html | 2 +- reference/write_ical.html | 6 +- search.json | 2 +- sitemap.xml | 9 ++ 40 files changed, 546 insertions(+), 103 deletions(-) create mode 100644 reference/chunks_of_n.html create mode 100644 reference/n_chunks.html create mode 100644 reference/str_extract.html diff --git a/404.html b/404.html index 6ac6249..a6637e8 100644 --- a/404.html +++ b/404.html @@ -31,7 +31,7 @@ stRoke - 23.6.3 + 23.9.1 + + + + + +
+
+
+ +
+

Split to chunks of size n

+
+ +
+

Usage

+
chunks_of_n(d, n, label = NULL, even = FALSE, pattern = NULL)
+
+ +
+

Arguments

+
d
+

data. Can be vector or data frame.

+ + +
n
+

number of chunks

+ + +
label
+

naming prefix for chunk names

+ + +
even
+

boolean to set if size of chunks should be evenly distributed.

+ + +
pattern
+

regex pattern to extract names from provided vector. If data +frame, will assume first column is name.

+ +
+
+

Value

+ + +

List of length n

+
+ +
+

Examples

+
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",
+sprintf("%03s", rownames(stRoke::talos))),stRoke::talos)
+head(chunks_of_n(ds,7,pattern="Sub[0-9]{3}",label="grp"),2)
+#> $`grp-NA-NA`
+#>         nm  rtreat mrs_1 mrs_6 hypertension diabetes   civil
+#> 38  Sub 38  Active     1     1           no       no partner
+#> 434 Sub434  Active     1     1          yes       no partner
+#> 588 Sub588  Active     2     2          yes       no partner
+#> 42  Sub 42  Active     0     0          yes       no partner
+#> 160 Sub160 Placebo     1     1          yes       no partner
+#> 174 Sub174  Active     0     1          yes       no   alone
+#> 11  Sub 11 Placebo     2     1          yes      yes   alone
+#> 
+#> $`grp-Sub601-NA`
+#>         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  Sub 88 Placebo     1     1          yes      yes partner
+#> 56  Sub 56 Placebo     0     0           no       no   alone
+#> 235 Sub235 Placebo     2     1          yes      yes   alone
+#> 205 Sub205  Active     3     3           no       no partner
+#> 62  Sub 62  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-NA-NA`
+#>        nm  rtreat mrs_1 mrs_6 hypertension diabetes   civil
+#> 1  Sub  1 Placebo     0     0          yes       no partner
+#> 2  Sub  2 Placebo     2     1           no       no partner
+#> 7  Sub  7 Placebo     1     1          yes       no partner
+#> 9  Sub  9 Placebo     1     1           no       no partner
+#> 11 Sub 11 Placebo     2     1          yes      yes   alone
+#> 13 Sub 13  Active     1     1          yes       no partner
+#> 20 Sub 20 Placebo     1     2           no       no   alone
+#> 
+#> $`grp-NA-NA`
+#>        nm  rtreat mrs_1 mrs_6 hypertension diabetes   civil
+#> 22 Sub 22 Placebo     2     1           no       no partner
+#> 26 Sub 26 Placebo     2     4           no       no   alone
+#> 28 Sub 28  Active     2     2          yes       no partner
+#> 29 Sub 29 Placebo     2     2           no       no   alone
+#> 33 Sub 33 Placebo     0     0          yes       no   alone
+#> 34 Sub 34  Active     1     1           no       no   alone
+#> 38 Sub 38  Active     1     1           no       no partner
+#> 
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/reference/ci_plot.html b/reference/ci_plot.html index f89efdb..359cd12 100644 --- a/reference/ci_plot.html +++ b/reference/ci_plot.html @@ -14,7 +14,7 @@ Title and axis labels can be added to the ggplot afterwards.'>stRoke - 23.6.3 + 23.9.1 + + + + + +
+
+
+ +
+

Splits in n chunks

+
+ +
+

Usage

+
n_chunks(d, n, ...)
+
+ +
+

Arguments

+
d
+

data

+ + +
n
+

number of chunks

+ + +
...
+

arguments passed to internal chunks_of_n()

+ +
+
+

Value

+ + +

List of chunks

+
+ +
+

Examples

+
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 
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/reference/pase.html b/reference/pase.html index 0ec92d0..5e82358 100644 --- a/reference/pase.html +++ b/reference/pase.html @@ -12,7 +12,7 @@ Sample data labels are in Danish.">stRoke - 23.6.3 + 23.9.1
+ + + + + +
+
+
+ +
+

Use base::strsplit to

+
+ +
+

Usage

+
str_extract(d, pattern)
+
+ +
+

Arguments

+
d
+

vector of character strings

+ + +
pattern
+

regex pattern to match

+ +
+
+

Value

+ + +

vector of character strings

+
+ +
+

Examples

+
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"
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/reference/talos.html b/reference/talos.html index e6938ec..45d29b5 100644 --- a/reference/talos.html +++ b/reference/talos.html @@ -10,7 +10,7 @@ stRoke - 23.6.3 + 23.9.1