Description Usage Arguments Functions Examples
Numerical Summary
1 2 3 4 5 | numSummary(x, ..., digits = 2, lang = "en")
numSummary1(x, ..., digits = 2, lang = "en")
numSummary2(x, ..., digits = 2, lang = "en")
|
x |
A numeric vector or a data.frame or a grouped_df |
... |
further arguments to be passed |
digits |
integer indicating the number of decimal places |
lang |
Language. choices are one of c("en","kor") |
numSummary1
: Numerical Summary of a data.frame or a vector
numSummary2
: Numerical Summary of a grouped_df
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | require(moonBook)
require(magrittr)
require(dplyr)
require(rrtable)
require(webr)
require(tibble)
numSummary(acs)
numSummary(acs$age)
numSummary(acs,age,EF)
acs %>% group_by(sex) %>% numSummary(age,BMI)
acs %>% group_by(sex) %>% select(age) %>% numSummary
acs %>% group_by(sex) %>% select(age,EF) %>% numSummary
acs %>% group_by(sex,Dx) %>% select(age,EF) %>% numSummary
acs %>% group_by(sex,Dx) %>% select(age) %>% numSummary
#acs %>% group_by(sex,Dx) %>% numSummary(age,EF,lang="kor")
|
Loading required package: moonBook
Loading required package: magrittr
Loading required package: dplyr
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
Loading required package: rrtable
Welcome to rrtable package
Register inputHandler for chooserInput
Loading required package: tibble
# A tibble: 9 x 13
vars n mean sd median trimmed mad min max range skew kurtosis
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 age 857 63.3 11.7 64 63.6 13.3 28 91 63 -0.175 -0.566
2 EF 723 55.8 9.62 58.1 56.8 7.86 18 79 61 -0.978 1.11
3 heig… 764 163. 9.08 165 164. 7.41 130 185 55 -0.440 -0.0145
4 weig… 766 64.8 11.4 65 64.5 10.4 30 112 82 0.336 0.444
5 BMI 764 24.3 3.35 24.2 24.2 3.01 15.6 41.4 25.8 0.668 2.12
6 TC 834 185. 47.8 183 184. 43.0 25 493 468 0.737 3.77
7 LDLC 833 117. 41.1 114 115. 40.0 15 366 351 0.787 2.33
8 HDLC 834 38.2 11.1 38 38.0 10.4 4 89 85 0.366 1.46
9 TG 842 125. 90.9 106. 111. 60.0 11 877 866 3.02 14.9
# … with 1 more variable: se <dbl>
# A tibble: 1 x 12
n mean sd median trimmed mad min max range skew kurtosis se
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 857 63.3 11.7 64 63.6 13.3 28 91 63 -0.175 -0.566 0.400
# A tibble: 2 x 13
vars n mean sd median trimmed mad min max range skew kurtosis
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 age 857 63.3 11.7 64 63.6 13.3 28 91 63 -0.175 -0.566
2 EF 723 55.8 9.62 58.1 56.8 7.86 18 79 61 -0.978 1.11
# … with 1 more variable: se <dbl>
# A tibble: 4 x 14
# Groups: sex [2]
sex vars n mean sd median trimmed mad min max range skew
<chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Male age 570 60.6 11.2 61 60.6 11.9 28 91 63 -0.0148
2 Male BMI 509 24.3 3.24 24.2 24.2 2.98 16.3 41.4 25.1 0.616
3 Fema… age 287 68.7 10.7 70 69.4 10.4 39 90 51 -0.593
4 Fema… BMI 255 24.2 3.56 24.0 24.1 3.13 15.6 41.2 25.6 0.751
# … with 2 more variables: kurtosis <dbl>, se <dbl>
Warning message:
`cols` is now required when using unnest().
Please use `cols = c(summary)`
Adding missing grouping variables: `sex`
# A tibble: 2 x 13
# Groups: sex [2]
sex n mean sd median trimmed mad min max range skew
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Male 570 60.6 11.2 61 60.6 11.9 28 91 63 -0.0148
2 Fema… 287 68.7 10.7 70 69.4 10.4 39 90 51 -0.593
# … with 2 more variables: kurtosis <dbl>, se <dbl>
Warning message:
`cols` is now required when using unnest().
Please use `cols = c(summary)`
Adding missing grouping variables: `sex`
# A tibble: 4 x 14
# Groups: sex [2]
sex vars n mean sd median trimmed mad min max range skew
<chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Male age 570 60.6 11.2 61 60.6 11.9 28 91 63 -0.0148
2 Male EF 483 55.6 9.40 57.3 56.4 8.01 18 79 61 -0.789
3 Fema… age 287 68.7 10.7 70 69.4 10.4 39 90 51 -0.593
4 Fema… EF 240 56.3 10.1 59.2 57.6 7.19 18.4 75 56.6 -1.30
# … with 2 more variables: kurtosis <dbl>, se <dbl>
Warning message:
`cols` is now required when using unnest().
Please use `cols = c(summary)`
Adding missing grouping variables: `sex`, `Dx`
# A tibble: 12 x 15
# Groups: sex, Dx [6]
sex Dx vars n mean sd median trimmed mad min max range
<chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Male STEMI age 220 59.4 11.7 59.5 59.4 11.1 30 86 56
2 Male STEMI EF 195 52.4 8.90 54 52.9 8.45 18 73.6 55.6
3 Fema… STEMI age 84 69.1 10.4 70 70.0 10.4 42 89 47
4 Fema… STEMI EF 77 52.3 10.9 55.7 53.7 9.04 18.4 67.1 48.7
5 Male NSTE… age 103 61.1 11.6 59 61.3 13.3 28 85 57
6 Male NSTE… EF 94 55.1 9.42 58 55.9 7.12 21.8 74 52.2
7 Fema… Unst… age 153 67.7 10.7 70 68.3 8.90 39 90 51
8 Fema… Unst… EF 118 59.4 8.76 61.1 60.8 5.49 22 71.9 49.9
9 Male Unst… age 247 61.4 10.6 61 61.4 10.4 35 91 56
10 Male Unst… EF 194 59.1 8.67 60 60.2 5.93 24.7 79 54.3
11 Fema… NSTE… age 50 70.9 11.4 74.5 71.9 8.90 42 88 46
12 Fema… NSTE… EF 45 54.8 9.10 57 55.3 9.79 36.8 75 38.2
# … with 3 more variables: skew <dbl>, kurtosis <dbl>, se <dbl>
Warning message:
`cols` is now required when using unnest().
Please use `cols = c(summary)`
Adding missing grouping variables: `sex`, `Dx`
# A tibble: 6 x 14
# Groups: sex, Dx [6]
sex Dx n mean sd median trimmed mad min max range skew
<chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Male STEMI 220 59.4 11.7 59.5 59.4 11.1 30 86 56 0.00433
2 Fema… STEMI 84 69.1 10.4 70 70.0 10.4 42 89 47 -0.654
3 Male NSTE… 103 61.1 11.6 59 61.3 13.3 28 85 57 -0.110
4 Fema… Unst… 153 67.7 10.7 70 68.3 8.90 39 90 51 -0.540
5 Male Unst… 247 61.4 10.6 61 61.4 10.4 35 91 56 0.0710
6 Fema… NSTE… 50 70.9 11.4 74.5 71.9 8.90 42 88 46 -0.721
# … with 2 more variables: kurtosis <dbl>, se <dbl>
Warning message:
`cols` is now required when using unnest().
Please use `cols = c(summary)`
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.