Create a reference matrix, useful for visualisation, with evenly spread and combined values.
visualisation_matrix( x, target = "all", length = 10, factors = "reference", numerics = "mean", preserve_range = FALSE, standardize = FALSE, standardize_robust = FALSE, reference = x, na.rm = TRUE, ... )
| x | An object from which to construct the reference grid. |
|---|---|
| target | Can be "all" or list of characters indicating columns of interest. Can also contain assignments (e.g., |
| length | Length of numeric target variables. |
| factors | Type of summary for factors. Can be "combination" (include all unique values), "reference" (set at the reference level) or "mode" (set at the most common level). |
| numerics | Type of summary for numeric values. Can be "combination" (include all unique values), any function ("mean", "median", ...) or a value (e.g., |
| preserve_range | In the case of combinations between numeric variables and factors, setting |
| standardize | The numeric target value is spread as deviations from the mean, with the central value being the mean (or the median if |
| standardize_robust | Standardization based on median and MAD (a robust equivalent of the SD). |
| reference | The reference vector from which to compute the mean and SD. |
| na.rm | Remove NaNs. |
| ... | Arguments passed to or from other methods. |
Reference grid data frame.
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 4.3 3.053147 3.804196 1.21958 setosa #> 2 4.7 3.053147 3.804196 1.21958 setosa #> 3 5.1 3.053147 3.804196 1.21958 setosa #> 4 5.5 3.053147 3.804196 1.21958 setosa #> 5 5.9 3.053147 3.804196 1.21958 setosa #> 6 6.3 3.053147 3.804196 1.21958 setosa #> 7 6.7 3.053147 3.804196 1.21958 setosa #> 8 7.1 3.053147 3.804196 1.21958 setosa #> 9 7.5 3.053147 3.804196 1.21958 setosa #> 10 7.9 3.053147 3.804196 1.21958 setosavisualisation_matrix(iris, target = "Sepal.Length", factors = "combinations")#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 4.3 3.053147 3.804196 1.21958 setosa #> 2 4.7 3.053147 3.804196 1.21958 setosa #> 3 5.1 3.053147 3.804196 1.21958 setosa #> 4 5.5 3.053147 3.804196 1.21958 setosa #> 5 5.9 3.053147 3.804196 1.21958 setosa #> 6 6.3 3.053147 3.804196 1.21958 setosa #> 7 6.7 3.053147 3.804196 1.21958 setosa #> 8 7.1 3.053147 3.804196 1.21958 setosa #> 9 7.5 3.053147 3.804196 1.21958 setosa #> 10 7.9 3.053147 3.804196 1.21958 setosa #> 11 4.3 3.053147 3.804196 1.21958 versicolor #> 12 4.7 3.053147 3.804196 1.21958 versicolor #> 13 5.1 3.053147 3.804196 1.21958 versicolor #> 14 5.5 3.053147 3.804196 1.21958 versicolor #> 15 5.9 3.053147 3.804196 1.21958 versicolor #> 16 6.3 3.053147 3.804196 1.21958 versicolor #> 17 6.7 3.053147 3.804196 1.21958 versicolor #> 18 7.1 3.053147 3.804196 1.21958 versicolor #> 19 7.5 3.053147 3.804196 1.21958 versicolor #> 20 7.9 3.053147 3.804196 1.21958 versicolor #> 21 4.3 3.053147 3.804196 1.21958 virginica #> 22 4.7 3.053147 3.804196 1.21958 virginica #> 23 5.1 3.053147 3.804196 1.21958 virginica #> 24 5.5 3.053147 3.804196 1.21958 virginica #> 25 5.9 3.053147 3.804196 1.21958 virginica #> 26 6.3 3.053147 3.804196 1.21958 virginica #> 27 6.7 3.053147 3.804196 1.21958 virginica #> 28 7.1 3.053147 3.804196 1.21958 virginica #> 29 7.5 3.053147 3.804196 1.21958 virginica #> 30 7.9 3.053147 3.804196 1.21958 virginica#> Sepal.Length Species Sepal.Width Petal.Length Petal.Width #> 1 4.3 setosa 3.053147 3.804196 1.21958 #> 2 6.1 setosa 3.053147 3.804196 1.21958 #> 3 7.9 setosa 3.053147 3.804196 1.21958 #> 4 4.3 versicolor 3.053147 3.804196 1.21958 #> 5 6.1 versicolor 3.053147 3.804196 1.21958 #> 6 7.9 versicolor 3.053147 3.804196 1.21958 #> 7 4.3 virginica 3.053147 3.804196 1.21958 #> 8 6.1 virginica 3.053147 3.804196 1.21958 #> 9 7.9 virginica 3.053147 3.804196 1.21958#> Sepal.Length Species Sepal.Width Petal.Length Petal.Width #> 1 4.3 setosa 0 0 0 #> 2 4.7 setosa 0 0 0 #> 3 5.1 setosa 0 0 0 #> 4 5.5 setosa 0 0 0 #> 5 5.9 setosa 0 0 0 #> 6 6.3 setosa 0 0 0 #> 7 6.7 setosa 0 0 0 #> 8 7.1 setosa 0 0 0 #> 9 7.5 setosa 0 0 0 #> 10 7.9 setosa 0 0 0 #> 11 4.3 versicolor 0 0 0 #> 12 4.7 versicolor 0 0 0 #> 13 5.1 versicolor 0 0 0 #> 14 5.5 versicolor 0 0 0 #> 15 5.9 versicolor 0 0 0 #> 16 6.3 versicolor 0 0 0 #> 17 6.7 versicolor 0 0 0 #> 18 7.1 versicolor 0 0 0 #> 19 7.5 versicolor 0 0 0 #> 20 7.9 versicolor 0 0 0 #> 21 4.3 virginica 0 0 0 #> 22 4.7 virginica 0 0 0 #> 23 5.1 virginica 0 0 0 #> 24 5.5 virginica 0 0 0 #> 25 5.9 virginica 0 0 0 #> 26 6.3 virginica 0 0 0 #> 27 6.7 virginica 0 0 0 #> 28 7.1 virginica 0 0 0 #> 29 7.5 virginica 0 0 0 #> 30 7.9 virginica 0 0 0#> Sepal.Length Species Sepal.Width Petal.Length Petal.Width #> 1 3 setosa 3.053147 3.804196 1.21958 #> 2 3 versicolor 3.053147 3.804196 1.21958 #> 3 3 virginica 3.053147 3.804196 1.21958#> Sepal.Length Species Sepal.Width Petal.Length Petal.Width #> 1 3 setosa 3.053147 3.804196 1.21958 #> 2 1 setosa 3.053147 3.804196 1.21958visualisation_matrix(iris, target = "Sepal.Length", standardize = TRUE, length = 3)#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.015267 3.053147 3.804196 1.21958 setosa #> 2 5.843333 3.053147 3.804196 1.21958 setosa #> 3 6.671399 3.053147 3.804196 1.21958 setosa