diff --git a/R/geom-isoline.r b/R/geom-isoline.r index 7ec1fce..6b3795c 100644 --- a/R/geom-isoline.r +++ b/R/geom-isoline.r @@ -27,14 +27,9 @@ #' - `vjust` #' - `family` #' - `fontface` -#' - `text_colour`, `text_alpha`, `text_size`, `text_angle`, #' - `group` #' -#' The prefixed aesthetics `text_*` are used by the text elements and will -#' inherit any values passed to their un-prefixed counterparts. -#' - #' @import ggplot2 #' @inheritParams ggplot2::layer #' @template param-geom @@ -45,6 +40,9 @@ #' one. #' @param text_dodge Numeric; the orthogonal distance of the text from the axis #' or isoline, as a proportion of the minimum of the plot width and height. +#' @param text.size,text.angle,text.colour,text.color,text.alpha Default +#' aesthetics for tick mark labels. Set to NULL to inherit from the data's +#' aesthetics. #' @template return-layer #' @family geom layers #' @example inst/examples/ex-geom-isoline.r @@ -55,6 +53,8 @@ geom_isoline <- function( by = NULL, num = NULL, text_dodge = .03, ..., + text.size = 3, text.angle = 0, + text.colour = NULL, text.color = NULL, text.alpha = NULL, parse = FALSE, check_overlap = FALSE, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE @@ -71,6 +71,10 @@ geom_isoline <- function( isoline_text = isoline_text, by = by, num = num, text_dodge = text_dodge, + text.size = text.size, + text.angle = text.angle, + text.colour = text.color %||% text.colour, + text.alpha = text.alpha, parse = parse, check_overlap = check_overlap, na.rm = na.rm, @@ -93,12 +97,10 @@ GeomIsoline <- ggproto( # isoline colour = "black", alpha = .8, linewidth = .5, linetype = "dashed", - # mark needs - center = 0, scale = 1, - # isoline mark text - text_colour = "black", text_alpha = .8, text_size = 3, text_angle = 0, hjust = "inward", vjust = 1, - family = "", fontface = 1 + family = "", fontface = 1, + # mark needs + center = 0, scale = 1 ), setup_params = function(data, params) { @@ -129,6 +131,8 @@ GeomIsoline <- ggproto( isoline_text = TRUE, by = NULL, num = NULL, text_dodge = .03, + text.size = 3, text.angle = 0, + text.colour = NULL, text.color = NULL, text.alpha = NULL, parse = FALSE, check_overlap = FALSE, na.rm = TRUE ) { @@ -166,6 +170,11 @@ GeomIsoline <- ggproto( if (isoline_text) { text_data <- data + # specify independent aesthetics + text_data$size <- text.size %||% text_data$size + # text_data$angle <- text.angle %||% text_data$angle + text_data$colour <- text.colour %||% text_data$colour + text_data$alpha <- text.alpha %||% text_data$alpha # omit labels at origin text_data <- subset(text_data, x_t != 0 | y_t != 0) @@ -181,14 +190,9 @@ GeomIsoline <- ggproto( # update text angle and put in degrees text_data <- transform( text_data, - angle = (atan(- 1 / tan(angle)) + text_angle) * 180 / pi + angle = (atan(- 1 / tan(angle)) + text.angle) * 180 / pi ) - # specify aesthetics - text_data$colour <- text_data$text_colour - text_data$alpha <- text_data$text_alpha - text_data$size <- text_data$text_size - # isoline text grobs grobs <- c(grobs, list(GeomText$draw_panel( data = text_data, panel_params = panel_params, coord = coord, diff --git a/R/geom-vector.r b/R/geom-vector.r index 19c6d05..f829994 100644 --- a/R/geom-vector.r +++ b/R/geom-vector.r @@ -31,9 +31,12 @@ #' - `linetype` #' - `label` #' - `size` -#' - `angle`, `hjust`, `vjust` -#' - `label_colour`, `label_alpha` -#' - `family`, `fontface`, `lineheight` +#' - `angle` +#' - `hjust` +#' - `vjust` +#' - `family` +#' - `fontface` +#' - `lineheight` #' - `group` #' @@ -47,6 +50,8 @@ #' `NULL` for no arrows. #' @param vector_labels Logical; whether to include labels radiating outward #' from the vectors. +#' @param label.colour,label.color,label.alpha Default aesthetics for labels. +#' Set to NULL to inherit from the data's aesthetics. #' @template return-layer #' @family geom layers #' @example inst/examples/ex-geom-vector.r @@ -56,6 +61,8 @@ geom_vector <- function( arrow = default_arrow, lineend = "round", linejoin = "mitre", vector_labels = TRUE, ..., + label.colour = NULL, label.color = NULL, label.alpha = NULL, + parse = FALSE, check_overlap = FALSE, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE ) { @@ -70,6 +77,9 @@ geom_vector <- function( params = list( arrow = arrow, lineend = lineend, linejoin = linejoin, vector_labels = vector_labels, + label.colour = label.color %||% label.colour, + parse = parse, + check_overlap = check_overlap, na.rm = na.rm, ... ) @@ -89,7 +99,6 @@ GeomVector <- ggproto( default_aes = aes( colour = "black", linewidth = 0.5, linetype = 1, alpha = NA, label = "", size = 3.88, angle = 0, hjust = .5, vjust = .5, - label_colour = "black", label_alpha = NA, family = "", fontface = 1, lineheight = 1.2 ), @@ -106,6 +115,7 @@ GeomVector <- ggproto( data, panel_params, coord, vector_labels = TRUE, arrow = default_arrow, lineend = "round", linejoin = "mitre", + label.colour = NULL, label.alpha = NULL, parse = FALSE, check_overlap = FALSE, na.rm = FALSE ) { @@ -128,11 +138,9 @@ GeomVector <- ggproto( if (vector_labels) { label_data <- data - - # specify aesthetics (if necessary) - label_data$colour <- label_data$label_colour - label_data$alpha <- label_data$label_alpha - label_data$label_colour <- label_data$label_alpha <- NULL + # specify independent aesthetics + label_data$colour <- label.colour %||% label_data$colour + label_data$alpha <- label.alpha %||% label_data$alpha if (is.character(label_data$hjust)) { label_data$hjust <- compute_just(label_data$hjust, label_data$x) diff --git a/R/zzz-biplot-geoms.r b/R/zzz-biplot-geoms.r index b9f6ce8..babe681 100644 --- a/R/zzz-biplot-geoms.r +++ b/R/zzz-biplot-geoms.r @@ -1039,6 +1039,11 @@ geom_rows_isoline <- function( num = NULL, text_dodge = 0.03, ..., + text.size = 3, + text.angle = 0, + text.colour = NULL, + text.color = NULL, + text.alpha = NULL, parse = FALSE, check_overlap = FALSE, na.rm = FALSE, @@ -1049,7 +1054,9 @@ geom_rows_isoline <- function( geom = GeomIsoline, position = position, show.legend = show.legend, inherit.aes = inherit.aes, params = list(isoline_text = isoline_text, by = by, num = num, text_dodge = text_dodge, - parse = parse, check_overlap = check_overlap, + text.size = text.size, text.angle = text.angle, + text.colour = text.color %||% text.colour, + text.alpha = text.alpha, parse = parse, check_overlap = check_overlap, na.rm = na.rm, ...)) } @@ -1066,6 +1073,11 @@ geom_cols_isoline <- function( num = NULL, text_dodge = 0.03, ..., + text.size = 3, + text.angle = 0, + text.colour = NULL, + text.color = NULL, + text.alpha = NULL, parse = FALSE, check_overlap = FALSE, na.rm = FALSE, @@ -1076,7 +1088,9 @@ geom_cols_isoline <- function( geom = GeomIsoline, position = position, show.legend = show.legend, inherit.aes = inherit.aes, params = list(isoline_text = isoline_text, by = by, num = num, text_dodge = text_dodge, - parse = parse, check_overlap = check_overlap, + text.size = text.size, text.angle = text.angle, + text.colour = text.color %||% text.colour, + text.alpha = text.alpha, parse = parse, check_overlap = check_overlap, na.rm = na.rm, ...)) } @@ -1265,6 +1279,11 @@ geom_rows_vector <- function( linejoin = "mitre", vector_labels = TRUE, ..., + label.colour = NULL, + label.color = NULL, + label.alpha = NULL, + parse = FALSE, + check_overlap = FALSE, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE @@ -1273,6 +1292,8 @@ geom_rows_vector <- function( geom = GeomVector, position = position, show.legend = show.legend, inherit.aes = inherit.aes, params = list(arrow = arrow, lineend = lineend, linejoin = linejoin, vector_labels = vector_labels, + label.colour = label.color %||% label.colour, + parse = parse, check_overlap = check_overlap, na.rm = na.rm, ...)) } @@ -1289,6 +1310,11 @@ geom_cols_vector <- function( linejoin = "mitre", vector_labels = TRUE, ..., + label.colour = NULL, + label.color = NULL, + label.alpha = NULL, + parse = FALSE, + check_overlap = FALSE, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE @@ -1297,6 +1323,8 @@ geom_cols_vector <- function( geom = GeomVector, position = position, show.legend = show.legend, inherit.aes = inherit.aes, params = list(arrow = arrow, lineend = lineend, linejoin = linejoin, vector_labels = vector_labels, + label.colour = label.color %||% label.colour, + parse = parse, check_overlap = check_overlap, na.rm = na.rm, ...)) } diff --git a/docs/articles/cmds-variables.html b/docs/articles/cmds-variables.html index 945f13d..02f9c02 100644 --- a/docs/articles/cmds-variables.html +++ b/docs/articles/cmds-variables.html @@ -135,7 +135,7 @@
In contrast, the variables are better understood through their correlations, which are approximately preserved by their standardized coordinates. Writing as an array of column variables, the covariance between and is proportional to their inner product $$\textstyle \operatorname{cov}(y_i,y_j) = \frac{1}{n} y_i \cdot y_j = \frac{1}{n} \lVert y_i\rVert\lVert y_j\rVert\cos\theta_{ij}\text,$$ so that the cosine of the angle between them equals their correlation:
+In contrast, the variables are better understood through their correlations, which are approximately preserved by their standardized coordinates. Writing as an array of column variables, the covariance between and is proportional to their inner product $$\textstyle \operatorname{cov}(y_i,y_j) = \frac{1}{n} y_i \cdot y_j = \frac{1}{n} \lVert y_i\rVert\lVert y_j\rVert\cos\theta_{ij}\text,$$ so that the cosine of the angle between them equals their correlation:
Here the cosines between the vectors in the biplot are plotted against the variable correlations in the centered and scaled data. While the vectors are shorter in the biplot for the same reason that distances are shorter, their consines may be larger or smaller depending on their respective coordinates in the remaining coordinates.
# correlations between variables
@@ -159,7 +159,7 @@ dimension reduction of geometric
multidimensional scaling of distance data
-The faithful approximation of inter-case distances by principal coordinates is the idea behind classical multidimensional scaling (CMDS), which can be applied to a data set of distances in the absence of coordinates (variables). CMDS produces a set of artificial coordinates for the cases that yield nested best approximations of the inter-case distances in terms of the sum of squared errors. The technique uses the eigendecomposition of a doubly-centered matrix of squared distances, which produces a matrix whose first coordinates—for any —minimize the variance of , where , to obtain the approximation. The columns of are then called principal coordinates, and the first most faithfully recover the using points in of any possible . For example, because the road distances between several U.S. cities arise from a roughly 2-dimensional process, the point distances in a CMDS are very close approximations:
+The faithful approximation of inter-case distances by principal coordinates is the idea behind classical multidimensional scaling (CMDS), which can be applied to a data set of distances in the absence of coordinates (variables). CMDS produces a set of artificial coordinates for the cases that yield nested best approximations of the inter-case distances in terms of the sum of squared errors. The technique uses the eigendecomposition of a doubly-centered matrix of squared distances, which produces a matrix whose first coordinates—for any —minimize the variance of , where , to obtain the approximation. The columns of are then called principal coordinates, and the first most faithfully recover the using points in of any possible . For example, because the road distances between several U.S. cities arise from a roughly 2-dimensional process, the point distances in a CMDS are very close approximations:
d <- as.matrix(UScitiesD)
cent <- diag(1, nrow(d)) - matrix(1/nrow(d), nrow(d), nrow(d))
@@ -177,7 +177,7 @@ multidimensional scaling of d
)
lines(x = c(0, max(UScitiesD)), y = c(0, max(UScitiesD)))
-In practice, the goal of CMDS is usually to produce a scatterplot in which the distances between the points that represent the cases approximate their original distances . In this case, the artificial coordinates approximately recover the geographic arrangement. By chance, this CMDS rotated the conventional cardinal directions by about radians (though at least the map is recognizable from above rather than below the surface of the Earth):
+In practice, the goal of CMDS is usually to produce a scatterplot in which the distances between the points that represent the cases approximate their original distances . In this case, the artificial coordinates approximately recover the geographic arrangement. By chance, this CMDS rotated the conventional cardinal directions by about radians (though at least the map is recognizable from above rather than below the surface of the Earth):
plot(
d.coord, pch = NA, asp = 1,
@@ -189,7 +189,7 @@ multidimensional scaling of d
multidimensional scaling of covariance data
-The faithful approximation of inter-variable correlations by the angles between their coordinate vectors provides a dual CMDS procedure. Suppose we have data that consist not of distances between cases but of covariances between variables. Again the data are coordinate-free, so PCA is inapplicable. But were the data derived from a (not necessarily centered or scaled) case–variable matrix , then the covariance matrix would have been obtained as . This, up to scalar, is the matrix whose eigenvectors would be given by in the SVD . Therefore, we can obtain artificial coordinates for these variables that approximate what we know of their geometry—thinking of the variables as unknown vectors whose magnitudes and angles are encoded in —via an eigendecomposition : Take , so that .
+The faithful approximation of inter-variable correlations by the angles between their coordinate vectors provides a dual CMDS procedure. Suppose we have data that consist not of distances between cases but of covariances between variables. Again the data are coordinate-free, so PCA is inapplicable. But were the data derived from a (not necessarily centered or scaled) case–variable matrix , then the covariance matrix would have been obtained as . This, up to scalar, is the matrix whose eigenvectors would be given by in the SVD . Therefore, we can obtain artificial coordinates for these variables that approximate what we know of their geometry—thinking of the variables as unknown vectors whose magnitudes and angles are encoded in —via an eigendecomposition : Take , so that .
While covariances of the unscaled glass measurements are not meaningful, they can be used to validate the technique. Again because the eigendecomposition is intrinsically ordered by variance, the first eigenvectors provide the most faithful -dimensional approximation; i’ll take in anticipation of a biplot:
# covariances and standard deviations
@@ -230,14 +230,11 @@ multidimensional scaling of
use case: rankings of universities
-## Error in get(paste0(generic, ".", class), envir = get_method_env()) :
-## object 'type_sum.accel' not found
-
+library(ordr)
+library(dplyr)
A natural use case for CMDS of variables is the analysis of multiple rankings of the same set of objects in terms of their concordance. Rankings’ concordance is often measured using rank correlations such as Kendall’s , which may be general correlation coefficients in the sense proposed by Kendall but are not associated with an underlying geometry. In this setting, there is no original nor Euclidean coordinates. Nevertheless, we can use CMDS to represent these rankings as unit vectors in Euclidean space whose pairwise cosines approximate their rank correlations!
A real-world example is provided by the Quacquarelli Symonds World University Rankings, which include rankings of hundreds of world universities along six dimensions: academic reputation, employer reputation, faculty–student ratio, citations per faculty, international faculty ratio, and international student ratio. QS weight these rankings differently in their overall assessment, but our analysis will compare the rankings to each other across universities, ignoring these weights. The subset qswur_usa
installed with ordr include U.S.-based universities ranked in the years 2017–2020, their classifications by QS, and their six integer-valued rankings. (Scores used to generate the rankings are included with the QS data files but omitted from qswur_usa
.)
-
+
## # A tibble: 612 × 13
@@ -257,7 +254,7 @@ use case: rankings of universities## # ℹ 4 more variables: rk_ratio <int>, rk_citations <int>,
## # rk_intl_faculty <int>, rk_intl_students <int>
For this example, i’ll focus only on rankings for the year 2020 for which all rankings were available. This leaves me with only 38 universities, so my conclusions must be taken with caution! Since the rankings were subsetted from the full international data set, they are not contiguous (some integers between rankings never appear). To resolve this, i’ll also recalibrate the rankings by matching each vector of ranks to the vector of its sorted unique values:
-
+
qswur_usa %>%
filter(year == 2020L) %>%
select(institution, starts_with("rk_")) %>%
@@ -298,7 +295,7 @@ use case: rankings of universitiescorrelation heatmap
Heatmaps are commonly, perhaps most commonly, used to visualize correlation matrices, and they make a useful contrast to the CMDS correlation plot. Below i use heatmap()
to produce a basic correlation heatmap, but the blog post version of this vignette uses the corrplot package to more elegant effect. What can be learned from a glance at this plot? While the rankings by academic and employer reputations are highly concordant, those by international faculty and student ratios are less so. The faculty–student ratio and faculty citation rankings have the weakest concordance of any pair, but they are still positively correlated.
-
+
corr <- cor(select(qswur_usa2020, starts_with("rk_")), method = "kendall")
heatmap(corr, scale = "none")
@@ -310,7 +307,7 @@ correlation heatmapcorrelation monoplot
CMDS of variables offers a natural alternative visualization, which Gower, Gardner–Lubbe, and le Roux (2011) call a “correlation monoplot” in that it consists of but one of the two layers of a PCA or other biplot. As with CMDS of cases, the point isn’t to overlay the case scores and variable loadings from a singular value decomposition, but to use the scores or loadings alone to endow the cases or variables with a Euclidean geometry they didn’t originally have. To that end, i’ll plot the variables as vectors with tails at the origin and heads at their principal coordinates , with a unit circle included for reference:
-
+
eigen_ord(corr) %>%
as_tbl_ord() %>%
augment_ord() %>%
@@ -330,24 +327,24 @@ correlation monoplot## Warning: Unknown or uninitialised column: `size`.
With respect to the pairwise correlations, the biplot is significantly less precise: Though the vectors all have unit length in (), their projections onto the first two principal coordinates are much shorter, indicating that much of the geometric configuration requires additional dimensions to represent. Indeed, these coordinates capture only of the inertia in the full, six-dimensional eigendecomposition. This means that the angles between the vectors must be interpreted with caution: For example, it looks like the academic and employer reputation rankings are extremely correlated, but the apparent alignment of the vectors could be an artifact of the projection, when in fact they “rise” and “fall” in opposite directions along the remaining principal coordinates. The correlation heatmap, by comparison, leaves no such ambiguity.
-However, the biplot far surpasses the heatmap at parsimony: Each variable is represented by a single vector, and the angle cosines between the variable vectors roughly approximate their correlations. For instance, the rankings based on international student and faculty ratios have correlation around , corresponding to either explaining half the “variance” in the other—not technically meaningful in the ranking context but a useful conceptual anchor. Meanwhile, the faculty–student ratio ranking is nearly independent of the faculty citation ranking, contrary to my intuition that these rankings would reflect a reverse association between research- and teaching-oriented institutions. The convenience of recognizing correlations as cosines may be worth the significant risk of error, especially since that error (the residual of inertia) can be exactly quantified.
+However, the biplot far surpasses the heatmap at parsimony: Each variable is represented by a single vector, and the angle cosines between the variable vectors roughly approximate their correlations. For instance, the rankings based on international student and faculty ratios have correlation around , corresponding to either explaining half the “variance” in the other—not technically meaningful in the ranking context but a useful conceptual anchor. Meanwhile, the faculty–student ratio ranking is nearly independent of the faculty citation ranking, contrary to my intuition that these rankings would reflect a reverse association between research- and teaching-oriented institutions. The convenience of recognizing correlations as cosines may be worth the significant risk of error, especially since that error (the residual of inertia) can be exactly quantified.
Moreover, the principal coordinates of the variable vectors indicate their loadings onto the first and second principal moments of inertia—the two dimensions that capture the most variation in the data. For example, the first principal coordinate is most aligned with the two reputational rankings, suggesting that a general prestige ranking is the strongest overall component of the several specific rankings. In contrast, the faculty–student ratio and faculty citation rankings load most strongly onto the second principal coordinate, suggesting that the divide between research- and teaching-focused institutions may yet be important to understanding how universities compare along these different metrics. These observations, provisional though they are, would be difficult to discern from the heatmap. More importantly, unlike the secondary patterns visible in the heatmap, these are not artifacts of the layout but arise directly from the (correlational) data.
This last point means that observations made from a correlation monoplot can be validated from the CMDS coordinates. In particular, we can examine the variables’ loadings onto the third principal coordinate, and we can check whether the reputational rankings are aligned or misaligned along it.
-
+
## # A tibble: 6 × 8
## EV1 EV2 EV3 EV4 EV5 EV6 metric .element
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> <chr>
-## 1 -0.834 -0.0907 0.412 -0.0430 -0.0206 0.351 academic active
-## 2 -0.795 -0.0964 0.477 0.0416 -0.181 -0.311 employer active
-## 3 -0.517 0.771 -0.0480 -0.331 0.158 -0.0372 ratio active
-## 4 -0.731 -0.352 -0.239 0.0278 0.528 -0.0685 citations active
-## 5 -0.631 -0.233 -0.521 -0.392 -0.352 0.00783 intl_faculty active
-## 6 -0.603 0.262 -0.324 0.665 -0.140 0.0312 intl_students active
+## 1 -0.834 -0.0907 0.412 0.0430 -0.0206 0.351 academic active
+## 2 -0.795 -0.0964 0.477 -0.0416 -0.181 -0.311 employer active
+## 3 -0.517 0.771 -0.0480 0.331 0.158 -0.0372 ratio active
+## 4 -0.731 -0.352 -0.239 -0.0278 0.528 -0.0685 citations active
+## 5 -0.631 -0.233 -0.521 0.392 -0.352 0.00783 intl_faculty active
+## 6 -0.603 0.262 -0.324 -0.665 -0.140 0.0312 intl_students active
Based on the third principal coordinates, the reputational rankings are aligned, as we knew already from the correlation matrix and heatmap. What’s a bit more interesting is that this component seems to separate these two rankings from those having to do with faculty citation rates and the international compositions of the faculty and student body. Based on the decomposition of inertia, this third principal coordinate is nearly as important as the second! It therefore makes sense to plot the two together, in effect examining the residuals after regressing out the first principal coordinate:
-
+
c_eigen %>%
ggbiplot(aes(x = 2, y = 3)) +
theme_minimal() +
diff --git a/docs/articles/ordr.html b/docs/articles/ordr.html
index f56c8f3..36e3b7e 100644
--- a/docs/articles/ordr.html
+++ b/docs/articles/ordr.html
@@ -102,9 +102,7 @@ Ordination in the tidyverse
data(HairEyeColor)
library(MASS)
library(ordr)
-#> Loading required package: ggplot2
-#> Error in get(paste0(generic, ".", class), envir = get_method_env()) :
-#> object 'type_sum.accel' not found
+#> Loading required package: ggplot2
the hair and eye color data
@@ -166,9 +164,9 @@ correspondence analysis using
The row and column weights and
-The diagonals of inverse weights and
+ The diagonals of inverse weights and
-The matrix of standardized residuals
+ The matrix of standardized residuals
The singular value decomposition
@@ -251,7 +249,7 @@
#> 3 -0.465 -1.12 1.97 |
#> 4 0.354 -2.27 -1.72 |
The print()
method for ‘tbl_ord’ is based on that of tibbles. It prints two tibbles, like that for the ‘tbl_graph’ class of tidygraph, one for each matrix factor.
-The header reminds us of the dimensions of the matrix factors and how the inertia is distributed. In ‘correspondence’ objects, by default both row and column profiles are in standard coordinates: and , but these can be reassigned to any pair of proportions , even if . By assigning "symmetric"
inertia, we distribute half of the inertia to each matrix factor:
+The header reminds us of the dimensions of the matrix factors and how the inertia is distributed. In ‘correspondence’ objects, by default both row and column profiles are in standard coordinates: and , but these can be reassigned to any pair of proportions , even if . By assigning "symmetric"
inertia, we distribute half of the inertia to each matrix factor:
get_conference(haireye_ca_ord)
#> [1] 0 0
@@ -407,79 +405,78 @@ session infosessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
-#> version R version 4.2.3 (2023-03-15)
-#> os macOS Catalina 10.15.7
-#> system x86_64, darwin17.0
+#> version R version 4.3.2 (2023-10-31)
+#> os macOS Sonoma 14.4.1
+#> system aarch64, darwin20
#> ui X11
#> language en
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz America/New_York
#> date 2025-01-22
-#> pandoc 2.16.2 @ /usr/local/bin/ (via rmarkdown)
+#> pandoc 2.12 @ /opt/homebrew/anaconda3/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
-#> bslib 0.8.0 2024-07-29 [2] CRAN (R 4.2.3)
-#> cachem 1.1.0 2024-05-16 [2] CRAN (R 4.2.3)
-#> cli 3.6.3 2024-06-21 [2] CRAN (R 4.2.3)
-#> colorspace 2.1-1 2024-07-26 [2] CRAN (R 4.2.3)
-#> desc 1.4.3 2023-12-10 [2] CRAN (R 4.2.0)
-#> digest 0.6.37 2024-08-19 [2] CRAN (R 4.2.3)
-#> dplyr 1.1.4 2023-11-17 [2] CRAN (R 4.2.0)
-#> evaluate 1.0.1 2024-10-10 [2] CRAN (R 4.2.3)
-#> farver 2.1.2 2024-05-13 [2] CRAN (R 4.2.3)
-#> fastmap 1.2.0 2024-05-15 [2] CRAN (R 4.2.3)
-#> fs 1.6.4 2024-04-25 [2] CRAN (R 4.2.3)
-#> generics 0.1.3 2022-07-05 [2] CRAN (R 4.2.0)
-#> ggplot2 * 3.5.1 2024-04-23 [2] CRAN (R 4.2.3)
-#> ggrepel 0.9.6 2024-09-07 [2] CRAN (R 4.2.3)
-#> glue 1.8.0 2024-09-30 [2] CRAN (R 4.2.3)
-#> gtable 0.3.6 2024-10-25 [2] CRAN (R 4.2.3)
-#> highr 0.11 2024-05-26 [2] CRAN (R 4.2.3)
-#> htmltools 0.5.8.1 2024-04-04 [2] CRAN (R 4.2.3)
-#> htmlwidgets 1.6.4 2023-12-06 [2] CRAN (R 4.2.0)
-#> jquerylib 0.1.4 2021-04-26 [2] CRAN (R 4.2.0)
-#> jsonlite 1.8.9 2024-09-20 [2] CRAN (R 4.2.3)
-#> knitr 1.48 2024-07-07 [2] CRAN (R 4.2.3)
-#> labeling 0.4.3 2023-08-29 [2] CRAN (R 4.2.0)
-#> lifecycle 1.0.4 2023-11-07 [2] CRAN (R 4.2.3)
-#> magrittr 2.0.3 2022-03-30 [2] CRAN (R 4.2.0)
-#> MASS * 7.3-58.2 2023-01-23 [2] CRAN (R 4.2.3)
-#> munsell 0.5.1 2024-04-01 [2] CRAN (R 4.2.3)
-#> ordr * 0.1.1.0002 2025-01-22 [1] local
-#> pillar 1.10.0 2024-12-17 [2] CRAN (R 4.2.3)
-#> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.2.0)
-#> pkgdown 2.1.1 2024-09-17 [2] CRAN (R 4.2.3)
-#> purrr 1.0.2 2023-08-10 [2] CRAN (R 4.2.0)
-#> R6 2.5.1 2021-08-19 [2] CRAN (R 4.2.0)
-#> ragg 1.3.3 2024-09-11 [2] CRAN (R 4.2.3)
-#> RColorBrewer 1.1-3 2022-04-03 [2] CRAN (R 4.2.0)
-#> Rcpp 1.0.12 2024-01-09 [2] CRAN (R 4.2.3)
-#> rlang 1.1.4 2024-06-04 [2] CRAN (R 4.2.3)
-#> rmarkdown 2.28 2024-08-17 [2] CRAN (R 4.2.3)
-#> sass 0.4.9 2024-03-15 [2] CRAN (R 4.2.3)
-#> scales 1.3.0 2023-11-28 [2] CRAN (R 4.2.0)
-#> sessioninfo 1.2.2 2021-12-06 [2] CRAN (R 4.2.0)
-#> stringi 1.8.4 2024-05-06 [2] CRAN (R 4.2.3)
-#> stringr 1.5.1 2023-11-14 [2] CRAN (R 4.2.3)
-#> systemfonts 1.1.0 2024-05-15 [2] CRAN (R 4.2.3)
-#> textshaping 0.4.0 2024-05-24 [2] CRAN (R 4.2.3)
-#> tibble 3.2.1 2023-03-20 [2] CRAN (R 4.2.0)
-#> tidyr 1.3.1 2024-01-24 [2] CRAN (R 4.2.3)
-#> tidyselect 1.2.1 2024-03-11 [2] CRAN (R 4.2.3)
-#> utf8 1.2.4 2023-10-22 [2] CRAN (R 4.2.0)
-#> vctrs 0.6.5 2023-12-01 [2] CRAN (R 4.2.0)
-#> withr 3.0.2 2024-10-28 [2] CRAN (R 4.2.3)
-#> xfun 0.48 2024-10-03 [2] CRAN (R 4.2.3)
-#> yaml 2.3.10 2024-07-26 [2] CRAN (R 4.2.3)
+#> bslib 0.8.0 2024-07-29 [2] CRAN (R 4.3.3)
+#> cachem 1.1.0 2024-05-16 [2] CRAN (R 4.3.3)
+#> cli 3.6.3 2024-06-21 [2] CRAN (R 4.3.3)
+#> colorspace 2.1-1 2024-07-26 [2] CRAN (R 4.3.3)
+#> desc 1.4.3 2023-12-10 [2] CRAN (R 4.3.1)
+#> digest 0.6.37 2024-08-19 [2] CRAN (R 4.3.3)
+#> dplyr 1.1.4 2023-11-17 [2] CRAN (R 4.3.1)
+#> evaluate 1.0.3 2025-01-10 [2] CRAN (R 4.3.3)
+#> farver 2.1.2 2024-05-13 [2] CRAN (R 4.3.3)
+#> fastmap 1.2.0 2024-05-15 [2] CRAN (R 4.3.3)
+#> fs 1.6.5 2024-10-30 [2] CRAN (R 4.3.3)
+#> generics 0.1.3 2022-07-05 [2] CRAN (R 4.3.0)
+#> ggplot2 * 3.5.1 2024-04-23 [2] CRAN (R 4.3.1)
+#> ggrepel 0.9.6 2024-09-07 [2] CRAN (R 4.3.3)
+#> glue 1.8.0 2024-09-30 [2] CRAN (R 4.3.3)
+#> gtable 0.3.6 2024-10-25 [2] CRAN (R 4.3.3)
+#> htmltools 0.5.8.1 2024-04-04 [2] CRAN (R 4.3.1)
+#> htmlwidgets 1.6.4 2023-12-06 [2] CRAN (R 4.3.1)
+#> jquerylib 0.1.4 2021-04-26 [2] CRAN (R 4.3.0)
+#> jsonlite 1.8.9 2024-09-20 [2] CRAN (R 4.3.3)
+#> knitr 1.49 2024-11-08 [2] CRAN (R 4.3.3)
+#> labeling 0.4.3 2023-08-29 [2] CRAN (R 4.3.0)
+#> lifecycle 1.0.4 2023-11-07 [2] CRAN (R 4.3.1)
+#> magrittr 2.0.3 2022-03-30 [2] CRAN (R 4.3.0)
+#> MASS * 7.3-60 2023-05-04 [2] CRAN (R 4.3.2)
+#> munsell 0.5.1 2024-04-01 [2] CRAN (R 4.3.1)
+#> ordr * 0.1.1.0002 2025-01-23 [1] local
+#> pillar 1.10.1 2025-01-07 [2] CRAN (R 4.3.3)
+#> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.3.0)
+#> pkgdown 2.1.1 2024-09-17 [2] CRAN (R 4.3.3)
+#> purrr 1.0.2 2023-08-10 [2] CRAN (R 4.3.0)
+#> R6 2.5.1 2021-08-19 [2] CRAN (R 4.3.0)
+#> ragg 1.3.3 2024-09-11 [2] CRAN (R 4.3.3)
+#> RColorBrewer 1.1-3 2022-04-03 [2] CRAN (R 4.3.0)
+#> Rcpp 1.0.14 2025-01-12 [2] CRAN (R 4.3.3)
+#> rlang 1.1.4 2024-06-04 [2] CRAN (R 4.3.3)
+#> rmarkdown 2.29 2024-11-04 [2] CRAN (R 4.3.3)
+#> sass 0.4.9 2024-03-15 [2] CRAN (R 4.3.1)
+#> scales 1.3.0 2023-11-28 [2] CRAN (R 4.3.1)
+#> sessioninfo 1.2.2 2021-12-06 [2] CRAN (R 4.3.0)
+#> stringi 1.8.4 2024-05-06 [2] CRAN (R 4.3.1)
+#> stringr 1.5.1 2023-11-14 [2] CRAN (R 4.3.1)
+#> systemfonts 1.1.0 2024-05-15 [2] CRAN (R 4.3.3)
+#> textshaping 0.4.1 2024-12-06 [2] CRAN (R 4.3.3)
+#> tibble 3.2.1 2023-03-20 [2] CRAN (R 4.3.0)
+#> tidyr 1.3.1 2024-01-24 [2] CRAN (R 4.3.1)
+#> tidyselect 1.2.1 2024-03-11 [2] CRAN (R 4.3.1)
+#> utf8 1.2.4 2023-10-22 [2] CRAN (R 4.3.1)
+#> vctrs 0.6.5 2023-12-01 [2] CRAN (R 4.3.1)
+#> withr 3.0.2 2024-10-28 [2] CRAN (R 4.3.3)
+#> xfun 0.50 2025-01-07 [2] CRAN (R 4.3.3)
+#> yaml 2.3.10 2024-07-26 [2] CRAN (R 4.3.3)
#>
-#> [1] /private/var/folders/k6/l4mq9ctj3219429xnvqpdbxm8tckkx/T/Rtmpgkj8Hf/temp_libpath290134768767
-#> [2] /Library/Frameworks/R.framework/Versions/4.2/Resources/library
+#> [1] /private/var/folders/4p/3cy0qmp15x9216qsqhh84kzm0000gn/T/RtmpaeOcpy/temp_libpath333bbe6528a
+#> [2] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
#>
#> ──────────────────────────────────────────────────────────────────────────────
-
+
Snee RD (1974) “Graphical Display of Two-way Contingency Tables”. The American Statistician 28(1), 9-12. https://doi.org/10.2307/2683520↩︎
diff --git a/docs/articles/ordr_files/figure-html/unnamed-chunk-1-1.png b/docs/articles/ordr_files/figure-html/unnamed-chunk-1-1.png
index 98c6f70..be5b65f 100644
Binary files a/docs/articles/ordr_files/figure-html/unnamed-chunk-1-1.png and b/docs/articles/ordr_files/figure-html/unnamed-chunk-1-1.png differ
diff --git a/docs/articles/ordr_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/ordr_files/figure-html/unnamed-chunk-4-1.png
index 9d09b0d..9f197f9 100644
Binary files a/docs/articles/ordr_files/figure-html/unnamed-chunk-4-1.png and b/docs/articles/ordr_files/figure-html/unnamed-chunk-4-1.png differ
diff --git a/docs/authors.html b/docs/authors.html
index c460973..01d631e 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -84,13 +84,14 @@ Citation
Brunson J, Gracey J (2025).
ordr: A Tidyverse Extension for Ordinations and Biplots.
-https://github.com/corybrunson/ordr, https://corybrunson.github.io/ordr/.
+R package version 0.1.1.0002, https://corybrunson.github.io/ordr/, https://github.com/corybrunson/ordr.
@Manual{,
title = {ordr: A Tidyverse Extension for Ordinations and Biplots},
author = {Jason Cory Brunson and John Gracey},
year = {2025},
- note = {https://github.com/corybrunson/ordr, https://corybrunson.github.io/ordr/},
+ note = {R package version 0.1.1.0002, https://corybrunson.github.io/ordr/},
+ url = {https://github.com/corybrunson/ordr},
}
diff --git a/docs/index.html b/docs/index.html
index b3b06c1..85d4399 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -274,7 +274,7 @@ resources
+
Greenacre MJ (2010) Biplots in Practice. Fundacion BBVA, ISBN: 978-84-923846. https://www.fbbva.es/microsite/multivariate-statistics/biplots.html↩︎
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index 07df569..2c286bd 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -1,7 +1,7 @@
-pandoc: 2.16.2
+pandoc: '2.12'
pkgdown: 2.1.1
pkgdown_sha: ~
articles:
cmds-variables: cmds-variables.html
ordr: ordr.html
-last_built: 2025-01-22T22:28Z
+last_built: 2025-01-23T01:38Z
diff --git a/docs/reference/biplot-geoms.html b/docs/reference/biplot-geoms.html
index 095963b..6b3dd68 100644
--- a/docs/reference/biplot-geoms.html
+++ b/docs/reference/biplot-geoms.html
@@ -662,6 +662,11 @@ Convenience geoms for row and column matrix factors
num = NULL,
text_dodge = 0.03,
...,
+ text.size = 3,
+ text.angle = 0,
+ text.colour = NULL,
+ text.color = NULL,
+ text.alpha = NULL,
parse = FALSE,
check_overlap = FALSE,
na.rm = FALSE,
@@ -679,6 +684,11 @@ Convenience geoms for row and column matrix factors
num = NULL,
text_dodge = 0.03,
...,
+ text.size = 3,
+ text.angle = 0,
+ text.colour = NULL,
+ text.color = NULL,
+ text.alpha = NULL,
parse = FALSE,
check_overlap = FALSE,
na.rm = FALSE,
@@ -806,6 +816,11 @@ Convenience geoms for row and column matrix factors
linejoin = "mitre",
vector_labels = TRUE,
...,
+ label.colour = NULL,
+ label.color = NULL,
+ label.alpha = NULL,
+ parse = FALSE,
+ check_overlap = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
@@ -821,6 +836,11 @@ Convenience geoms for row and column matrix factors
linejoin = "mitre",
vector_labels = TRUE,
...,
+ label.colour = NULL,
+ label.color = NULL,
+ label.alpha = NULL,
+ parse = FALSE,
+ check_overlap = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
diff --git a/docs/reference/dplyr-verbs.html b/docs/reference/dplyr-verbs.html
index 326a72d..4f2182f 100644
--- a/docs/reference/dplyr-verbs.html
+++ b/docs/reference/dplyr-verbs.html
@@ -163,9 +163,9 @@ Examples
#> # Rows (principal): [ 153 x 2 | 5 ]
#> LD1 LD2 | name prior counts .element
#> | <chr> <dbl> <int> <chr>
-#> 1 7.61 0.215 | 1 setosa 0.333 50 active
-#> 2 -1.83 -0.728 | 2 versicolor 0.333 50 active
-#> 3 -5.78 0.513 | 3 virginica 0.333 50 active
+#> 1 7.61 -0.215 | 1 setosa 0.333 50 active
+#> 2 -1.83 0.728 | 2 versicolor 0.333 50 active
+#> 3 -5.78 -0.513 | 3 virginica 0.333 50 active
#> 4 NA NA | 4 NA NA NA score
#> 5 NA NA | 5 NA NA NA score
#> # ℹ 148 more rows
@@ -174,17 +174,17 @@ Examples
#> # Columns (standard): [ 4 x 2 | 2 ]
#> LD1 LD2 | name .element
#> | <chr> <chr>
-#> 1 0.829 0.0241 | 1 Sepal.Length active
-#> 2 1.53 2.16 | 2 Sepal.Width active
-#> 3 -2.20 -0.932 | 3 Petal.Length active
-#> 4 -2.81 2.84 | 4 Petal.Width active
+#> 1 0.829 -0.0241 | 1 Sepal.Length active
+#> 2 1.53 -2.16 | 2 Sepal.Width active
+#> 3 -2.20 0.932 | 3 Petal.Length active
+#> 4 -2.81 -2.84 | 4 Petal.Width active
# extract a coordinate or annotation
head(pull_rows(iris_lda, Species))
#> [1] <NA> <NA> <NA> setosa setosa setosa
#> Levels: setosa versicolor virginica
pull_cols(iris_lda, LD2)
-#> [1] 0.02410215 2.16452123 -0.93192121 2.83918785
+#> [1] -0.02410215 -2.16452123 0.93192121 -2.83918785
# rename an annotation
rename_cols(iris_lda, species = name)
@@ -194,9 +194,9 @@ Examples
#> # Rows (principal): [ 153 x 2 | 5 ]
#> LD1 LD2 | name prior counts .element
#> | <chr> <dbl> <int> <chr>
-#> 1 7.61 0.215 | 1 setosa 0.333 50 active
-#> 2 -1.83 -0.728 | 2 versicolor 0.333 50 active
-#> 3 -5.78 0.513 | 3 virginica 0.333 50 active
+#> 1 7.61 -0.215 | 1 setosa 0.333 50 active
+#> 2 -1.83 0.728 | 2 versicolor 0.333 50 active
+#> 3 -5.78 -0.513 | 3 virginica 0.333 50 active
#> 4 NA NA | 4 NA NA NA score
#> 5 NA NA | 5 NA NA NA score
#> # ℹ 148 more rows
@@ -205,10 +205,10 @@ Examples
#> # Columns (standard): [ 4 x 2 | 2 ]
#> LD1 LD2 | species .element
#> | <chr> <chr>
-#> 1 0.829 0.0241 | 1 Sepal.Length active
-#> 2 1.53 2.16 | 2 Sepal.Width active
-#> 3 -2.20 -0.932 | 3 Petal.Length active
-#> 4 -2.81 2.84 | 4 Petal.Width active
+#> 1 0.829 -0.0241 | 1 Sepal.Length active
+#> 2 1.53 -2.16 | 2 Sepal.Width active
+#> 3 -2.20 0.932 | 3 Petal.Length active
+#> 4 -2.81 -2.84 | 4 Petal.Width active
# select annotations
select_rows(iris_lda, species = name, .element)
@@ -218,9 +218,9 @@ Examples
#> # Rows (principal): [ 153 x 2 | 2 ]
#> LD1 LD2 | species .element
#> | <chr> <chr>
-#> 1 7.61 0.215 | 1 setosa active
-#> 2 -1.83 -0.728 | 2 versicolor active
-#> 3 -5.78 0.513 | 3 virginica active
+#> 1 7.61 -0.215 | 1 setosa active
+#> 2 -1.83 0.728 | 2 versicolor active
+#> 3 -5.78 -0.513 | 3 virginica active
#> 4 NA NA | 4 NA score
#> 5 NA NA | 5 NA score
#> # ℹ 148 more rows
@@ -228,10 +228,10 @@ Examples
#> # Columns (standard): [ 4 x 2 | 2 ]
#> LD1 LD2 | name .element
#> | <chr> <chr>
-#> 1 0.829 0.0241 | 1 Sepal.Length active
-#> 2 1.53 2.16 | 2 Sepal.Width active
-#> 3 -2.20 -0.932 | 3 Petal.Length active
-#> 4 -2.81 2.84 | 4 Petal.Width active
+#> 1 0.829 -0.0241 | 1 Sepal.Length active
+#> 2 1.53 -2.16 | 2 Sepal.Width active
+#> 3 -2.20 0.932 | 3 Petal.Length active
+#> 4 -2.81 -2.84 | 4 Petal.Width active
# create, modify, and delete annotations
mutate_cols(iris_lda, vec.length = sqrt(LD1^2 + LD2^2))
@@ -241,9 +241,9 @@ Examples
#> # Rows (principal): [ 153 x 2 | 5 ]
#> LD1 LD2 | name prior counts .element
#> | <chr> <dbl> <int> <chr>
-#> 1 7.61 0.215 | 1 setosa 0.333 50 active
-#> 2 -1.83 -0.728 | 2 versicolor 0.333 50 active
-#> 3 -5.78 0.513 | 3 virginica 0.333 50 active
+#> 1 7.61 -0.215 | 1 setosa 0.333 50 active
+#> 2 -1.83 0.728 | 2 versicolor 0.333 50 active
+#> 3 -5.78 -0.513 | 3 virginica 0.333 50 active
#> 4 NA NA | 4 NA NA NA score
#> 5 NA NA | 5 NA NA NA score
#> # ℹ 148 more rows
@@ -252,10 +252,10 @@ Examples
#> # Columns (standard): [ 4 x 2 | 3 ]
#> LD1 LD2 | name .element vec.length
#> | <chr> <chr> <dbl>
-#> 1 0.829 0.0241 | 1 Sepal.Length active 0.830
-#> 2 1.53 2.16 | 2 Sepal.Width active 2.65
-#> 3 -2.20 -0.932 | 3 Petal.Length active 2.39
-#> 4 -2.81 2.84 | 4 Petal.Width active 3.99
+#> 1 0.829 -0.0241 | 1 Sepal.Length active 0.830
+#> 2 1.53 -2.16 | 2 Sepal.Width active 2.65
+#> 3 -2.20 0.932 | 3 Petal.Length active 2.39
+#> 4 -2.81 -2.84 | 4 Petal.Width active 3.99
transmute_cols(iris_lda, vec.length = sqrt(LD1^2 + LD2^2))
#> # A tbl_ord of class 'lda_ord': (153 x 2) x (4 x 2)'
#> # 2 coordinates: LD1 and LD2
@@ -263,9 +263,9 @@ Examples
#> # Rows (principal): [ 153 x 2 | 5 ]
#> LD1 LD2 | name prior counts .element
#> | <chr> <dbl> <int> <chr>
-#> 1 7.61 0.215 | 1 setosa 0.333 50 active
-#> 2 -1.83 -0.728 | 2 versicolor 0.333 50 active
-#> 3 -5.78 0.513 | 3 virginica 0.333 50 active
+#> 1 7.61 -0.215 | 1 setosa 0.333 50 active
+#> 2 -1.83 0.728 | 2 versicolor 0.333 50 active
+#> 3 -5.78 -0.513 | 3 virginica 0.333 50 active
#> 4 NA NA | 4 NA NA NA score
#> 5 NA NA | 5 NA NA NA score
#> # ℹ 148 more rows
@@ -274,10 +274,10 @@ Examples
#> # Columns (standard): [ 4 x 2 | 1 ]
#> LD1 LD2 | vec.length
#> | <dbl>
-#> 1 0.829 0.0241 | 1 0.830
-#> 2 1.53 2.16 | 2 2.65
-#> 3 -2.20 -0.932 | 3 2.39
-#> 4 -2.81 2.84 | 4 3.99
+#> 1 0.829 -0.0241 | 1 0.830
+#> 2 1.53 -2.16 | 2 2.65
+#> 3 -2.20 0.932 | 3 2.39
+#> 4 -2.81 -2.84 | 4 3.99
# bind data frames of annotations
iris_medians <-
@@ -293,9 +293,9 @@ Examples
#> # Rows (principal): [ 153 x 2 | 6 ]
#> LD1 LD2 | .element Species Sepal.Length
#> | <chr> <fct> <dbl>
-#> 1 7.61 0.215 | 1 active setosa 5
-#> 2 -1.83 -0.728 | 2 active versicolor 5.9
-#> 3 -5.78 0.513 | 3 active virginica 6.5
+#> 1 7.61 -0.215 | 1 active setosa 5
+#> 2 -1.83 0.728 | 2 active versicolor 5.9
+#> 3 -5.78 -0.513 | 3 active virginica 6.5
#> 4 NA NA | 4 score NA NA
#> 5 NA NA | 5 score NA NA
#> # ℹ 148 more rows
@@ -307,10 +307,10 @@ Examples
#> # Columns (standard): [ 4 x 2 | 2 ]
#> LD1 LD2 | name .element
#> | <chr> <chr>
-#> 1 0.829 0.0241 | 1 Sepal.Length active
-#> 2 1.53 2.16 | 2 Sepal.Width active
-#> 3 -2.20 -0.932 | 3 Petal.Length active
-#> 4 -2.81 2.84 | 4 Petal.Width active
+#> 1 0.829 -0.0241 | 1 Sepal.Length active
+#> 2 1.53 -2.16 | 2 Sepal.Width active
+#> 3 -2.20 0.932 | 3 Petal.Length active
+#> 4 -2.81 -2.84 | 4 Petal.Width active
iris_lda %>%
select_rows(name, Species) %>%
left_join_rows(iris_medians, by = c("name" = "Species"))
@@ -320,9 +320,9 @@ Examples
#> # Rows (principal): [ 153 x 2 | 6 ]
#> LD1 LD2 | name Species Sepal.Length
#> | <chr> <fct> <dbl>
-#> 1 7.61 0.215 | 1 setosa NA 5
-#> 2 -1.83 -0.728 | 2 versicolor NA 5.9
-#> 3 -5.78 0.513 | 3 virginica NA 6.5
+#> 1 7.61 -0.215 | 1 setosa NA 5
+#> 2 -1.83 0.728 | 2 versicolor NA 5.9
+#> 3 -5.78 -0.513 | 3 virginica NA 6.5
#> 4 NA NA | 4 NA setosa NA
#> 5 NA NA | 5 NA setosa NA
#> # ℹ 148 more rows
@@ -334,10 +334,10 @@ Examples
#> # Columns (standard): [ 4 x 2 | 2 ]
#> LD1 LD2 | name .element
#> | <chr> <chr>
-#> 1 0.829 0.0241 | 1 Sepal.Length active
-#> 2 1.53 2.16 | 2 Sepal.Width active
-#> 3 -2.20 -0.932 | 3 Petal.Length active
-#> 4 -2.81 2.84 | 4 Petal.Width active
+#> 1 0.829 -0.0241 | 1 Sepal.Length active
+#> 2 1.53 -2.16 | 2 Sepal.Width active
+#> 3 -2.20 0.932 | 3 Petal.Length active
+#> 4 -2.81 -2.84 | 4 Petal.Width active
diff --git a/docs/reference/draw-key-1.png b/docs/reference/draw-key-1.png
index b99eeb7..b9d47e5 100644
Binary files a/docs/reference/draw-key-1.png and b/docs/reference/draw-key-1.png differ
diff --git a/docs/reference/draw-key.html b/docs/reference/draw-key.html
index d3e179a..afb2a98 100644
--- a/docs/reference/draw-key.html
+++ b/docs/reference/draw-key.html
@@ -128,6 +128,9 @@ Examples
"Ranges 2 sample standard deviations from centroids"
)
#> Warning: Duplicated aesthetics after name standardisation: contour
+#> Warning: Computation failed in `stat_rows_center()`.
+#> Caused by error in `fun.data.y()`:
+#> ! The package "Hmisc" is required.
diff --git a/docs/reference/geom_bagplot-2.png b/docs/reference/geom_bagplot-2.png
index 2424b68..0e86cf0 100644
Binary files a/docs/reference/geom_bagplot-2.png and b/docs/reference/geom_bagplot-2.png differ
diff --git a/docs/reference/geom_bagplot-3.png b/docs/reference/geom_bagplot-3.png
index 16e1faf..0d10e4f 100644
Binary files a/docs/reference/geom_bagplot-3.png and b/docs/reference/geom_bagplot-3.png differ
diff --git a/docs/reference/geom_isoline.html b/docs/reference/geom_isoline.html
index 3a4014a..6568617 100644
--- a/docs/reference/geom_isoline.html
+++ b/docs/reference/geom_isoline.html
@@ -76,6 +76,11 @@ Isolines (contour lines)
num = NULL,
text_dodge = 0.03,
...,
+ text.size = 3,
+ text.angle = 0,
+ text.colour = NULL,
+ text.color = NULL,
+ text.alpha = NULL,
parse = FALSE,
check_overlap = FALSE,
na.rm = FALSE,
@@ -154,6 +159,12 @@ Arguments
Additional arguments passed to ggplot2::layer()
.
+text.size, text.angle, text.colour, text.color, text.alpha
+Default
+aesthetics for tick mark labels. Set to NULL to inherit from the data's
+aesthetics.
+
+
parse
If TRUE
, the labels will be parsed into expressions and
displayed as described in ?plotmath
.
@@ -225,11 +236,8 @@ Aesthetics
vjust
family
fontface
-text_colour
, text_alpha
, text_size
, text_angle
,
group
-The prefixed aesthetics text_*
are used by the text elements and will
-inherit any values passed to their un-prefixed counterparts.
-
+
References
Greenacre MJ (2010) Biplots in Practice. Fundacion BBVA, ISBN:
diff --git a/docs/reference/geom_lineranges-1.png b/docs/reference/geom_lineranges-1.png
index b169253..09eaa17 100644
Binary files a/docs/reference/geom_lineranges-1.png and b/docs/reference/geom_lineranges-1.png differ
diff --git a/docs/reference/geom_lineranges.html b/docs/reference/geom_lineranges.html
index f14c3e6..41eb479 100644
--- a/docs/reference/geom_lineranges.html
+++ b/docs/reference/geom_lineranges.html
@@ -261,6 +261,9 @@
Examples
"Row-principal LRA biplot of Freestone glass measurements",
"Ranges 2 sample standard deviations from centroids"
)
+#> Warning: Computation failed in `stat_rows_center()`.
+#> Caused by error in `fun.data.y()`:
+#> ! The package "Hmisc" is required.
diff --git a/docs/reference/geom_vector.html b/docs/reference/geom_vector.html
index 7e325e1..d475ca1 100644
--- a/docs/reference/geom_vector.html
+++ b/docs/reference/geom_vector.html
@@ -78,6 +78,11 @@ Vectors from the origin
linejoin = "mitre",
vector_labels = TRUE,
...,
+ label.colour = NULL,
+ label.color = NULL,
+ label.alpha = NULL,
+ parse = FALSE,
+ check_overlap = FALSE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
@@ -157,6 +162,11 @@ Arguments
Additional arguments passed to ggplot2::layer()
.
+label.colour, label.color, label.alpha
+Default aesthetics for labels.
+Set to NULL to inherit from the data's aesthetics.
+
+
na.rm
Passed to ggplot2::layer()
.
@@ -215,9 +225,12 @@ Aesthetics
linetype
label
size
-angle
, hjust
, vjust
-label_colour
, label_alpha
-family
, fontface
, lineheight
+angle
+hjust
+vjust
+family
+fontface
+lineheight
group
diff --git a/docs/reference/ggbiplot-1.png b/docs/reference/ggbiplot-1.png
index d25a472..ef76c99 100644
Binary files a/docs/reference/ggbiplot-1.png and b/docs/reference/ggbiplot-1.png differ
diff --git a/docs/reference/ggbiplot-2.png b/docs/reference/ggbiplot-2.png
index cdb24c7..4c9f881 100644
Binary files a/docs/reference/ggbiplot-2.png and b/docs/reference/ggbiplot-2.png differ
diff --git a/docs/reference/ggbiplot-5.png b/docs/reference/ggbiplot-5.png
index 96e0493..c198189 100644
Binary files a/docs/reference/ggbiplot-5.png and b/docs/reference/ggbiplot-5.png differ
diff --git a/docs/reference/ggbiplot-6.png b/docs/reference/ggbiplot-6.png
index f0b3012..8832b8e 100644
Binary files a/docs/reference/ggbiplot-6.png and b/docs/reference/ggbiplot-6.png differ
diff --git a/docs/reference/lda-ord-1.png b/docs/reference/lda-ord-1.png
index a871af1..02b0203 100644
Binary files a/docs/reference/lda-ord-1.png and b/docs/reference/lda-ord-1.png differ
diff --git a/docs/reference/lda-ord-2.png b/docs/reference/lda-ord-2.png
index 4c9dc5a..10dfcf7 100644
Binary files a/docs/reference/lda-ord-2.png and b/docs/reference/lda-ord-2.png differ
diff --git a/docs/reference/lda-ord-3.png b/docs/reference/lda-ord-3.png
index 9f8d554..1e2b4eb 100644
Binary files a/docs/reference/lda-ord-3.png and b/docs/reference/lda-ord-3.png differ
diff --git a/docs/reference/lda-ord-4.png b/docs/reference/lda-ord-4.png
index 16be042..cc74629 100644
Binary files a/docs/reference/lda-ord-4.png and b/docs/reference/lda-ord-4.png differ
diff --git a/docs/reference/lda-ord.html b/docs/reference/lda-ord.html
index 694a2fa..7b2a2a5 100644
--- a/docs/reference/lda-ord.html
+++ b/docs/reference/lda-ord.html
@@ -279,15 +279,15 @@ Examples
# linear combinations of centered variables
print(sweep(iris_lda$means, 2, iris_centroid, "-") %*% get_cols(iris_lda))
#> LD1 LD2
-#> setosa 7.607600 0.2151330
-#> versicolor -1.825049 -0.7278996
-#> virginica -5.782550 0.5127666
+#> setosa 7.607600 -0.2151330
+#> versicolor -1.825049 0.7278996
+#> virginica -5.782550 -0.5127666
# discriminant centroids
print(get_rows(iris_lda, elements = "active"))
#> LD1 LD2
-#> setosa 7.607600 0.2151330
-#> versicolor -1.825049 -0.7278996
-#> virginica -5.782550 0.5127666
+#> setosa 7.607600 -0.2151330
+#> versicolor -1.825049 0.7278996
+#> virginica -5.782550 -0.5127666
# unstandardized coefficient LDA biplot
iris_lda %>%
diff --git a/docs/reference/lra-ord-1.png b/docs/reference/lra-ord-1.png
index 4f840f8..d04f4f5 100644
Binary files a/docs/reference/lra-ord-1.png and b/docs/reference/lra-ord-1.png differ
diff --git a/docs/reference/lra-ord-2.png b/docs/reference/lra-ord-2.png
index e156d5e..93ef4de 100644
Binary files a/docs/reference/lra-ord-2.png and b/docs/reference/lra-ord-2.png differ
diff --git a/docs/reference/lra-ord-3.png b/docs/reference/lra-ord-3.png
index 9123fb0..04c7be5 100644
Binary files a/docs/reference/lra-ord-3.png and b/docs/reference/lra-ord-3.png differ
diff --git a/docs/reference/methods-cancor-1.png b/docs/reference/methods-cancor-1.png
index ecec953..a9c9d82 100644
Binary files a/docs/reference/methods-cancor-1.png and b/docs/reference/methods-cancor-1.png differ
diff --git a/docs/reference/methods-factanal-1.png b/docs/reference/methods-factanal-1.png
index ebef115..c3fd008 100644
Binary files a/docs/reference/methods-factanal-1.png and b/docs/reference/methods-factanal-1.png differ
diff --git a/docs/reference/methods-kmeans-2.png b/docs/reference/methods-kmeans-2.png
index a2020f6..9a1dcb2 100644
Binary files a/docs/reference/methods-kmeans-2.png and b/docs/reference/methods-kmeans-2.png differ
diff --git a/docs/reference/methods-kmeans.html b/docs/reference/methods-kmeans.html
index c2d5578..f55b639 100644
--- a/docs/reference/methods-kmeans.html
+++ b/docs/reference/methods-kmeans.html
@@ -248,15 +248,14 @@ Examples
ggbiplot(aes(x = `2`, y = `3`), color = factor(.cluster)) +
geom_jitter(stat = "rows", aes(shape = cluster), width = .2, height = .2) +
geom_cols_axis(aes(color = `1`, label = name),
- text_size = 2, text_dodge = .1,
- label_size = 3, label_alpha = .5) +
+ text.size = 2, text_dodge = .1,
+ size = 3, label.alpha = .5) +
scale_x_continuous(expand = expansion(mult = .8)) +
scale_y_continuous(expand = expansion(mult = .5)) +
ggtitle(
"Measurement loadings onto clusters 2 and 3",
"Color indicates loadings onto cluster 1"
)
-#> Warning: Ignoring unknown parameters: `text_size`, `label_size`, and `label_alpha`
diff --git a/docs/reference/methods-lda.html b/docs/reference/methods-lda.html
index e52a3de..00fba25 100644
--- a/docs/reference/methods-lda.html
+++ b/docs/reference/methods-lda.html
@@ -191,41 +191,41 @@ Examples
#> # Rows (principal): [ 153 x 2 | 0 ]
#> LD1 LD2 |
#> |
-#> 1 7.61 0.215 |
-#> 2 -1.83 -0.728 |
-#> 3 -5.78 0.513 |
-#> 4 8.06 0.300 |
-#> 5 7.13 -0.787 |
+#> 1 7.61 -0.215 |
+#> 2 -1.83 0.728 |
+#> 3 -5.78 -0.513 |
+#> 4 8.06 -0.300 |
+#> 5 7.13 0.787 |
#>
#> #
#> # Columns (standard): [ 4 x 2 | 0 ]
#> LD1 LD2 |
#> |
-#> 1 0.829 0.0241 |
-#> 2 1.53 2.16 |
-#> 3 -2.20 -0.932 |
-#> 4 -2.81 2.84 |
+#> 1 0.829 -0.0241 |
+#> 2 1.53 -2.16 |
+#> 3 -2.20 0.932 |
+#> 4 -2.81 -2.84 |
# recover centroid coordinates and measurement discriminant coefficients
get_rows(iris_lda, elements = "active")
#> LD1 LD2
-#> setosa 7.607600 0.2151330
-#> versicolor -1.825049 -0.7278996
-#> virginica -5.782550 0.5127666
+#> setosa 7.607600 -0.2151330
+#> versicolor -1.825049 0.7278996
+#> virginica -5.782550 -0.5127666
head(get_rows(iris_lda, elements = "score"))
#> LD1 LD2
-#> [1,] 8.061800 0.3004206
-#> [2,] 7.128688 -0.7866604
-#> [3,] 7.489828 -0.2653845
-#> [4,] 6.813201 -0.6706311
-#> [5,] 8.132309 0.5144625
-#> [6,] 7.701947 1.4617210
+#> [1,] 8.061800 -0.3004206
+#> [2,] 7.128688 0.7866604
+#> [3,] 7.489828 0.2653845
+#> [4,] 6.813201 0.6706311
+#> [5,] 8.132309 -0.5144625
+#> [6,] 7.701947 -1.4617210
get_cols(iris_lda)
#> LD1 LD2
-#> Sepal.Length 0.8293776 0.02410215
-#> Sepal.Width 1.5344731 2.16452123
-#> Petal.Length -2.2012117 -0.93192121
-#> Petal.Width -2.8104603 2.83918785
+#> Sepal.Length 0.8293776 -0.02410215
+#> Sepal.Width 1.5344731 -2.16452123
+#> Petal.Length -2.2012117 0.93192121
+#> Petal.Width -2.8104603 -2.83918785
# augment ordination with centroid and measurement names
augment_ord(iris_lda)
@@ -235,21 +235,21 @@ Examples
#> # Rows (principal): [ 153 x 2 | 5 ]
#> LD1 LD2 | name prior counts grouping
#> | <chr> <dbl> <int> <chr>
-#> 1 7.61 0.215 | 1 setosa 0.333 50 setosa
-#> 2 -1.83 -0.728 | 2 versicolor 0.333 50 versicol…
-#> 3 -5.78 0.513 | 3 virginica 0.333 50 virginica
-#> 4 8.06 0.300 | 4 NA NA NA setosa
-#> 5 7.13 -0.787 | 5 NA NA NA setosa
+#> 1 7.61 -0.215 | 1 setosa 0.333 50 setosa
+#> 2 -1.83 0.728 | 2 versicolor 0.333 50 versicol…
+#> 3 -5.78 -0.513 | 3 virginica 0.333 50 virginica
+#> 4 8.06 -0.300 | 4 NA NA NA setosa
+#> 5 7.13 0.787 | 5 NA NA NA setosa
#> # ℹ 148 more rows
#> # ℹ 1 more variable: .element <chr>
#> #
#> # Columns (standard): [ 4 x 2 | 2 ]
#> LD1 LD2 | name .element
#> | <chr> <chr>
-#> 1 0.829 0.0241 | 1 Sepal.Length active
-#> 2 1.53 2.16 | 2 Sepal.Width active
-#> 3 -2.20 -0.932 | 3 Petal.Length active
-#> 4 -2.81 2.84 | 4 Petal.Width active
+#> 1 0.829 -0.0241 | 1 Sepal.Length active
+#> 2 1.53 -2.16 | 2 Sepal.Width active
+#> 3 -2.20 0.932 | 3 Petal.Length active
+#> 4 -2.81 -2.84 | 4 Petal.Width active