Generates a table of the correlations and means of numeric columns in a data frame. If data was generated by sim_design and has a "design" attribute, between, within, dv and id are retrieved from that, unless overridden (use between = 0 to

get_params(
  data,
  between = NULL,
  within = NULL,
  dv = NULL,
  id = NULL,
  digits = 2
)

check_sim_stats(
  data,
  between = NULL,
  within = NULL,
  dv = NULL,
  id = NULL,
  digits = 2
)

Arguments

data

the existing tbl

between

a vector of column names for between-subject factors

within

a vector of column names for within-subject factors (if data is long)

dv

the column name(s) of the dv, if NULL all numeric columns will be selected

id

the column name(s) of the subject ID, excluded from the table even if numeric

digits

how many digits to round to (default = 2)

Value

a tbl of correlations, means and sds

Examples

get_params(iris, "Species")
#>       Species  n          var Sepal.Length Sepal.Width Petal.Length Petal.Width
#> 1      setosa 50 Sepal.Length         1.00        0.74         0.27        0.28
#> 2      setosa 50  Sepal.Width         0.74        1.00         0.18        0.23
#> 3      setosa 50 Petal.Length         0.27        0.18         1.00        0.33
#> 4      setosa 50  Petal.Width         0.28        0.23         0.33        1.00
#> 5  versicolor 50 Sepal.Length         1.00        0.53         0.75        0.55
#> 6  versicolor 50  Sepal.Width         0.53        1.00         0.56        0.66
#> 7  versicolor 50 Petal.Length         0.75        0.56         1.00        0.79
#> 8  versicolor 50  Petal.Width         0.55        0.66         0.79        1.00
#> 9   virginica 50 Sepal.Length         1.00        0.46         0.86        0.28
#> 10  virginica 50  Sepal.Width         0.46        1.00         0.40        0.54
#> 11  virginica 50 Petal.Length         0.86        0.40         1.00        0.32
#> 12  virginica 50  Petal.Width         0.28        0.54         0.32        1.00
#>    mean   sd
#> 1  5.01 0.35
#> 2  3.43 0.38
#> 3  1.46 0.17
#> 4  0.25 0.11
#> 5  5.94 0.52
#> 6  2.77 0.31
#> 7  4.26 0.47
#> 8  1.33 0.20
#> 9  6.59 0.64
#> 10 2.97 0.32
#> 11 5.55 0.55
#> 12 2.03 0.27