diff --git a/.github/workflows/rhub.yaml b/.github/workflows/rhub.yaml new file mode 100644 index 00000000..74ec7b05 --- /dev/null +++ b/.github/workflows/rhub.yaml @@ -0,0 +1,95 @@ +# R-hub's generic GitHub Actions workflow file. It's canonical location is at +# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml +# You can update this file to a newer version using the rhub2 package: +# +# rhub::rhub_setup() +# +# It is unlikely that you need to modify this file manually. + +name: R-hub +run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}" + +on: + workflow_dispatch: + inputs: + config: + description: 'A comma separated list of R-hub platforms to use.' + type: string + default: 'linux,windows,macos' + name: + description: 'Run name. You can leave this empty now.' + type: string + id: + description: 'Unique ID. You can leave this empty now.' + type: string + +jobs: + + setup: + runs-on: ubuntu-latest + outputs: + containers: ${{ steps.rhub-setup.outputs.containers }} + platforms: ${{ steps.rhub-setup.outputs.platforms }} + + steps: + # NO NEED TO CHECKOUT HERE + - uses: r-hub/actions/setup@v1 + with: + config: ${{ github.event.inputs.config }} + id: rhub-setup + + linux-containers: + needs: setup + if: ${{ needs.setup.outputs.containers != '[]' }} + runs-on: ubuntu-latest + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.containers) }} + container: + image: ${{ matrix.config.container }} + + steps: + - uses: r-hub/actions/checkout@v1 + - uses: r-hub/actions/platform-info@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/setup-deps@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/run-check@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + + other-platforms: + needs: setup + if: ${{ needs.setup.outputs.platforms != '[]' }} + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.platforms) }} + + steps: + - uses: r-hub/actions/checkout@v1 + - uses: r-hub/actions/setup-r@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} + - uses: r-hub/actions/platform-info@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/setup-deps@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} + - uses: r-hub/actions/run-check@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} diff --git a/DESCRIPTION b/DESCRIPTION index ba51f602..30e3be8b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: tourr Title: Tour Methods for Multivariate Data Visualisation -Version: 1.0.2 +Version: 1.2.0 Authors@R: c( person("Hadley", "Wickham", email = "h.wickham@gmail.com", role = c("aut", "ctb"), comment = c(ORCID = "0000-0003-4757-117X")), person("Dianne", "Cook", email = "dicook@monash.edu", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-3813-7155")), @@ -8,13 +8,6 @@ Authors@R: c( person("Ursula", "Laa", email = "ursula.laa@boku.ac.at", role = "ctb", comment = c(ORCID = "0000-0002-0249-6439")), person("H. Sherry","Zhang", email = "huizezhangsh@gmail.com", role = "ctb", comment = c(ORCID = "0000-0002-7122-1463")), person("Stuart", "Lee", email = "stuart.lee1@monash.edu", role = "ctb", comment = c(ORCID = "0000-0003-1179-8436"))) -Author: Hadley Wickham ["aut", "ctb"], - Dianne Cook ["aut", "cre"], - Nick Spyrison ["ctb"], - Ursula Laa ["ctb"], - H. Sherry Zhang ["ctb"], - Stuart Lee ["ctb"] -Maintainer: Dianne Cook Description: Implements geodesic interpolation and basis generation functions that allow you to create new tour methods from R. @@ -28,7 +21,7 @@ Imports: utils, grDevices Suggests: - TeachingDemos, + aplpack, ash, energy, testthat, diff --git a/LICENSE b/LICENSE index a04a547a..fd367831 100644 --- a/LICENSE +++ b/LICENSE @@ -1,2 +1,2 @@ -YEAR: 2010-2021 +YEAR: 2010-2024 COPYRIGHT HOLDER: Hadley Wickham, Di Cook diff --git a/NAMESPACE b/NAMESPACE index bb145d3f..133de2a4 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -35,6 +35,7 @@ export(animate_stars) export(animate_stereo) export(animate_trails) export(animate_xy) +export(anomaly_index) export(areColors) export(basis_init) export(basis_random) @@ -69,6 +70,7 @@ export(frozen_guided_tour) export(frozen_tour) export(geodesic_path) export(grand_tour) +export(guided_anomaly_tour) export(guided_section_tour) export(guided_tour) export(holes) @@ -79,6 +81,7 @@ export(linear_breaks) export(little_tour) export(local_tour) export(loess2d) +export(mahal_dist) export(manual_slice) export(mapColors) export(mapShapes) @@ -139,7 +142,9 @@ importFrom(graphics,rect) importFrom(graphics,segments) importFrom(graphics,stars) importFrom(graphics,text) +importFrom(stats,mahalanobis) importFrom(stats,na.omit) +importFrom(stats,qchisq) importFrom(stats,quantile) importFrom(stats,residuals) importFrom(stats,rnorm) diff --git a/NEWS.md b/NEWS.md index a9c92591..d9b89378 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,17 @@ +# tourr 1.2.0 + +* major change: rescale is now FALSE by default. +* flea is now standardised measurements, and flea_raw is the original units. +* TeachingDemos removed as a Suggests, and replaced with aplpack for drawing Chernoff faces. +* addition of a pre-specified ellipse can be added to the 2D display. +* palette can now be a vector of values. +* a new projection pursuit index for finding anomalies relative to a null variance-covariance matrix. May still need more work. +* point shapes can now be specified like palettes + +# tourr 1.1.0 + +* Updated version to indicate some nice new additions for the package + # tourr 1.0.2 * Fix to duplicating bases during interpolate diff --git a/R/anomaly-pursuit.r b/R/anomaly-pursuit.r new file mode 100644 index 00000000..48d86aeb --- /dev/null +++ b/R/anomaly-pursuit.r @@ -0,0 +1,15 @@ +#' Anomaly index. +#' +#' Calculates an index that looks for the best projection of +#' observations that are outside a pre-determined p-D ellipse. +#' +#' @export +anomaly_index <- function() { + + function(mat, ell2d, ellmu2d) { + + mat_tab <- #mean(mahal_dist(mat, ell2d)) + mean(mahalanobis(mat, center=ellmu2d, cov=ell2d)) + } +} + diff --git a/R/data.r b/R/data.r index bd9aa930..f1f1f50e 100644 --- a/R/data.r +++ b/R/data.r @@ -1,7 +1,8 @@ #' Flea beatle measurements #' #' This data is from a paper by A. A. Lubischew, "On the Use of Discriminant -#' Functions in Taxonomy", Biometrics, Dec 1962, pp.455-477. +#' Functions in Taxonomy", Biometrics, Dec 1962, pp.455-477. Data is +#' standardized, and original units are in flea_raw. #' #' \itemize{ #' \item tars1, width of the first joint of the first tarsus in microns @@ -16,7 +17,7 @@ #' } #' #' @name Flea measurements -#' @aliases flea +#' @aliases flea, flea_raw #' @docType data #' @format A 74 x 7 numeric array #' @keywords datasets @@ -25,7 +26,7 @@ #' head(flea) #' animate_xy(flea[, -7]) #' animate_xy(flea[, -7], col = flea[, 7]) -NULL +"flea" #' Turnable laser measurements from Bellcore #' diff --git a/R/display-faces.r b/R/display-faces.r index 5c72e62b..1a18e505 100644 --- a/R/display-faces.r +++ b/R/display-faces.r @@ -14,19 +14,19 @@ #' # The drawing code is fairly slow, so this animation works best with a #' # limited number of cases #' flea_s <- rescale(flea[,1:6]) -#' animate_faces(flea_s[1:2, 1:6]) -#' animate_faces(flea_s[1:4, 1:6]) +#' animate_faces(flea_s[19:24, 1:6]) #' -#' animate_faces(flea_s[1:2, 1:6], grand_tour(5)) +#' animate_faces(flea_s[19:24, 1:6], grand_tour(5)) display_faces <- function(...) { - if (!requireNamespace("TeachingDemos", quietly = TRUE)) { - stop("Please install the TeachingDemos package", call. = FALSE) + if (!requireNamespace("aplpack", quietly = TRUE)) { + stop("Please install the aplpack package", call. = FALSE) } render_data <- function(data, proj, geodesic) { x <- data %*% proj x <- (x + 2) / 4 - TeachingDemos::faces2(x, scale = "none") + aplpack::faces(x, scale = TRUE, face.type = 0, + cex = 0.1, print.info = FALSE) } list( diff --git a/R/display-groupxy.r b/R/display-groupxy.r index 3d8d283c..c72cbaaf 100644 --- a/R/display-groupxy.r +++ b/R/display-groupxy.r @@ -20,6 +20,8 @@ #' @param edges.col colour of edges to be plotted, Defaults to "black" #' @param edges.width line width for edges, default 1 #' @param palette name of color palette for point colour, used by \code{\link{hcl.colors}}, default "Zissou 1" +#' @param shapeset numbers corresponding to shapes in base R points, to use for mapping +#' categorical variable to shapes, default=c(15:17, 23:25) #' @param ... other arguments passed on to \code{\link{animate}} and #' \code{\link{display_groupxy}} #' @export @@ -39,7 +41,7 @@ display_groupxy <- function(centr = TRUE, axes = "center", half_range = NULL, col = "black", pch = 20, cex = 1, edges = NULL, edges.col = "black", edges.width=1, group_by = NULL, plot_xgp = TRUE, - palette = "Zissou 1", ...) { + palette = "Zissou 1", shapeset=c(15:17, 23:25), ...) { labels <- NULL # If colors are a variable, convert to colors @@ -53,7 +55,7 @@ display_groupxy <- function(centr = TRUE, axes = "center", half_range = NULL, } # If shapes are a variable, convert shapes if (is.factor(pch)) { - shapes <- mapShapes(pch) + shapes <- mapShapes(pch, shapeset) } else { shapes <- pch } diff --git a/R/display-xy.r b/R/display-xy.r index b3038db6..a4ef5075 100644 --- a/R/display-xy.r +++ b/R/display-xy.r @@ -13,12 +13,21 @@ #' @param pch shape of the point to be plotted, can be a factor or integer. Defaults to 20. #' @param cex size of the point to be plotted. Defaults to 1. #' @param edges.col colour of edges to be plotted, Defaults to "black" -#' @param obs_labels vector of text labels to display #' @param edges.width line width for edges, default 1 +#' @param obs_labels vector of text labels to display +#' @param ellipse pxp variance-covariance matrix defining ellipse, default NULL. Useful for +#' comparing data with some null hypothesis +#' @param ellc This can be considered the equivalent of a critical value, used to +#' scale the ellipse larger or smaller to capture more or fewer anomalies. Default 3. +#' @param ellmu This is the centre of the ellipse corresponding to the mean of the +#' normal population. Default vector of 0's #' @param palette name of color palette for point colour, used by \code{\link{hcl.colors}}, default "Zissou 1" +#' @param shapeset numbers corresponding to shapes in base R points, to use for mapping +#' categorical variable to shapes, default=c(15:17, 23:25) #' @param ... other arguments passed on to \code{\link{animate}} and #' \code{\link{display_xy}} #' @importFrom graphics legend +#' @importFrom stats mahalanobis qchisq #' @export #' @examples #' animate_xy(flea[, 1:6]) @@ -56,10 +65,14 @@ #' flea[, 1:6], grand_tour(), #' display_xy(axes = "bottomleft", edges = edges) #' ) +#' # An ellipse can be drawn on the data using a specified var-cov +#' animate_xy(flea[, 1:6], axes = "off", ellipse=cov(flea[,1:6])) display_xy <- function(center = TRUE, axes = "center", half_range = NULL, col = "black", pch = 20, cex = 1, edges = NULL, edges.col = "black", edges.width=1, - obs_labels = NULL, palette="Zissou 1", ...) { + obs_labels = NULL, + ellipse = NULL, ellc = NULL, ellmu = NULL, + palette="Zissou 1", shapeset=c(15:17, 23:25), ...) { # Needed for CRAN checks labels <- NULL gps <- NULL @@ -76,7 +89,7 @@ display_xy <- function(center = TRUE, axes = "center", half_range = NULL, } # If shapes are a variable, convert shapes if (is.factor(pch)) { - shapes <- mapShapes(pch) + shapes <- mapShapes(pch, shapeset) } else { shapes <- pch } @@ -84,6 +97,21 @@ display_xy <- function(center = TRUE, axes = "center", half_range = NULL, init <- function(data) { half_range <<- compute_half_range(half_range, data, center) labels <<- abbreviate(colnames(data), 3) + + if (!is.null(ellipse)) { + if (nrow(ellipse) == ncol(data)) { + + if (is.null(ellc)) + ellc <<- qchisq(0.95, ncol(data)) + else + stopifnot(ellc > 0) # Needs to be positive + if (is.null(ellmu)) + ellmu <<- rep(0, ncol(data)) + else + stopifnot(length(ellmu) == ncol(data)) # Right dimension + message("Using ellc = ", format(ellc, digits = 2)) + } + } } if (!is.null(edges)) { @@ -140,7 +168,75 @@ display_xy <- function(center = TRUE, axes = "center", half_range = NULL, # Add index value if using guided tour #if (!is.na(cur_index)) # text(0, 0, labels=round(cur_index, 2)) + # Draw a pre-determined ellipse on the data + if (!is.null(ellipse)) { + if (nrow(ellipse) == nrow(proj)) { + + # if (is.null(ellc)) + # ellc <- qchisq(0.95, nrow(proj)) + # else + # stopifnot(ellc > 0) # Needs to be positive + # if (is.null(ellmu)) + # ellmu <- rep(0, nrow(proj)) + # else + # stopifnot(length(ellmu) == nrow(proj)) # Right dimension + # message("Using ellc = ", format(ellc, digits = 2)) + # Project ellipse into 2D + # Notation in paper: ellipse=A, ellinv=A^(-1), + # e2=P^TA^(-1)P, ell2d=B + # ellipse=var-cov of normal pop + # ellinv for defining pD ellipse, for dist calc + # e2 is projected var-cov + # ell2d is B, used to project ellipse points + evc <- eigen(ellipse) # + ellinv <- (evc$vectors) %*% diag(evc$values) %*% t(evc$vectors) + e2 <- t(proj) %*% ellipse %*% proj + evc2 <- eigen(e2) + ell2d <- as.matrix((evc2$vectors)) %*% diag(sqrt(evc2$values*ellc)) %*% t(as.matrix(evc2$vectors)) + #e3 <- eigen(ell2d) + #ell2dinv <- (e3$vectors) %*% diag(e3$values) %*% t(e3$vectors) + + # Compute the points on an ellipse + # Generate points on a circle + sph <- geozoo::sphere.hollow(2, 200)$points + # Organise so lines connecting consecutive + # points creates the circle + sph <- sph[order(sph[,2]),] + sph1 <- sph[sph[,2]>=0,] + sph2 <- sph[sph[,2]<0,] + sph1 <- sph1[order(sph1[,1]),] + sph2 <- sph2[order(sph2[,1], decreasing=T),] + sph <- rbind(sph1, sph2) + sph <- rbind(sph, sph[1,]) + + # Transform circle points into an ellipse + sph2d <- sph%*%ell2d + # Centre on the given mean + ellmu2d <- t(as.matrix(ellmu)) %*% proj + sph2d <- sweep(sph2d, 2, ellmu2d, `+`) + # Scale ellipse into plot space + sph2d <- sph2d/half_range + + lines(sph2d) + + # Colour points outside the pD ellipse + mdst <- mahalanobis(data, + center=ellmu, + cov=ellipse) + #mdst <- mahal_dist(data, ellipse) + anomalies <- which(mdst > ellc) + #cat("1 ", length(anomalies), "\n") + if (length(anomalies) > 0) { + points(x[anomalies,], + col = "red", + pch = 4, + cex = 2) + } + } + else + message("Check the variance-covariance matrix generating the ellipse\n") + } } list( @@ -168,6 +264,9 @@ animate_xy <- function(data, tour_path = grand_tour(), ...) { #' projected data, default 1 #' @param position position of the axes: center (default), #' bottomleft or off +#' @param axis.col colour of axes, default "grey50" +#' @param axis.lwd linewidth of axes, default 1 +#' @param axis.text.col colour of axes text, default "grey50" #' @param ... other arguments passed #' @export #' @examples @@ -185,7 +284,8 @@ animate_xy <- function(data, tour_path = grand_tour(), ...) { #' xlim = c(-3, 3), ylim = c(-3, 3), #' xlab="P1", ylab="P2") #' draw_tour_axes(prj, colnames(flea)[1:6], limits=3, position="bottomleft") -draw_tour_axes <- function(proj, labels, limits=1, position="center", ...) { +draw_tour_axes <- function(proj, labels, limits=1, position="center", + axis.col= "grey50", axis.lwd=1, axis.text.col= "grey50", ...) { position <- match.arg(position, c("center", "bottomleft", "off")) if (position == "off") { return() @@ -201,13 +301,16 @@ draw_tour_axes <- function(proj, labels, limits=1, position="center", ...) { adj <- function(x) axis_pos + x * axis_scale - segments(adj(0), adj(0), adj(proj[, 1]), adj(proj[, 2]), col = "grey50") + segments(adj(0), adj(0), adj(proj[, 1]), adj(proj[, 2]), + col = axis.col, lwd = axis.lwd) # if (!is.null(mvar)) { # colour manip var # if ((mvar < (nrow(proj)+1)) & (mvar > 0)) { # segments(adj(0), adj(0), adj(proj[, 1]), adj(proj[, 2]), col = "orange") # } # } theta <- seq(0, 2 * pi, length = 50) - lines(adj(cos(theta)), adj(sin(theta)), col = "grey50") - text(adj(proj[, 1]), adj(proj[, 2]), label = labels, col = "grey50") + lines(adj(cos(theta)), adj(sin(theta)), + col = axis.col, lwd = axis.lwd) + text(adj(proj[, 1]), adj(proj[, 2]), label = labels, + col = axis.text.col) } diff --git a/R/interesting-indices.r b/R/interesting-indices.r index 462f0314..e9b81479 100644 --- a/R/interesting-indices.r +++ b/R/interesting-indices.r @@ -103,8 +103,8 @@ loess2d <- function() { #' #' Compares the similarity between the projected distribution and a normal distribution. #' \itemize{ -#' \item{norm_bin }{compares the count in 100 histogram bins} -#' \item{norm_kol }{compares the cdf based on the Kolmogorov–Smirnov test (KS test)} +#' \item norm_bin: compares the count in 100 histogram bins +#' \item norm_kol: compares the cdf based on the Kolmogorov–Smirnov test (KS test) #' } #' @param nr The number of rows in the target matrix #' diff --git a/R/linear-algebra.r b/R/linear-algebra.r index 5b1b0236..1aa441ff 100644 --- a/R/linear-algebra.r +++ b/R/linear-algebra.r @@ -111,3 +111,25 @@ orthonormalise_by <- function(x, by) { #' @keywords algebra #' @export proj_dist <- function(x, y) sqrt(sum((x %*% t(x) - y %*% t(y))^2)) + +#' Calculate the Mahalanobis distance between points and center. +#' +#' Computes the Mahalanobis distance using a provided variance-covariance +#' matrix of observations from 0. +# +#' @param x matrix of data +#' @param vc pre-determined variance-covariance matrix +#' @keywords algebra +#' @export +mahal_dist <- function(x, vc) { + n <- dim(x)[1] + p <- dim(x)[2] + mn <- rep(0, p) + ev <- eigen(vc) + vcinv <- ev$vectors %*% diag(1/ev$values) %*% t(ev$vectors) + x <- x - matrix(rep(mn, n), ncol = p, byrow = T) + dx <- NULL + for (i in 1:n) + dx <- c(dx, x[i, ] %*% vcinv %*% as.matrix(x[i, ])) + return(dx) +} diff --git a/R/tour-guided-anomaly.r b/R/tour-guided-anomaly.r new file mode 100644 index 00000000..0271b93d --- /dev/null +++ b/R/tour-guided-anomaly.r @@ -0,0 +1,123 @@ +#' A guided anomaly tour path. +#' +#' The guided anomaly tour is a variation of the guided tour that is +#' using an ellipse to determine anomalies on which to select target planes. +#' +#' Usually, you will not call this function directly, but will pass it to +#' a method that works with tour paths like \code{\link{animate_slice}}, +#' \code{\link{save_history}} or \code{\link{render}}. +#' +#' @param index_f the section pursuit index function to optimise. The function +#' needs to take two arguments, the projected data, indexes of anomalies. +#' @param d target dimensionality +#' @param alpha the initial size of the search window, in radians +#' @param cooling the amount the size of the search window should be adjusted +#' by after each step +#' @param search_f the search strategy to use +#' @param max.tries the maximum number of unsuccessful attempts to find +#' a better projection before giving up +#' @param max.i the maximum index value, stop search if a larger value is found +#' @param ellipse pxp variance-covariance matrix defining ellipse, default NULL. +#' Useful for comparing data with some hypothesized null. +#' @param ellc This can be considered the equivalent of a critical value, used to +#' scale the ellipse larger or smaller to capture more or fewer anomalies. Default 3. +#' @param ellmu This is the centre of the ellipse corresponding to the mean of the +#' normal population. Default vector of 0's +#' @param ... arguments sent to the search_f +#' @seealso \code{\link{slice_index}} for an example of an index functions. +#' \code{\link{search_geodesic}}, \code{\link{search_better}}, +#' \code{\link{search_better_random}} for different search strategies +#' @importFrom stats mahalanobis qchisq +#' @export +#' @examples +#' animate_xy(flea[, 1:6], guided_anomaly_tour(anomaly_index(), +#' ellipse=cov(flea[,1:6])), ellipse=cov(flea[,1:6]), axes="off") +guided_anomaly_tour <- function(index_f, d = 2, alpha = 0.5, cooling = 0.99, + max.tries = 25, max.i = Inf, + ellipse, ellc=NULL, ellmu=NULL, + search_f = search_geodesic, ...) { + h <- NULL + + generator <- function(current, data, tries, ...) { + if (is.null(current)) { + return(basis_init(ncol(data), d)) + } + + if (is.null(h)) { + half_range <- compute_half_range(NULL, data, FALSE) + } + + index <- function(proj) { + if (nrow(ellipse) == nrow(proj)) { + + if (is.null(ellc)) + ellc <<- qchisq(0.95, nrow(proj)) + else + stopifnot(ellc > 0) # Needs to be positive + if (is.null(ellmu)) + ellmu <<- rep(0, nrow(proj)) + else + stopifnot(length(ellmu) == nrow(proj)) # Right dimension + #message("Using ellc = ", format(ellc, digits = 2)) + + # Check which observations are outside pD ellipse + mdst <- mahalanobis(data, + center=ellmu, + cov=ellipse) + #mdst <- mahal_dist(data, ellipse) + anomalies <- which(mdst > ellc) + stopifnot(length(anomalies) > 0) + #cat(length(anomalies), "\n") + + # Project ellipse into 2D + evc <- eigen(ellipse) # + ellinv <- (evc$vectors) %*% as.matrix(diag(evc$values)) %*% t(evc$vectors) + e2 <- t(proj) %*% ellipse %*% proj + evc2 <- eigen(e2) + ell2d <- as.matrix(evc2$vectors) %*% diag(sqrt(evc2$values*ellc)) %*% t(as.matrix(evc2$vectors)) + + ell2dinv <- (evc2$vectors) %*% diag(evc2$values*ellc) %*% t(evc2$vectors) + ellmu2d <- t(as.matrix(ellmu)) %*% proj + #evc <- eigen(ellipse) + #ellinv <- (evc$vectors) %*% diag(evc$values) %*% t(evc$vectors) + #e2 <- t(proj) %*% ellinv %*% proj + #evc2 <- eigen(e2) + #ell2d <- (evc2$vectors) %*% diag(sqrt(evc2$values)) %*% t(evc2$vectors) + #e3 <- eigen(ell2d) + #ell2dinv <- (e3$vectors) %*% diag(e3$values) %*% t(e3$vectors) + index_f(as.matrix(data[anomalies,]) %*% proj, e2, ellmu2d) + } + } + + cur_index <- index(current) + + if (cur_index > max.i) { + cat("Found index ", cur_index, ", larger than selected maximum ", max.i, ". Stopping search.\n", + sep = "" + ) + cat("Final projection: \n") + if (ncol(current) == 1) { + for (i in 1:length(current)) { + cat(sprintf("%.3f", current[i]), " ") + } + cat("\n") + } + else { + for (i in 1:nrow(current)) { + for (j in 1:ncol(current)) { + cat(sprintf("%.3f", current[i, j]), " ") + } + cat("\n") + } + } + return(NULL) + } + + basis <- search_f(current, alpha, index, tries, max.tries, cur_index = cur_index, ...) + alpha <<- alpha * cooling + + list(target = basis$target, index = index) + } + + new_geodesic_path("guided", generator) +} diff --git a/R/tour-guided-section.r b/R/tour-guided-section.r index 84bc0574..e7898fe7 100644 --- a/R/tour-guided-section.r +++ b/R/tour-guided-section.r @@ -7,7 +7,7 @@ #' a method that works with tour paths like \code{\link{animate_slice}}, #' \code{\link{save_history}} or \code{\link{render}}. #' -#' @param index_f the section purusit index function to optimise. The function +#' @param index_f the section pursuit index function to optimise. The function #' needs to take three arguments, the projected data, the vector of distances #' from the current projection plane, and the slice thickness h. #' @param d target dimensionality @@ -19,7 +19,7 @@ #' a better projection before giving up #' @param max.i the maximum index value, stop search if a larger value is found #' @param v_rel relative volume of the slice. If not set, suggested value -#' is caluclated and printed to the screen. +#' is calculated and printed to the screen. #' @param anchor A vector specifying the reference point to anchor the slice. #' If NULL (default) the slice will be anchored at the data center. #' @param ... arguments sent to the search_f diff --git a/R/tour-radial.r b/R/tour-radial.r index 6f8af67f..685d892d 100644 --- a/R/tour-radial.r +++ b/R/tour-radial.r @@ -12,10 +12,10 @@ #' @param ... additional arguments for drawing #' @export #' @examples -#' animate_xy(flea[, 1:6], radial_tour(basis_random(6, 2), mvar = 4)) -#' animate_xy(flea[, 1:6], radial_tour(basis_random(6, 2), mvar = c(3,4))) -#' animate_dist(flea[, 1:6], radial_tour(basis_random(6, 1), mvar = 4)) -#' animate_scatmat(flea[, 1:6], radial_tour(basis_random(6, 3), mvar = 4)) +#' animate_xy(flea[, 1:6], radial_tour(basis_random(6, 2), mvar = 4), rescale=TRUE) +#' animate_xy(flea[, 1:6], radial_tour(basis_random(6, 2), mvar = c(3,4)), rescale=TRUE) +#' animate_dist(flea[, 1:6], radial_tour(basis_random(6, 1), mvar = 4), rescale=TRUE) +#' animate_scatmat(flea[, 1:6], radial_tour(basis_random(6, 3), mvar = 4), rescale=TRUE) radial_tour <- function(start, mvar = 1, ...) { first <- TRUE out <- TRUE diff --git a/R/util.r b/R/util.r index 9a7bb10a..e2750d10 100644 --- a/R/util.r +++ b/R/util.r @@ -140,16 +140,25 @@ areColors <- function(x) { #' @export mapColors <- function(x, palette) { n <- length(unique(x)) - pal <- grDevices::hcl.colors(n, palette=palette) + # Handle manual colour setting + if (length(palette) > 1) { + stopifnot(length(palette) == n) + pal <- palette + } + else { + pal <- grDevices::hcl.colors(n, palette=palette) + } pal[as.numeric(as.factor(x))] } #' Map vector of factors to pch #' #' @param x vector +#' @param shapeset vector of integers indicating point shapes #' @export -mapShapes <- function(x) { +mapShapes <- function(x, shapeset) { n <- length(unique(x)) - shapes <- c(15:17, 23:25) + stopifnot(length(shapeset) >= n) + shapes <- shapeset shapes[as.numeric(x)] } diff --git a/cran-comments.md b/cran-comments.md index 0c3b9392..8f87ae85 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,57 +1,43 @@ ## Overview -This is a small update, with one new displayand several bug fixes. There are no major structural changes to the code, though. +The main change was removing the dependency on TeachingDemos as requested by CRAN. -\dontrun is used for example code where the method would break, and thus the code should not be run. It is important for users to be able to see these examples. +Other changes are minor, except that a different default for all animations might affect current users. -## ── R CMD check results ──────────────────────── tourr 1.0.2 ──── -Duration: 1m 17s +── R CMD check results ──────────────── tourr 1.2.0 ──── +Duration: 1m 18.7s 0 errors ✔ | 0 warnings ✔ | 0 notes ✔ ## Test environment -* local R installation: R version 4.3.1 (2023-06-16) -* Windows Server 2022, R-devel, 64 bit -* Fedora Linux, R-devel, clang, gfortran -* Ubuntu Linux 20.04.1 LTS, R-release, GCC - -using `check_rhub()`, returns some notes: - -* checking HTML version of manual ... NOTE -Skipping checking HTML validation: no command 'tidy' found -Skipping checking math rendering: package 'V8' unavailable - -* checking for non-standard things in the check directory ... NOTE -Found the following files/directories: - ''NULL'' - -* checking for detritus in the temp directory ... NOTE -Found the following files/directories: - 'lastMiKTeXException' - -Which I understand can be ignored +* R version 4.3.3 (Angel Food Cake) +* Windows: Using https://win-builder.r-project.org/ +* Linux: Using `rhub::rc_submit()` ## Downstream dependencies All downstream dependencies have been checked. > revdepcheck::revdep_check() -── CHECK ──────────────────────────────────────── 11 packages ── -✔ cheem 0.3.0 ── E: 0 | W: 0 | N: 0 -✔ composits 0.1.1 ── E: 1 | W: 0 | N: 0 +── INIT ───────────────────────────────── Computing revdeps ── +── INSTALL ───────────────────────────────────── 2 versions ── +Installing CRAN version of tourr +Installing DEV version of tourr +── CHECK ────────────────────────────────────── 12 packages ── +✔ cheem 0.4.0.0 ── E: 0 | W: 0 | N: 0 +✔ composits 0.1.1 ── E: 0 | W: 0 | N: 0 ✔ detourr 0.1.0 ── E: 0 | W: 0 | N: 1 I diveR 0.1.2 ── E: 1 | W: 0 | N: 0 ✔ ferrn 0.0.2 ── E: 0 | W: 0 | N: 0 ✔ geozoo 0.5.1 ── E: 0 | W: 0 | N: 0 ✔ liminal 0.1.2 ── E: 0 | W: 0 | N: 0 -I loon.tourr 0.1.3 ── E: 1 | W: 0 | N: 0 -✔ mulgar 1.0.1 ── E: 0 | W: 0 | N: 0 -I REPPlab 0.9.4 ── E: 1 | W: 0 | N: 0 -✔ spinifex 0.3.6 ── E: 0 | W: 0 | N: 1 +I loon.tourr 0.1.4 ── E: 1 | W: 0 | N: 0 +✔ mulgar 1.0.2 ── E: 0 | W: 0 | N: 0 +I REPPlab 0.9.6 ── E: 1 | W: 0 | N: 0 +✔ spinifex 0.3.7.0 ── E: 0 | W: 0 | N: 0 ✔ woylier 0.0.5 ── E: 0 | W: 0 | N: 0 -OK: 12 +OK: 12 BROKEN: 0 -Total time: 13 min - -REPPlab cannot be fully checked because it uses RJava, which is difficult to install at present. REPPlab doesn't Depend, but only Suggests, the tourr package. diveR appears to be a helper package for interactive graphics but it fails to load properly for me, so I can't easily check the problems. +Total time: 12 min +── REPORT ──────────────────────────────────────────────────── diff --git a/data/flea.rda b/data/flea.rda index 393487df..6684e430 100644 Binary files a/data/flea.rda and b/data/flea.rda differ diff --git a/data/flea_raw.rda b/data/flea_raw.rda new file mode 100644 index 00000000..d97c31e8 Binary files /dev/null and b/data/flea_raw.rda differ diff --git a/docs/404.html b/docs/404.html index 54d0a3f6..52908e2e 100644 --- a/docs/404.html +++ b/docs/404.html @@ -39,7 +39,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index c832b5a2..5285c72a 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/articles/edges.html b/docs/articles/edges.html index 60c095a8..6fa90ac0 100644 --- a/docs/articles/edges.html +++ b/docs/articles/edges.html @@ -40,7 +40,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/articles/edges_files/figure-html/unnamed-chunk-2-1.png b/docs/articles/edges_files/figure-html/unnamed-chunk-2-1.png index 828e04ea..4594eee1 100644 Binary files a/docs/articles/edges_files/figure-html/unnamed-chunk-2-1.png and b/docs/articles/edges_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/docs/articles/edges_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/edges_files/figure-html/unnamed-chunk-3-1.png index 29c9edad..729e2245 100644 Binary files a/docs/articles/edges_files/figure-html/unnamed-chunk-3-1.png and b/docs/articles/edges_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/docs/articles/index.html b/docs/articles/index.html index ca2c803d..1baedf20 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/articles/tourr.html b/docs/articles/tourr.html index c680e8d0..e6dbde09 100644 --- a/docs/articles/tourr.html +++ b/docs/articles/tourr.html @@ -40,7 +40,7 @@ tourr - 1.0.2 + 1.1.0 @@ -182,7 +182,7 @@

Tour typesanimate(f, tour_path = guided_tour(holes()), display = display_xy()) -#> Value 1.103 35.5 % better - NEW BASIS +#> Value 0.967 46.9 % better - NEW BASIS #> Using half_range 4.4

When running the full guided tour for this example, the final view @@ -193,7 +193,7 @@

Tour typesanimate(f, tour_path = guided_tour(holes()), display = display_xy(col = flea$species)) -#> Value 1.059 8.6 % better - NEW BASIS +#> Value 0.907 26.8 % better - NEW BASIS #> Using half_range 4.4

Alternatively, a colour vector can be created manually and passed @@ -208,7 +208,7 @@

Tour typesanimate(f, tour_path = guided_tour(holes()), display = display_xy(col = flea_col)) -#> Value 0.848 7.2 % better - NEW BASIS +#> Value 1.083 26.0 % better - NEW BASIS #> Using half_range 4.4

diff --git a/docs/articles/tourr_files/figure-html/unnamed-chunk-2-1.png b/docs/articles/tourr_files/figure-html/unnamed-chunk-2-1.png index 3a50c6ee..85710ddd 100644 Binary files a/docs/articles/tourr_files/figure-html/unnamed-chunk-2-1.png and b/docs/articles/tourr_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/docs/articles/tourr_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/tourr_files/figure-html/unnamed-chunk-3-1.png index 8985ebba..7695aae3 100644 Binary files a/docs/articles/tourr_files/figure-html/unnamed-chunk-3-1.png and b/docs/articles/tourr_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/docs/articles/tourr_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/tourr_files/figure-html/unnamed-chunk-4-1.png index 2e404316..5997e964 100644 Binary files a/docs/articles/tourr_files/figure-html/unnamed-chunk-4-1.png and b/docs/articles/tourr_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/docs/articles/tourr_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/tourr_files/figure-html/unnamed-chunk-5-1.png index f4310404..38d1638e 100644 Binary files a/docs/articles/tourr_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/tourr_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/articles/tourr_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/tourr_files/figure-html/unnamed-chunk-6-1.png index 22f2f86b..456217c6 100644 Binary files a/docs/articles/tourr_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/tourr_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/docs/articles/tourr_files/figure-html/unnamed-chunk-7-2.png b/docs/articles/tourr_files/figure-html/unnamed-chunk-7-2.png index e53fb179..91dd05e0 100644 Binary files a/docs/articles/tourr_files/figure-html/unnamed-chunk-7-2.png and b/docs/articles/tourr_files/figure-html/unnamed-chunk-7-2.png differ diff --git a/docs/articles/tourr_files/figure-html/unnamed-chunk-8-2.png b/docs/articles/tourr_files/figure-html/unnamed-chunk-8-2.png index 0371f444..cc24e6e1 100644 Binary files a/docs/articles/tourr_files/figure-html/unnamed-chunk-8-2.png and b/docs/articles/tourr_files/figure-html/unnamed-chunk-8-2.png differ diff --git a/docs/articles/tourr_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/tourr_files/figure-html/unnamed-chunk-9-1.png index d93837d2..f4611543 100644 Binary files a/docs/articles/tourr_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/tourr_files/figure-html/unnamed-chunk-9-1.png differ diff --git a/docs/authors.html b/docs/authors.html index 5ff4f757..3654a8d4 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/index.html b/docs/index.html index 63a71af4..0f36e362 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/news/index.html b/docs/news/index.html index c112933c..72668b97 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 @@ -60,6 +60,10 @@

Changelog

Source: NEWS.md +
+ +
diff --git a/docs/reference/Laser-measurements-1.png b/docs/reference/Laser-measurements-1.png index 51359a97..0bbd7171 100644 Binary files a/docs/reference/Laser-measurements-1.png and b/docs/reference/Laser-measurements-1.png differ diff --git a/docs/reference/Laser-measurements.html b/docs/reference/Laser-measurements.html index 28e6ad5f..3d966a66 100644 --- a/docs/reference/Laser-measurements.html +++ b/docs/reference/Laser-measurements.html @@ -19,7 +19,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/Olive-oil-measurements-1.png b/docs/reference/Olive-oil-measurements-1.png index e642dc81..d25fac09 100644 Binary files a/docs/reference/Olive-oil-measurements-1.png and b/docs/reference/Olive-oil-measurements-1.png differ diff --git a/docs/reference/Olive-oil-measurements-2.png b/docs/reference/Olive-oil-measurements-2.png index 335ceee2..41a4f175 100644 Binary files a/docs/reference/Olive-oil-measurements-2.png and b/docs/reference/Olive-oil-measurements-2.png differ diff --git a/docs/reference/Olive-oil-measurements.html b/docs/reference/Olive-oil-measurements.html index 41bc1709..19105429 100644 --- a/docs/reference/Olive-oil-measurements.html +++ b/docs/reference/Olive-oil-measurements.html @@ -20,7 +20,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/Ozone-measurements.html b/docs/reference/Ozone-measurements.html index 4acbe205..8b0d13ef 100644 --- a/docs/reference/Ozone-measurements.html +++ b/docs/reference/Ozone-measurements.html @@ -22,7 +22,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/Places-Ratings-1.png b/docs/reference/Places-Ratings-1.png index ba3d6882..a160ae49 100644 Binary files a/docs/reference/Places-Ratings-1.png and b/docs/reference/Places-Ratings-1.png differ diff --git a/docs/reference/Places-Ratings.html b/docs/reference/Places-Ratings.html index 31339093..52daa719 100644 --- a/docs/reference/Places-Ratings.html +++ b/docs/reference/Places-Ratings.html @@ -20,7 +20,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/Rat-CNS-1.png b/docs/reference/Rat-CNS-1.png index 999d8575..398c99b7 100644 Binary files a/docs/reference/Rat-CNS-1.png and b/docs/reference/Rat-CNS-1.png differ diff --git a/docs/reference/Rat-CNS.html b/docs/reference/Rat-CNS.html index f7b23dd1..1c8bf2be 100644 --- a/docs/reference/Rat-CNS.html +++ b/docs/reference/Rat-CNS.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/Rplot007.png b/docs/reference/Rplot007.png index b61563c3..fede06ad 100644 Binary files a/docs/reference/Rplot007.png and b/docs/reference/Rplot007.png differ diff --git a/docs/reference/Rplot008.png b/docs/reference/Rplot008.png index a1dd89a6..9b858980 100644 Binary files a/docs/reference/Rplot008.png and b/docs/reference/Rplot008.png differ diff --git a/docs/reference/Rplot009.png b/docs/reference/Rplot009.png index 28dfdffc..3ba95815 100644 Binary files a/docs/reference/Rplot009.png and b/docs/reference/Rplot009.png differ diff --git a/docs/reference/Rplot010.png b/docs/reference/Rplot010.png index 47edb819..f18042f1 100644 Binary files a/docs/reference/Rplot010.png and b/docs/reference/Rplot010.png differ diff --git a/docs/reference/Rplot011.png b/docs/reference/Rplot011.png index 1d3c6339..6dfc9aa0 100644 Binary files a/docs/reference/Rplot011.png and b/docs/reference/Rplot011.png differ diff --git a/docs/reference/Rplot012.png b/docs/reference/Rplot012.png index c034ad72..4a8648f9 100644 Binary files a/docs/reference/Rplot012.png and b/docs/reference/Rplot012.png differ diff --git a/docs/reference/Rplot013.png b/docs/reference/Rplot013.png index 167b9582..80208128 100644 Binary files a/docs/reference/Rplot013.png and b/docs/reference/Rplot013.png differ diff --git a/docs/reference/Rplot014.png b/docs/reference/Rplot014.png index 35adbda7..a634cc1a 100644 Binary files a/docs/reference/Rplot014.png and b/docs/reference/Rplot014.png differ diff --git a/docs/reference/Rplot015.png b/docs/reference/Rplot015.png index a5d57bb2..ececbd1f 100644 Binary files a/docs/reference/Rplot015.png and b/docs/reference/Rplot015.png differ diff --git a/docs/reference/Rplot016.png b/docs/reference/Rplot016.png index df7d05d3..56765aec 100644 Binary files a/docs/reference/Rplot016.png and b/docs/reference/Rplot016.png differ diff --git a/docs/reference/Rplot017.png b/docs/reference/Rplot017.png index c894d1f7..c83a96a0 100644 Binary files a/docs/reference/Rplot017.png and b/docs/reference/Rplot017.png differ diff --git a/docs/reference/Rplot018.png b/docs/reference/Rplot018.png index a2962b11..6f08edcd 100644 Binary files a/docs/reference/Rplot018.png and b/docs/reference/Rplot018.png differ diff --git a/docs/reference/Rplot021.png b/docs/reference/Rplot021.png index 7e4e5598..c104a51a 100644 Binary files a/docs/reference/Rplot021.png and b/docs/reference/Rplot021.png differ diff --git a/docs/reference/Rplot024.png b/docs/reference/Rplot024.png index 0e015eff..654df2f0 100644 Binary files a/docs/reference/Rplot024.png and b/docs/reference/Rplot024.png differ diff --git a/docs/reference/Rplot027.png b/docs/reference/Rplot027.png index 5e897175..74bdfc98 100644 Binary files a/docs/reference/Rplot027.png and b/docs/reference/Rplot027.png differ diff --git a/docs/reference/Rplot030.png b/docs/reference/Rplot030.png index 06e35c7f..d9c43e90 100644 Binary files a/docs/reference/Rplot030.png and b/docs/reference/Rplot030.png differ diff --git a/docs/reference/Rplot031.png b/docs/reference/Rplot031.png index 87577589..17433d54 100644 Binary files a/docs/reference/Rplot031.png and b/docs/reference/Rplot031.png differ diff --git a/docs/reference/Rplot034.png b/docs/reference/Rplot034.png index bb5bf859..ed820191 100644 Binary files a/docs/reference/Rplot034.png and b/docs/reference/Rplot034.png differ diff --git a/docs/reference/Tropical-Atmosphere-Ocean.html b/docs/reference/Tropical-Atmosphere-Ocean.html index 26da657a..8d1630e0 100644 --- a/docs/reference/Tropical-Atmosphere-Ocean.html +++ b/docs/reference/Tropical-Atmosphere-Ocean.html @@ -24,7 +24,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/anaglyph.html b/docs/reference/anaglyph.html index 2e95b6b4..5d51ca8b 100644 --- a/docs/reference/anaglyph.html +++ b/docs/reference/anaglyph.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/anchored_orthogonal_distance.html b/docs/reference/anchored_orthogonal_distance.html index 5696aac4..e968dcf1 100644 --- a/docs/reference/anchored_orthogonal_distance.html +++ b/docs/reference/anchored_orthogonal_distance.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/andrews-2.png b/docs/reference/andrews-2.png index 1dd13819..8723d088 100644 Binary files a/docs/reference/andrews-2.png and b/docs/reference/andrews-2.png differ diff --git a/docs/reference/andrews.html b/docs/reference/andrews.html index 955c50cc..3cc6aeef 100644 --- a/docs/reference/andrews.html +++ b/docs/reference/andrews.html @@ -19,7 +19,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/angular_breaks.html b/docs/reference/angular_breaks.html index 4cc4552e..87609983 100644 --- a/docs/reference/angular_breaks.html +++ b/docs/reference/angular_breaks.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/animate-1.png b/docs/reference/animate-1.png index 004e00fb..8f4f4443 100644 Binary files a/docs/reference/animate-1.png and b/docs/reference/animate-1.png differ diff --git a/docs/reference/animate-2.png b/docs/reference/animate-2.png index 352cddf1..17808ce5 100644 Binary files a/docs/reference/animate-2.png and b/docs/reference/animate-2.png differ diff --git a/docs/reference/animate-3.png b/docs/reference/animate-3.png index a4d5e385..3f960b39 100644 Binary files a/docs/reference/animate-3.png and b/docs/reference/animate-3.png differ diff --git a/docs/reference/animate-4.png b/docs/reference/animate-4.png index c8ed2cce..d301f172 100644 Binary files a/docs/reference/animate-4.png and b/docs/reference/animate-4.png differ diff --git a/docs/reference/animate.html b/docs/reference/animate.html index 263a9169..c2f29d7c 100644 --- a/docs/reference/animate.html +++ b/docs/reference/animate.html @@ -20,7 +20,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/areColors.html b/docs/reference/areColors.html index 9a955efb..d27e8b41 100644 --- a/docs/reference/areColors.html +++ b/docs/reference/areColors.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/bases_little.html b/docs/reference/bases_little.html index 9d7d477a..8152cf9a 100644 --- a/docs/reference/bases_little.html +++ b/docs/reference/bases_little.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/basis_init.html b/docs/reference/basis_init.html index 7870249e..0a36c37b 100644 --- a/docs/reference/basis_init.html +++ b/docs/reference/basis_init.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/basis_nearby.html b/docs/reference/basis_nearby.html index ea15b795..645375f0 100644 --- a/docs/reference/basis_nearby.html +++ b/docs/reference/basis_nearby.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/basis_random.html b/docs/reference/basis_random.html index 45d749e3..9f2c8b20 100644 --- a/docs/reference/basis_random.html +++ b/docs/reference/basis_random.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/blank_plot.html b/docs/reference/blank_plot.html index 30eff18e..d876f312 100644 --- a/docs/reference/blank_plot.html +++ b/docs/reference/blank_plot.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/center.html b/docs/reference/center.html index 11bc6196..bb477961 100644 --- a/docs/reference/center.html +++ b/docs/reference/center.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/check_freezer_safe.html b/docs/reference/check_freezer_safe.html index b2b08f1a..25b62550 100644 --- a/docs/reference/check_freezer_safe.html +++ b/docs/reference/check_freezer_safe.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/cmass.html b/docs/reference/cmass.html index 9aeec366..839bbb5f 100644 --- a/docs/reference/cmass.html +++ b/docs/reference/cmass.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/compute_v_rel.html b/docs/reference/compute_v_rel.html index a0e27f1c..0c007416 100644 --- a/docs/reference/compute_v_rel.html +++ b/docs/reference/compute_v_rel.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/correct_orientation.html b/docs/reference/correct_orientation.html index 50ca51a1..bd6f85f3 100644 --- a/docs/reference/correct_orientation.html +++ b/docs/reference/correct_orientation.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/cumulative_radial.html b/docs/reference/cumulative_radial.html index d9391e3e..56884e13 100644 --- a/docs/reference/cumulative_radial.html +++ b/docs/reference/cumulative_radial.html @@ -20,7 +20,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/dcor2d.html b/docs/reference/dcor2d.html index 207cb42f..600316c4 100644 --- a/docs/reference/dcor2d.html +++ b/docs/reference/dcor2d.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/dependence_tour-1.png b/docs/reference/dependence_tour-1.png index 624fdc0f..7d5b8b1e 100644 Binary files a/docs/reference/dependence_tour-1.png and b/docs/reference/dependence_tour-1.png differ diff --git a/docs/reference/dependence_tour-2.png b/docs/reference/dependence_tour-2.png index 8028c638..fba7e617 100644 Binary files a/docs/reference/dependence_tour-2.png and b/docs/reference/dependence_tour-2.png differ diff --git a/docs/reference/dependence_tour-3.png b/docs/reference/dependence_tour-3.png index 29de2e42..1475db64 100644 Binary files a/docs/reference/dependence_tour-3.png and b/docs/reference/dependence_tour-3.png differ diff --git a/docs/reference/dependence_tour.html b/docs/reference/dependence_tour.html index f395a556..bb273e46 100644 --- a/docs/reference/dependence_tour.html +++ b/docs/reference/dependence_tour.html @@ -21,7 +21,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/display_andrews-11.png b/docs/reference/display_andrews-11.png index 52d0d94f..0d11829b 100644 Binary files a/docs/reference/display_andrews-11.png and b/docs/reference/display_andrews-11.png differ diff --git a/docs/reference/display_andrews-12.png b/docs/reference/display_andrews-12.png index 52d0d94f..0d11829b 100644 Binary files a/docs/reference/display_andrews-12.png and b/docs/reference/display_andrews-12.png differ diff --git a/docs/reference/display_andrews-3.png b/docs/reference/display_andrews-3.png index 1d0ba371..b45d7a10 100644 Binary files a/docs/reference/display_andrews-3.png and b/docs/reference/display_andrews-3.png differ diff --git a/docs/reference/display_andrews-6.png b/docs/reference/display_andrews-6.png index 2a54813b..8a57230a 100644 Binary files a/docs/reference/display_andrews-6.png and b/docs/reference/display_andrews-6.png differ diff --git a/docs/reference/display_andrews-9.png b/docs/reference/display_andrews-9.png index adb4a045..4d4ff17e 100644 Binary files a/docs/reference/display_andrews-9.png and b/docs/reference/display_andrews-9.png differ diff --git a/docs/reference/display_andrews.html b/docs/reference/display_andrews.html index 4eb24468..be86c9d5 100644 --- a/docs/reference/display_andrews.html +++ b/docs/reference/display_andrews.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 @@ -147,12 +147,12 @@

Examples

#> Value -0.582 -0.0 % better #> No better bases found after 25 tries. Giving up. #> Final projection: -#> -0.284 -0.009 -#> 0.251 -0.348 -#> -0.393 0.093 -#> 0.303 0.912 -#> 0.651 -0.161 -#> -0.433 0.115 +#> 0.029 -0.982 +#> -0.270 -0.009 +#> -0.416 -0.089 +#> 0.357 0.135 +#> 0.385 -0.087 +#> 0.691 -0.038 diff --git a/docs/reference/display_density2d-11.png b/docs/reference/display_density2d-11.png index 1b31ea32..4bb24edb 100644 Binary files a/docs/reference/display_density2d-11.png and b/docs/reference/display_density2d-11.png differ diff --git a/docs/reference/display_density2d-12.png b/docs/reference/display_density2d-12.png index 4a03a6b5..e01d8679 100644 Binary files a/docs/reference/display_density2d-12.png and b/docs/reference/display_density2d-12.png differ diff --git a/docs/reference/display_density2d-13.png b/docs/reference/display_density2d-13.png index c2b486dd..261e2934 100644 Binary files a/docs/reference/display_density2d-13.png and b/docs/reference/display_density2d-13.png differ diff --git a/docs/reference/display_density2d-14.png b/docs/reference/display_density2d-14.png index d499e55b..bf8ce19d 100644 Binary files a/docs/reference/display_density2d-14.png and b/docs/reference/display_density2d-14.png differ diff --git a/docs/reference/display_density2d-15.png b/docs/reference/display_density2d-15.png index 25e20cb3..9e7daa74 100644 Binary files a/docs/reference/display_density2d-15.png and b/docs/reference/display_density2d-15.png differ diff --git a/docs/reference/display_density2d-16.png b/docs/reference/display_density2d-16.png index ffa085a4..f2fe0903 100644 Binary files a/docs/reference/display_density2d-16.png and b/docs/reference/display_density2d-16.png differ diff --git a/docs/reference/display_density2d-17.png b/docs/reference/display_density2d-17.png index 321e521c..39a27bbf 100644 Binary files a/docs/reference/display_density2d-17.png and b/docs/reference/display_density2d-17.png differ diff --git a/docs/reference/display_density2d-18.png b/docs/reference/display_density2d-18.png index e2585f0b..7a454450 100644 Binary files a/docs/reference/display_density2d-18.png and b/docs/reference/display_density2d-18.png differ diff --git a/docs/reference/display_density2d-2.png b/docs/reference/display_density2d-2.png index 0d6f7d53..d46d77a0 100644 Binary files a/docs/reference/display_density2d-2.png and b/docs/reference/display_density2d-2.png differ diff --git a/docs/reference/display_density2d-21.png b/docs/reference/display_density2d-21.png index eaeae4e0..8d25a4fb 100644 Binary files a/docs/reference/display_density2d-21.png and b/docs/reference/display_density2d-21.png differ diff --git a/docs/reference/display_density2d-24.png b/docs/reference/display_density2d-24.png index 5ff9760c..1bde2811 100644 Binary files a/docs/reference/display_density2d-24.png and b/docs/reference/display_density2d-24.png differ diff --git a/docs/reference/display_density2d-27.png b/docs/reference/display_density2d-27.png index 4e219e0a..2dc717a0 100644 Binary files a/docs/reference/display_density2d-27.png and b/docs/reference/display_density2d-27.png differ diff --git a/docs/reference/display_density2d-3.png b/docs/reference/display_density2d-3.png index abe06e84..d83d5012 100644 Binary files a/docs/reference/display_density2d-3.png and b/docs/reference/display_density2d-3.png differ diff --git a/docs/reference/display_density2d-30.png b/docs/reference/display_density2d-30.png index c39b2e75..2c2b3a36 100644 Binary files a/docs/reference/display_density2d-30.png and b/docs/reference/display_density2d-30.png differ diff --git a/docs/reference/display_density2d-31.png b/docs/reference/display_density2d-31.png index ebc4816c..d318a522 100644 Binary files a/docs/reference/display_density2d-31.png and b/docs/reference/display_density2d-31.png differ diff --git a/docs/reference/display_density2d-34.png b/docs/reference/display_density2d-34.png index 67702108..51bbdab6 100644 Binary files a/docs/reference/display_density2d-34.png and b/docs/reference/display_density2d-34.png differ diff --git a/docs/reference/display_density2d-5.png b/docs/reference/display_density2d-5.png index b9ba4207..62ce057c 100644 Binary files a/docs/reference/display_density2d-5.png and b/docs/reference/display_density2d-5.png differ diff --git a/docs/reference/display_density2d-6.png b/docs/reference/display_density2d-6.png index 17252ffd..0b015819 100644 Binary files a/docs/reference/display_density2d-6.png and b/docs/reference/display_density2d-6.png differ diff --git a/docs/reference/display_density2d-9.png b/docs/reference/display_density2d-9.png index bed42350..1bca4493 100644 Binary files a/docs/reference/display_density2d-9.png and b/docs/reference/display_density2d-9.png differ diff --git a/docs/reference/display_density2d.html b/docs/reference/display_density2d.html index 3c363c06..5ba69b29 100644 --- a/docs/reference/display_density2d.html +++ b/docs/reference/display_density2d.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 @@ -203,9 +203,9 @@

Examples

#> Value 1.582 0.0 % better #> No better bases found after 25 tries. Giving up. #> Final projection: -#> -0.483 -0.388 -#> -0.860 0.379 -#> -0.165 -0.840 +#> -0.766 0.239 +#> -0.601 -0.596 +#> 0.228 -0.767 #> Using half_range 65 diff --git a/docs/reference/display_depth-1.png b/docs/reference/display_depth-1.png index e46081f4..b8555607 100644 Binary files a/docs/reference/display_depth-1.png and b/docs/reference/display_depth-1.png differ diff --git a/docs/reference/display_depth.html b/docs/reference/display_depth.html index 2e2e24e1..632ada6b 100644 --- a/docs/reference/display_depth.html +++ b/docs/reference/display_depth.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/display_dist-10.png b/docs/reference/display_dist-10.png index eac73293..592d63d8 100644 Binary files a/docs/reference/display_dist-10.png and b/docs/reference/display_dist-10.png differ diff --git a/docs/reference/display_dist-12.png b/docs/reference/display_dist-12.png index 59ae3de4..0788babe 100644 Binary files a/docs/reference/display_dist-12.png and b/docs/reference/display_dist-12.png differ diff --git a/docs/reference/display_dist-2.png b/docs/reference/display_dist-2.png index 4457d40c..d7980fa9 100644 Binary files a/docs/reference/display_dist-2.png and b/docs/reference/display_dist-2.png differ diff --git a/docs/reference/display_dist-4.png b/docs/reference/display_dist-4.png index df2e3832..a53ab8e9 100644 Binary files a/docs/reference/display_dist-4.png and b/docs/reference/display_dist-4.png differ diff --git a/docs/reference/display_dist-6.png b/docs/reference/display_dist-6.png index 8258fab4..121e4ddc 100644 Binary files a/docs/reference/display_dist-6.png and b/docs/reference/display_dist-6.png differ diff --git a/docs/reference/display_dist-8.png b/docs/reference/display_dist-8.png index 716aab0c..9d39b1b4 100644 Binary files a/docs/reference/display_dist-8.png and b/docs/reference/display_dist-8.png differ diff --git a/docs/reference/display_dist.html b/docs/reference/display_dist.html index 6bc5f1fc..05cdcd9d 100644 --- a/docs/reference/display_dist.html +++ b/docs/reference/display_dist.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/display_faces-2.png b/docs/reference/display_faces-2.png index 2565b475..463017f1 100644 Binary files a/docs/reference/display_faces-2.png and b/docs/reference/display_faces-2.png differ diff --git a/docs/reference/display_faces-4.png b/docs/reference/display_faces-4.png index cfac7b58..9e0c8461 100644 Binary files a/docs/reference/display_faces-4.png and b/docs/reference/display_faces-4.png differ diff --git a/docs/reference/display_faces-6.png b/docs/reference/display_faces-6.png index 5613065c..d0b665fc 100644 Binary files a/docs/reference/display_faces-6.png and b/docs/reference/display_faces-6.png differ diff --git a/docs/reference/display_faces.html b/docs/reference/display_faces.html index 1c641619..e416ebd6 100644 --- a/docs/reference/display_faces.html +++ b/docs/reference/display_faces.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/display_groupxy-2.png b/docs/reference/display_groupxy-2.png index d9ae6279..730c2107 100644 Binary files a/docs/reference/display_groupxy-2.png and b/docs/reference/display_groupxy-2.png differ diff --git a/docs/reference/display_groupxy-4.png b/docs/reference/display_groupxy-4.png index b4ee5166..5d9fa049 100644 Binary files a/docs/reference/display_groupxy-4.png and b/docs/reference/display_groupxy-4.png differ diff --git a/docs/reference/display_groupxy-5.png b/docs/reference/display_groupxy-5.png new file mode 100644 index 00000000..a178e275 Binary files /dev/null and b/docs/reference/display_groupxy-5.png differ diff --git a/docs/reference/display_groupxy-6.png b/docs/reference/display_groupxy-6.png new file mode 100644 index 00000000..12527509 Binary files /dev/null and b/docs/reference/display_groupxy-6.png differ diff --git a/docs/reference/display_groupxy.html b/docs/reference/display_groupxy.html index 53b9d9d7..dcbd27cf 100644 --- a/docs/reference/display_groupxy.html +++ b/docs/reference/display_groupxy.html @@ -20,7 +20,7 @@ tourr - 1.0.2 + 1.1.0 @@ -186,7 +186,7 @@

Examples

x.edges.col <- factor(c(rep("A", 2), rep("B", 2), rep("C", 3))) animate_groupxy(x[,1:3], col=x$cl, group_by=x$cl, edges=x.edges, edges.col=x.edges.col) #> Converting input data to the required matrix format. -#> Using half_range 1.5 +#> Using half_range 1.2 #> Warning: "shapes" is not a graphical parameter #> Warning: "shapes" is not a graphical parameter #> Warning: "shapes" is not a graphical parameter diff --git a/docs/reference/display_idx-1.png b/docs/reference/display_idx-1.png new file mode 100644 index 00000000..0872c0b0 Binary files /dev/null and b/docs/reference/display_idx-1.png differ diff --git a/docs/reference/display_idx-2.png b/docs/reference/display_idx-2.png new file mode 100644 index 00000000..99baf167 Binary files /dev/null and b/docs/reference/display_idx-2.png differ diff --git a/docs/reference/display_idx.html b/docs/reference/display_idx.html new file mode 100644 index 00000000..7d9c36ba --- /dev/null +++ b/docs/reference/display_idx.html @@ -0,0 +1,247 @@ + +Display a 1D linear aggregation index — display_idx • tourr + + +
+
+ + + +
+
+ + +
+

Animate a 1D tour path for data where individuals are ranked +by a multivariate index. Allows one to examine the sensitivity +of the ranking on the linear combination. Variables should be +scaled to be between 0-1. This is only designed to work with +a local tour, or a radial tour.

+
+ +
+
display_idx(
+  center = FALSE,
+  half_range = NULL,
+  abb_vars = TRUE,
+  col = "red",
+  cex = 3,
+  panel_height_ratio = c(3, 2),
+  label_x_pos = 0.7,
+  label = NULL,
+  label_cex = 1,
+  label_col = "grey80",
+  add_ref_line = TRUE,
+  axis_bar_col = "#000000",
+  axis_bar_lwd = 3,
+  axis_label_cex_upper = 1,
+  axis_label_cex_lower = 1,
+  axis_bar_label_cex = 1,
+  axis_bar_label_col = "#000000",
+  axis_var_cex = 1,
+  axis_var_col = "#000000",
+  palette = "Zissou 1",
+  ...
+)
+
+animate_idx(data, tour_path = grand_tour(1), ...)
+
+ +
+

Arguments

+
center
+

should 1d projection be centered to have mean zero (default: TRUE). +This pins the centre of distribution to the same place, and makes it +easier to focus on the shape of the distribution.

+ + +
half_range
+

half range to use when calculating limits of projected. +If not set, defaults to maximum distance from origin to each row of data.

+ + +
abb_vars
+

logical, whether to abbreviate the variable name, if long

+ + +
col
+

the color used for points, can be a vector or hexcolors or a +factor, default to "red".

+ + +
cex
+

the size used for points, default to 0.5

+ + +
panel_height_ratio
+

input to the height argument in +[graphics::layout()] for the height of data and axis panel.

+ + +
label_x_pos
+

the x position of text label, currently labels are +positioned at a fixed x value for each observation

+ + +
label
+

the text label, a vector

+ + +
label_cex
+

the size for text labels

+ + +
label_col
+

the color for text labels

+ + +
add_ref_line
+

whether to add a horizontal reference line for each +observation, logical default to TRUE

+ + +
axis_bar_col
+

the color of the axis bar

+ + +
axis_bar_lwd
+

the width of the axis bar

+ + +
axis_label_cex_upper
+

the size of the axis label in the upper panel

+ + +
axis_label_cex_lower
+

the size of the axis label in the lower panel

+ + +
axis_bar_label_cex
+

the size of the axis label

+ + +
axis_bar_label_col
+

the color of the axis label

+ + +
axis_var_cex
+

the size of the variable name +to the right of the axis panel

+ + +
axis_var_col
+

the color of the variable name +to the right of the axis panel

+ + +
palette
+

name of color palette for point colour, used by +hcl.colors, default "Zissou 1"

+ + +
...
+

ignored

+ + +
data
+

matrix, or data frame containing numeric columns

+ + +
tour_path
+

tour path generator, defaults to 2d grand tour

+ +
+ +
+

Examples

+
data(places)
+places_01 <- apply(places[1:10,1:9], 2, function(x) (x-min(x))/(max(x)-min(x)))
+b <- matrix(rep(1/sqrt(9), 9), ncol=1)
+places_init <- cbind(places_01, idx = as.vector(as.matrix(places_01) %*% b))
+places_sorted <- places_init[order(places_init[,10]), 1:9]
+animate_idx(places_sorted, tour_path = local_tour(b, angle=pi/8),
+            label=as.character(places$stnum[1:9]),
+            label_x_pos = 0)
+#> Using half_range 2.7
+
+
+
+
+
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.7.

+
+ +
+ + + + + + + + diff --git a/docs/reference/display_image.html b/docs/reference/display_image.html index 8e93deff..03b322c2 100644 --- a/docs/reference/display_image.html +++ b/docs/reference/display_image.html @@ -20,7 +20,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/display_pca-1.png b/docs/reference/display_pca-1.png index 157a5954..61a7b65f 100644 Binary files a/docs/reference/display_pca-1.png and b/docs/reference/display_pca-1.png differ diff --git a/docs/reference/display_pca.html b/docs/reference/display_pca.html index 40fe513a..ee83d4af 100644 --- a/docs/reference/display_pca.html +++ b/docs/reference/display_pca.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/display_pcp-1.png b/docs/reference/display_pcp-1.png index 4c217bc0..39708a71 100644 Binary files a/docs/reference/display_pcp-1.png and b/docs/reference/display_pcp-1.png differ diff --git a/docs/reference/display_pcp-2.png b/docs/reference/display_pcp-2.png index 84d9cf5c..894fffbb 100644 Binary files a/docs/reference/display_pcp-2.png and b/docs/reference/display_pcp-2.png differ diff --git a/docs/reference/display_pcp.html b/docs/reference/display_pcp.html index a0899279..b78246d0 100644 --- a/docs/reference/display_pcp.html +++ b/docs/reference/display_pcp.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/display_sage-1.png b/docs/reference/display_sage-1.png index 011a4a5b..c7f86fd0 100644 Binary files a/docs/reference/display_sage-1.png and b/docs/reference/display_sage-1.png differ diff --git a/docs/reference/display_sage-2.png b/docs/reference/display_sage-2.png index f7e7adca..ad0b176b 100644 Binary files a/docs/reference/display_sage-2.png and b/docs/reference/display_sage-2.png differ diff --git a/docs/reference/display_sage.html b/docs/reference/display_sage.html index 67569b6b..01d781b7 100644 --- a/docs/reference/display_sage.html +++ b/docs/reference/display_sage.html @@ -19,7 +19,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/display_scatmat-2.png b/docs/reference/display_scatmat-2.png index ea131484..49adeb4b 100644 Binary files a/docs/reference/display_scatmat-2.png and b/docs/reference/display_scatmat-2.png differ diff --git a/docs/reference/display_scatmat-4.png b/docs/reference/display_scatmat-4.png index afeeb748..7551dc0d 100644 Binary files a/docs/reference/display_scatmat-4.png and b/docs/reference/display_scatmat-4.png differ diff --git a/docs/reference/display_scatmat.html b/docs/reference/display_scatmat.html index 9af3ae40..4f41c32c 100644 --- a/docs/reference/display_scatmat.html +++ b/docs/reference/display_scatmat.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/display_slice-1.png b/docs/reference/display_slice-1.png index 13370216..accf1a07 100644 Binary files a/docs/reference/display_slice-1.png and b/docs/reference/display_slice-1.png differ diff --git a/docs/reference/display_slice-2.png b/docs/reference/display_slice-2.png index c2826565..f1e00d13 100644 Binary files a/docs/reference/display_slice-2.png and b/docs/reference/display_slice-2.png differ diff --git a/docs/reference/display_slice-3.png b/docs/reference/display_slice-3.png index 385f4fa3..8c8c28e5 100644 Binary files a/docs/reference/display_slice-3.png and b/docs/reference/display_slice-3.png differ diff --git a/docs/reference/display_slice-4.png b/docs/reference/display_slice-4.png index 0cafa126..d321cafa 100644 Binary files a/docs/reference/display_slice-4.png and b/docs/reference/display_slice-4.png differ diff --git a/docs/reference/display_slice.html b/docs/reference/display_slice.html index 2672083e..e5f5bc42 100644 --- a/docs/reference/display_slice.html +++ b/docs/reference/display_slice.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 @@ -187,7 +187,7 @@

Examples

animate_slice(sphere5) #> Using half_range 1 -#> Using v_rel=0.1, corresponding to a cutoff h=0.47 +#> Using v_rel=0.11, corresponding to a cutoff h=0.48 # Animate with off-center anchoring diff --git a/docs/reference/display_stars-2.png b/docs/reference/display_stars-2.png index 84f67cbd..0720a8ea 100644 Binary files a/docs/reference/display_stars-2.png and b/docs/reference/display_stars-2.png differ diff --git a/docs/reference/display_stars-4.png b/docs/reference/display_stars-4.png index 95d7c459..f8f8287a 100644 Binary files a/docs/reference/display_stars-4.png and b/docs/reference/display_stars-4.png differ diff --git a/docs/reference/display_stars-6.png b/docs/reference/display_stars-6.png index fb56a0a0..7fff0cbe 100644 Binary files a/docs/reference/display_stars-6.png and b/docs/reference/display_stars-6.png differ diff --git a/docs/reference/display_stars-8.png b/docs/reference/display_stars-8.png index 1c70bf3f..3df0b606 100644 Binary files a/docs/reference/display_stars-8.png and b/docs/reference/display_stars-8.png differ diff --git a/docs/reference/display_stars.html b/docs/reference/display_stars.html index 7cfe81c9..567d69ec 100644 --- a/docs/reference/display_stars.html +++ b/docs/reference/display_stars.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/display_stereo-3.png b/docs/reference/display_stereo-3.png index 31c11ab5..cabd3000 100644 Binary files a/docs/reference/display_stereo-3.png and b/docs/reference/display_stereo-3.png differ diff --git a/docs/reference/display_stereo.html b/docs/reference/display_stereo.html index 65bd5b55..e0e7396b 100644 --- a/docs/reference/display_stereo.html +++ b/docs/reference/display_stereo.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/display_trails-1.png b/docs/reference/display_trails-1.png index 91073cbe..e580d309 100644 Binary files a/docs/reference/display_trails-1.png and b/docs/reference/display_trails-1.png differ diff --git a/docs/reference/display_trails.html b/docs/reference/display_trails.html index be1d426a..127cc0c3 100644 --- a/docs/reference/display_trails.html +++ b/docs/reference/display_trails.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/display_xy-1.png b/docs/reference/display_xy-1.png index f287a32b..5ce8315d 100644 Binary files a/docs/reference/display_xy-1.png and b/docs/reference/display_xy-1.png differ diff --git a/docs/reference/display_xy-10.png b/docs/reference/display_xy-10.png index cafba34d..b2b8b12b 100644 Binary files a/docs/reference/display_xy-10.png and b/docs/reference/display_xy-10.png differ diff --git a/docs/reference/display_xy-11.png b/docs/reference/display_xy-11.png index 0495f73f..7d6f7e11 100644 Binary files a/docs/reference/display_xy-11.png and b/docs/reference/display_xy-11.png differ diff --git a/docs/reference/display_xy-12.png b/docs/reference/display_xy-12.png index 1b222fa6..7071a22e 100644 Binary files a/docs/reference/display_xy-12.png and b/docs/reference/display_xy-12.png differ diff --git a/docs/reference/display_xy-13.png b/docs/reference/display_xy-13.png index d177330f..08809298 100644 Binary files a/docs/reference/display_xy-13.png and b/docs/reference/display_xy-13.png differ diff --git a/docs/reference/display_xy-14.png b/docs/reference/display_xy-14.png index 58e03c4e..ff5d0806 100644 Binary files a/docs/reference/display_xy-14.png and b/docs/reference/display_xy-14.png differ diff --git a/docs/reference/display_xy-2.png b/docs/reference/display_xy-2.png index c90cfde4..6704cf31 100644 Binary files a/docs/reference/display_xy-2.png and b/docs/reference/display_xy-2.png differ diff --git a/docs/reference/display_xy-3.png b/docs/reference/display_xy-3.png index e451a836..bb9a8299 100644 Binary files a/docs/reference/display_xy-3.png and b/docs/reference/display_xy-3.png differ diff --git a/docs/reference/display_xy-4.png b/docs/reference/display_xy-4.png index 66b84227..5327ea2f 100644 Binary files a/docs/reference/display_xy-4.png and b/docs/reference/display_xy-4.png differ diff --git a/docs/reference/display_xy-5.png b/docs/reference/display_xy-5.png index 15b07fca..01c1c93a 100644 Binary files a/docs/reference/display_xy-5.png and b/docs/reference/display_xy-5.png differ diff --git a/docs/reference/display_xy-6.png b/docs/reference/display_xy-6.png index dbab39da..5ecf4349 100644 Binary files a/docs/reference/display_xy-6.png and b/docs/reference/display_xy-6.png differ diff --git a/docs/reference/display_xy-7.png b/docs/reference/display_xy-7.png index fefa0b38..64e796f9 100644 Binary files a/docs/reference/display_xy-7.png and b/docs/reference/display_xy-7.png differ diff --git a/docs/reference/display_xy-8.png b/docs/reference/display_xy-8.png index b17e2840..c9bc0a82 100644 Binary files a/docs/reference/display_xy-8.png and b/docs/reference/display_xy-8.png differ diff --git a/docs/reference/display_xy-9.png b/docs/reference/display_xy-9.png index d966b06f..c7fc3403 100644 Binary files a/docs/reference/display_xy-9.png and b/docs/reference/display_xy-9.png differ diff --git a/docs/reference/display_xy.html b/docs/reference/display_xy.html index 2de3221f..642f8e58 100644 --- a/docs/reference/display_xy.html +++ b/docs/reference/display_xy.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 @@ -177,7 +177,7 @@

Examples

animate_xy(flea[, 1:3], tour_path = guided_tour(holes()), sphere = TRUE) #> Converting input data to the required matrix format. -#> Value 0.837 0.6 % better - NEW BASIS +#> Value 0.857 0.9 % better - NEW BASIS #> Using half_range 3.2 animate_xy(flea[, 1:6], center = FALSE) diff --git a/docs/reference/draw_slice_center.html b/docs/reference/draw_slice_center.html index 4f05fb10..da798c22 100644 --- a/docs/reference/draw_slice_center.html +++ b/docs/reference/draw_slice_center.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/draw_tour_axes-1.png b/docs/reference/draw_tour_axes-1.png index 28b196fe..88c48eba 100644 Binary files a/docs/reference/draw_tour_axes-1.png and b/docs/reference/draw_tour_axes-1.png differ diff --git a/docs/reference/draw_tour_axes-2.png b/docs/reference/draw_tour_axes-2.png index ed2f01ad..deb6e6c5 100644 Binary files a/docs/reference/draw_tour_axes-2.png and b/docs/reference/draw_tour_axes-2.png differ diff --git a/docs/reference/draw_tour_axes.html b/docs/reference/draw_tour_axes.html index 825d6f71..f6dbafc3 100644 --- a/docs/reference/draw_tour_axes.html +++ b/docs/reference/draw_tour_axes.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/estimate_eps.html b/docs/reference/estimate_eps.html index 82c3c783..e0d12ce1 100644 --- a/docs/reference/estimate_eps.html +++ b/docs/reference/estimate_eps.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/eucl_norm_sq.html b/docs/reference/eucl_norm_sq.html index 9a7371e3..9b645357 100644 --- a/docs/reference/eucl_norm_sq.html +++ b/docs/reference/eucl_norm_sq.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/find_best_dir.html b/docs/reference/find_best_dir.html index ea132b25..e1d6c663 100644 --- a/docs/reference/find_best_dir.html +++ b/docs/reference/find_best_dir.html @@ -19,7 +19,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/find_best_frozen_dir.html b/docs/reference/find_best_frozen_dir.html index 05dffb15..5cab8870 100644 --- a/docs/reference/find_best_frozen_dir.html +++ b/docs/reference/find_best_frozen_dir.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/find_frozen_path_peak.html b/docs/reference/find_frozen_path_peak.html index eb1e8a28..3da34b49 100644 --- a/docs/reference/find_frozen_path_peak.html +++ b/docs/reference/find_frozen_path_peak.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/find_path_peak.html b/docs/reference/find_path_peak.html index 1ba3d6b4..f01ebe15 100644 --- a/docs/reference/find_path_peak.html +++ b/docs/reference/find_path_peak.html @@ -20,7 +20,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/find_platform.html b/docs/reference/find_platform.html index 64342c9a..008bbb38 100644 --- a/docs/reference/find_platform.html +++ b/docs/reference/find_platform.html @@ -20,7 +20,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/freeze.html b/docs/reference/freeze.html index 6ebf7499..e86168b0 100644 --- a/docs/reference/freeze.html +++ b/docs/reference/freeze.html @@ -19,7 +19,7 @@ tourr - 1.0.2 + 1.1.0 @@ -89,23 +89,23 @@

Examples

input <- basis_random(4, 2) freeze(input, frozen) -#> [,1] [,2] -#> [1,] -0.6038761 0.7002916 -#> [2,] -0.1800735 -0.4007407 -#> [3,] 0.0000000 0.0000000 -#> [4,] 0.7000045 0.5719757 +#> [,1] [,2] +#> [1,] -0.01765492 0.7043658 +#> [2,] 0.38704199 0.4125632 +#> [3,] 0.00000000 0.0000000 +#> [4,] -0.15989910 -0.5189965 thaw(input, frozen) -#> [,1] [,2] -#> [1,] -0.5229720 0.6064703 -#> [2,] -0.1559482 -0.3470516 -#> [3,] 0.5000000 0.5000000 -#> [4,] 0.6062217 0.4953455 +#> [,1] [,2] +#> [1,] -0.01528961 0.6099987 +#> [2,] 0.33518820 0.3572902 +#> [3,] 0.50000000 0.5000000 +#> [4,] -0.13847669 -0.4494641 freeze(basis_random(4, 2), frozen) -#> [,1] [,2] -#> [1,] 0.2581632 -0.09488073 -#> [2,] -0.7594302 -0.58362240 -#> [3,] 0.0000000 0.00000000 -#> [4,] -0.5952164 0.66664063 +#> [,1] [,2] +#> [1,] -0.1212654 0.1985167 +#> [2,] 0.3536921 0.5179840 +#> [3,] 0.0000000 0.0000000 +#> [4,] -0.5591836 -0.5460886 diff --git a/docs/reference/frozen_guided_tour.html b/docs/reference/frozen_guided_tour.html index 18ad3fe4..9261d88d 100644 --- a/docs/reference/frozen_guided_tour.html +++ b/docs/reference/frozen_guided_tour.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/frozen_tour-1.png b/docs/reference/frozen_tour-1.png index 5eb777cd..431313bb 100644 Binary files a/docs/reference/frozen_tour-1.png and b/docs/reference/frozen_tour-1.png differ diff --git a/docs/reference/frozen_tour-2.png b/docs/reference/frozen_tour-2.png index b87218d9..ec5c0791 100644 Binary files a/docs/reference/frozen_tour-2.png and b/docs/reference/frozen_tour-2.png differ diff --git a/docs/reference/frozen_tour-3.png b/docs/reference/frozen_tour-3.png index 267c55f1..6839c0f6 100644 Binary files a/docs/reference/frozen_tour-3.png and b/docs/reference/frozen_tour-3.png differ diff --git a/docs/reference/frozen_tour-4.png b/docs/reference/frozen_tour-4.png index a57c5047..4da67c1c 100644 Binary files a/docs/reference/frozen_tour-4.png and b/docs/reference/frozen_tour-4.png differ diff --git a/docs/reference/frozen_tour.html b/docs/reference/frozen_tour.html index a785b303..eb089e53 100644 --- a/docs/reference/frozen_tour.html +++ b/docs/reference/frozen_tour.html @@ -20,7 +20,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/geodesic_info.html b/docs/reference/geodesic_info.html index 15ce679f..3314e15d 100644 --- a/docs/reference/geodesic_info.html +++ b/docs/reference/geodesic_info.html @@ -23,7 +23,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/geodesic_path.html b/docs/reference/geodesic_path.html index 576600c9..e66d19a7 100644 --- a/docs/reference/geodesic_path.html +++ b/docs/reference/geodesic_path.html @@ -19,7 +19,7 @@ tourr - 1.0.2 + 1.1.0 @@ -129,12 +129,12 @@

Examples

path <- geodesic_path(a, b) path$dist -#> [1] 1.414265 +#> [1] 1.14901 all.equal(a, path$interpolate(0)) #> [1] TRUE # Not true generally - a rotated into plane of b all.equal(b, path$interpolate(1)) -#> [1] "Mean relative difference: 1.783492" +#> [1] "Mean relative difference: 1.409871" diff --git a/docs/reference/grand_tour-2.png b/docs/reference/grand_tour-2.png index 27448f75..aad19808 100644 Binary files a/docs/reference/grand_tour-2.png and b/docs/reference/grand_tour-2.png differ diff --git a/docs/reference/grand_tour-3.png b/docs/reference/grand_tour-3.png index 71b5887f..cd1a4c4a 100644 Binary files a/docs/reference/grand_tour-3.png and b/docs/reference/grand_tour-3.png differ diff --git a/docs/reference/grand_tour-4.png b/docs/reference/grand_tour-4.png index f89496bd..e207d16b 100644 Binary files a/docs/reference/grand_tour-4.png and b/docs/reference/grand_tour-4.png differ diff --git a/docs/reference/grand_tour.html b/docs/reference/grand_tour.html index 72dbd5a0..f18e0de7 100644 --- a/docs/reference/grand_tour.html +++ b/docs/reference/grand_tour.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/guided_section_tour.html b/docs/reference/guided_section_tour.html index 65c44b3d..7e1d8266 100644 --- a/docs/reference/guided_section_tour.html +++ b/docs/reference/guided_section_tour.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/guided_tour.html b/docs/reference/guided_tour.html index 4682c0f1..a441c37d 100644 --- a/docs/reference/guided_tour.html +++ b/docs/reference/guided_tour.html @@ -19,7 +19,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/holes.html b/docs/reference/holes.html index 6fd74db6..7e2e5de4 100644 --- a/docs/reference/holes.html +++ b/docs/reference/holes.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/index.html b/docs/reference/index.html index e6fc9fee..9db60fed 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/interpolate.html b/docs/reference/interpolate.html index f3128eed..383130a0 100644 --- a/docs/reference/interpolate.html +++ b/docs/reference/interpolate.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/is_orthonormal.html b/docs/reference/is_orthonormal.html index 97afc9e2..06b9685f 100644 --- a/docs/reference/is_orthonormal.html +++ b/docs/reference/is_orthonormal.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/lda_pp.html b/docs/reference/lda_pp.html index 46b338c1..52479aac 100644 --- a/docs/reference/lda_pp.html +++ b/docs/reference/lda_pp.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/linear_breaks.html b/docs/reference/linear_breaks.html index 9417e2ce..9f57f0d1 100644 --- a/docs/reference/linear_breaks.html +++ b/docs/reference/linear_breaks.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/little_tour.html b/docs/reference/little_tour.html index 3d1ddff2..af564e81 100644 --- a/docs/reference/little_tour.html +++ b/docs/reference/little_tour.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/local_tour.html b/docs/reference/local_tour.html index bfbac449..82741789 100644 --- a/docs/reference/local_tour.html +++ b/docs/reference/local_tour.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/manual_slice.html b/docs/reference/manual_slice.html index c0574e51..26a9a37c 100644 --- a/docs/reference/manual_slice.html +++ b/docs/reference/manual_slice.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/mapColors.html b/docs/reference/mapColors.html index c415ea9e..aa83b185 100644 --- a/docs/reference/mapColors.html +++ b/docs/reference/mapColors.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/mapShapes.html b/docs/reference/mapShapes.html index 29b5fc0e..81eacc1d 100644 --- a/docs/reference/mapShapes.html +++ b/docs/reference/mapShapes.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/new_geodesic_path.html b/docs/reference/new_geodesic_path.html index 7b60b666..d9a84ced 100644 --- a/docs/reference/new_geodesic_path.html +++ b/docs/reference/new_geodesic_path.html @@ -21,7 +21,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/new_tour.html b/docs/reference/new_tour.html index fadd1ef7..e2b79e39 100644 --- a/docs/reference/new_tour.html +++ b/docs/reference/new_tour.html @@ -19,7 +19,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/norm_bin.html b/docs/reference/norm_bin.html index a536729b..4c5a2edb 100644 --- a/docs/reference/norm_bin.html +++ b/docs/reference/norm_bin.html @@ -21,7 +21,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/normalise.html b/docs/reference/normalise.html index 5b9264d2..3102ca56 100644 --- a/docs/reference/normalise.html +++ b/docs/reference/normalise.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/orthonormalise.html b/docs/reference/orthonormalise.html index 3d8bccbf..c8b00ada 100644 --- a/docs/reference/orthonormalise.html +++ b/docs/reference/orthonormalise.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/orthonormalise_by.html b/docs/reference/orthonormalise_by.html index b61eeeaa..f62e2ba1 100644 --- a/docs/reference/orthonormalise_by.html +++ b/docs/reference/orthonormalise_by.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/path_curves.html b/docs/reference/path_curves.html index 0f56eb7e..580c67cb 100644 --- a/docs/reference/path_curves.html +++ b/docs/reference/path_curves.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/path_dist.html b/docs/reference/path_dist.html index aa592a1a..f171c278 100644 --- a/docs/reference/path_dist.html +++ b/docs/reference/path_dist.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/path_index.html b/docs/reference/path_index.html index fa7f6af8..09eb3eb5 100644 --- a/docs/reference/path_index.html +++ b/docs/reference/path_index.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/paths_index.html b/docs/reference/paths_index.html index e770b34d..b700a51a 100644 --- a/docs/reference/paths_index.html +++ b/docs/reference/paths_index.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/pda_pp.html b/docs/reference/pda_pp.html index f3cab944..fa19aa6b 100644 --- a/docs/reference/pda_pp.html +++ b/docs/reference/pda_pp.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/planned-tour-1.png b/docs/reference/planned-tour-1.png new file mode 100644 index 00000000..ccffe1f6 Binary files /dev/null and b/docs/reference/planned-tour-1.png differ diff --git a/docs/reference/planned-tour-2.png b/docs/reference/planned-tour-2.png new file mode 100644 index 00000000..60321b02 Binary files /dev/null and b/docs/reference/planned-tour-2.png differ diff --git a/docs/reference/planned-tour-3.png b/docs/reference/planned-tour-3.png new file mode 100644 index 00000000..65b54697 Binary files /dev/null and b/docs/reference/planned-tour-3.png differ diff --git a/docs/reference/planned-tour.html b/docs/reference/planned-tour.html new file mode 100644 index 00000000..80ed3583 --- /dev/null +++ b/docs/reference/planned-tour.html @@ -0,0 +1,152 @@ + +A planned tour path. — planned_tour • tourr + + +
+
+ + + +
+
+ + +
+

The planned tour takes you from one basis to the next in a +set order. Once you have visited all the planned bases, you either stop +or start from the beginning once more (if cycle = TRUE).

+
+ +
+
planned_tour(basis_set, cycle = FALSE)
+
+planned2_tour(basis_set)
+
+ +
+

Arguments

+
basis_set
+

the set of bases as a list of projection matrices +or a 3d array

+ + +
cycle
+

cycle through continuously (TRUE) or stop after +first pass (FALSE)

+ +
+
+

Details

+

Usually, you will not call this function directly, but will pass it to +a method that works with tour paths like animate, +save_history or render.

+
+
+

See also

+

The little_tour, a special type of planned tour + which cycles between all axis parallel projections.

+
+ +
+

Examples

+
twod <- save_history(flea[, 1:3], max = 5)
+#> Converting input data to the required matrix format.
+str(twod)
+#>  num [1:3, 1:2, 1:5] 1 0 0 0 1 ...
+#>  - attr(*, "data")= int [1:74, 1:3] 191 185 200 173 171 160 188 186 174 163 ...
+#>   ..- attr(*, "dimnames")=List of 2
+#>   .. ..$ : chr [1:74] "1" "2" "3" "4" ...
+#>   .. ..$ : chr [1:3] "tars1" "tars2" "head"
+animate_xy(flea[, 1:3], planned_tour(twod))
+#> Converting input data to the required matrix format.
+#> Using half_range 65
+animate_xy(flea[, 1:3], planned_tour(twod, TRUE))
+#> Converting input data to the required matrix format.
+#> Using half_range 65
+
+
+oned <- save_history(flea[, 1:6], grand_tour(1), max = 3)
+#> Converting input data to the required matrix format.
+animate_dist(flea[, 1:6], planned_tour(oned))
+#> Converting input data to the required matrix format.
+#> Using half_range 66
+
+
+
+
+
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.7.

+
+ +
+ + + + + + + + diff --git a/docs/reference/plot.path_curve.html b/docs/reference/plot.path_curve.html index 8076c2b0..bae4d7b9 100644 --- a/docs/reference/plot.path_curve.html +++ b/docs/reference/plot.path_curve.html @@ -20,7 +20,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/plot.path_index.html b/docs/reference/plot.path_index.html index c3ca3ae3..33c6232d 100644 --- a/docs/reference/plot.path_index.html +++ b/docs/reference/plot.path_index.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/proj_dist.html b/docs/reference/proj_dist.html index b80ad0ad..22ab1114 100644 --- a/docs/reference/proj_dist.html +++ b/docs/reference/proj_dist.html @@ -19,7 +19,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/project3d.html b/docs/reference/project3d.html index fc1e56f5..6242f2b3 100644 --- a/docs/reference/project3d.html +++ b/docs/reference/project3d.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/radial_bin_weight_inv.html b/docs/reference/radial_bin_weight_inv.html index 08dace8b..e7530eff 100644 --- a/docs/reference/radial_bin_weight_inv.html +++ b/docs/reference/radial_bin_weight_inv.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/radial_tour.html b/docs/reference/radial_tour.html index a7151c30..4b620a6d 100644 --- a/docs/reference/radial_tour.html +++ b/docs/reference/radial_tour.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/render.html b/docs/reference/render.html index 40559602..b3deb8f7 100644 --- a/docs/reference/render.html +++ b/docs/reference/render.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/render_anim.html b/docs/reference/render_anim.html index 94137f18..78de88fd 100644 --- a/docs/reference/render_anim.html +++ b/docs/reference/render_anim.html @@ -22,7 +22,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/render_gif.html b/docs/reference/render_gif.html index f10068c2..12cc6c98 100644 --- a/docs/reference/render_gif.html +++ b/docs/reference/render_gif.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/render_proj.html b/docs/reference/render_proj.html index e324e581..35d0b23a 100644 --- a/docs/reference/render_proj.html +++ b/docs/reference/render_proj.html @@ -21,7 +21,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/rescale.html b/docs/reference/rescale.html index 913b6ba1..a5719459 100644 --- a/docs/reference/rescale.html +++ b/docs/reference/rescale.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/save_history.html b/docs/reference/save_history.html index b95cb650..256275da 100644 --- a/docs/reference/save_history.html +++ b/docs/reference/save_history.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/search_better.html b/docs/reference/search_better.html index c13422f8..5bf9126e 100644 --- a/docs/reference/search_better.html +++ b/docs/reference/search_better.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/search_better_random.html b/docs/reference/search_better_random.html index 8bd5e917..1ce79fbe 100644 --- a/docs/reference/search_better_random.html +++ b/docs/reference/search_better_random.html @@ -21,7 +21,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/search_frozen_geodesic.html b/docs/reference/search_frozen_geodesic.html index c7ec59a2..f60dfa9b 100644 --- a/docs/reference/search_frozen_geodesic.html +++ b/docs/reference/search_frozen_geodesic.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/search_geodesic.html b/docs/reference/search_geodesic.html index 62181659..da0c7d0c 100644 --- a/docs/reference/search_geodesic.html +++ b/docs/reference/search_geodesic.html @@ -22,7 +22,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/search_polish.html b/docs/reference/search_polish.html index 208d5c3e..55a56ad9 100644 --- a/docs/reference/search_polish.html +++ b/docs/reference/search_polish.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/search_posse.html b/docs/reference/search_posse.html index 94135385..22db694e 100644 --- a/docs/reference/search_posse.html +++ b/docs/reference/search_posse.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/slice_binning.html b/docs/reference/slice_binning.html index 80679064..38fd0f37 100644 --- a/docs/reference/slice_binning.html +++ b/docs/reference/slice_binning.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/slice_index.html b/docs/reference/slice_index.html index 33bcfea5..06445982 100644 --- a/docs/reference/slice_index.html +++ b/docs/reference/slice_index.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/sphere_data.html b/docs/reference/sphere_data.html index 5ae669fe..49c3d3c0 100644 --- a/docs/reference/sphere_data.html +++ b/docs/reference/sphere_data.html @@ -20,7 +20,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/splines2d.html b/docs/reference/splines2d.html index 8b43c6f4..86b6942b 100644 --- a/docs/reference/splines2d.html +++ b/docs/reference/splines2d.html @@ -20,7 +20,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/step_angle.html b/docs/reference/step_angle.html index 30c783b2..7e285c9a 100644 --- a/docs/reference/step_angle.html +++ b/docs/reference/step_angle.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/step_fraction.html b/docs/reference/step_fraction.html index fa5483e8..6cf05abd 100644 --- a/docs/reference/step_fraction.html +++ b/docs/reference/step_fraction.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/t1.html b/docs/reference/t1.html index 33e1d390..077b3e29 100644 --- a/docs/reference/t1.html +++ b/docs/reference/t1.html @@ -23,7 +23,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/to_stop.html b/docs/reference/to_stop.html index cc90edee..02b7082e 100644 --- a/docs/reference/to_stop.html +++ b/docs/reference/to_stop.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/tourr-package.html b/docs/reference/tourr-package.html index a14148e5..6707b458 100644 --- a/docs/reference/tourr-package.html +++ b/docs/reference/tourr-package.html @@ -18,7 +18,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/weights_bincount_radial.html b/docs/reference/weights_bincount_radial.html index e5561f9e..b9d42b7e 100644 --- a/docs/reference/weights_bincount_radial.html +++ b/docs/reference/weights_bincount_radial.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/docs/reference/xnul.html b/docs/reference/xnul.html index 5b2624fd..2b90d148 100644 --- a/docs/reference/xnul.html +++ b/docs/reference/xnul.html @@ -17,7 +17,7 @@ tourr - 1.0.2 + 1.1.0 diff --git a/man/Flea-measurements.Rd b/man/Flea-measurements.Rd index ddd85c3c..814a1eee 100644 --- a/man/Flea-measurements.Rd +++ b/man/Flea-measurements.Rd @@ -4,13 +4,19 @@ \name{Flea measurements} \alias{Flea measurements} \alias{flea} +\alias{flea,} +\alias{flea_raw} \title{Flea beatle measurements} \format{ A 74 x 7 numeric array } +\usage{ +flea +} \description{ This data is from a paper by A. A. Lubischew, "On the Use of Discriminant -Functions in Taxonomy", Biometrics, Dec 1962, pp.455-477. +Functions in Taxonomy", Biometrics, Dec 1962, pp.455-477. Data is +standardized, and original units are in flea_raw. } \details{ \itemize{ diff --git a/man/display_faces.Rd b/man/display_faces.Rd index e7e04eab..aaa2b953 100644 --- a/man/display_faces.Rd +++ b/man/display_faces.Rd @@ -28,10 +28,9 @@ Chernoff faces. See \code{\link[TeachingDemos]{faces2}} for more details. # The drawing code is fairly slow, so this animation works best with a # limited number of cases flea_s <- rescale(flea[,1:6]) -animate_faces(flea_s[1:2, 1:6]) -animate_faces(flea_s[1:4, 1:6]) +animate_faces(flea_s[19:24, 1:6]) -animate_faces(flea_s[1:2, 1:6], grand_tour(5)) +animate_faces(flea_s[19:24, 1:6], grand_tour(5)) } \seealso{ \code{\link{animate}} for options that apply to all animations diff --git a/man/display_groupxy.Rd b/man/display_groupxy.Rd index bb873349..0db34e08 100644 --- a/man/display_groupxy.Rd +++ b/man/display_groupxy.Rd @@ -18,6 +18,7 @@ display_groupxy( group_by = NULL, plot_xgp = TRUE, palette = "Zissou 1", + shapeset = c(15:17, 23:25), ... ) @@ -51,6 +52,9 @@ If not set, defaults to maximum distance from origin to each row of data.} \item{palette}{name of color palette for point colour, used by \code{\link{hcl.colors}}, default "Zissou 1"} +\item{shapeset}{numbers corresponding to shapes in base R points, to use for mapping +categorical variable to shapes, default=c(15:17, 23:25)} + \item{...}{other arguments passed on to \code{\link{animate}} and \code{\link{display_groupxy}}} diff --git a/man/display_xy.Rd b/man/display_xy.Rd index 11490182..9e4f331d 100644 --- a/man/display_xy.Rd +++ b/man/display_xy.Rd @@ -16,7 +16,11 @@ display_xy( edges.col = "black", edges.width = 1, obs_labels = NULL, + ellipse = NULL, + ellc = NULL, + ellmu = NULL, palette = "Zissou 1", + shapeset = c(15:17, 23:25), ... ) @@ -46,8 +50,20 @@ If not set, defaults to maximum distance from origin to each row of data.} \item{obs_labels}{vector of text labels to display} +\item{ellipse}{pxp variance-covariance matrix defining ellipse, default NULL. Useful for +comparing data with some null hypothesis} + +\item{ellc}{This can be considered the equivalent of a critical value, used to +scale the ellipse larger or smaller to capture more or fewer anomalies. Default 3.} + +\item{ellmu}{This is the centre of the ellipse corresponding to the mean of the +normal population. Default vector of 0's} + \item{palette}{name of color palette for point colour, used by \code{\link{hcl.colors}}, default "Zissou 1"} +\item{shapeset}{numbers corresponding to shapes in base R points, to use for mapping +categorical variable to shapes, default=c(15:17, 23:25)} + \item{...}{other arguments passed on to \code{\link{animate}} and \code{\link{display_xy}}} @@ -94,4 +110,6 @@ animate( flea[, 1:6], grand_tour(), display_xy(axes = "bottomleft", edges = edges) ) +# An ellipse can be drawn on the data using a specified var-cov +animate_xy(flea[, 1:6], axes = "off", ellipse=cov(flea[,1:6])) } diff --git a/man/draw_tour_axes.Rd b/man/draw_tour_axes.Rd index 3561f676..a42c5b1f 100644 --- a/man/draw_tour_axes.Rd +++ b/man/draw_tour_axes.Rd @@ -4,7 +4,16 @@ \alias{draw_tour_axes} \title{Draw tour axes on the projected data with base graphics} \usage{ -draw_tour_axes(proj, labels, limits = 1, position = "center", ...) +draw_tour_axes( + proj, + labels, + limits = 1, + position = "center", + axis.col = "grey50", + axis.lwd = 1, + axis.text.col = "grey50", + ... +) } \arguments{ \item{proj}{matrix of projection coefficients} @@ -18,6 +27,12 @@ projected data, default 1} \item{position}{position of the axes: center (default), bottomleft or off} +\item{axis.col}{colour of axes, default "grey50"} + +\item{axis.lwd}{linewidth of axes, default 1} + +\item{axis.text.col}{colour of axes text, default "grey50"} + \item{...}{other arguments passed} } \description{ diff --git a/man/guided_section_tour.Rd b/man/guided_section_tour.Rd index 0f1a7d59..dc72ef58 100644 --- a/man/guided_section_tour.Rd +++ b/man/guided_section_tour.Rd @@ -18,7 +18,7 @@ guided_section_tour( ) } \arguments{ -\item{index_f}{the section purusit index function to optimise. The function +\item{index_f}{the section pursuit index function to optimise. The function needs to take three arguments, the projected data, the vector of distances from the current projection plane, and the slice thickness h.} @@ -35,7 +35,7 @@ a better projection before giving up} \item{max.i}{the maximum index value, stop search if a larger value is found} \item{v_rel}{relative volume of the slice. If not set, suggested value -is caluclated and printed to the screen.} +is calculated and printed to the screen.} \item{anchor}{A vector specifying the reference point to anchor the slice. If NULL (default) the slice will be anchored at the data center.} diff --git a/man/mapShapes.Rd b/man/mapShapes.Rd index d1df54a6..f8edd1f6 100644 --- a/man/mapShapes.Rd +++ b/man/mapShapes.Rd @@ -4,10 +4,12 @@ \alias{mapShapes} \title{Map vector of factors to pch} \usage{ -mapShapes(x) +mapShapes(x, shapeset) } \arguments{ \item{x}{vector} + +\item{shapeset}{vector of integers indicating point shapes} } \description{ Map vector of factors to pch diff --git a/man/norm_bin.Rd b/man/norm_bin.Rd index dcf0faac..390c2045 100644 --- a/man/norm_bin.Rd +++ b/man/norm_bin.Rd @@ -15,8 +15,8 @@ norm_kol(nr) \description{ Compares the similarity between the projected distribution and a normal distribution. \itemize{ -\item{norm_bin }{compares the count in 100 histogram bins} -\item{norm_kol }{compares the cdf based on the Kolmogorov–Smirnov test (KS test)} +\item norm_bin: compares the count in 100 histogram bins +\item norm_kol: compares the cdf based on the Kolmogorov–Smirnov test (KS test) } } \examples{ diff --git a/man/radial_tour.Rd b/man/radial_tour.Rd index 85874053..e0d824e7 100644 --- a/man/radial_tour.Rd +++ b/man/radial_tour.Rd @@ -23,8 +23,8 @@ a method that works with tour paths like \code{\link{animate}}, \code{\link{save_history}} or \code{\link{render}}. } \examples{ -animate_xy(flea[, 1:6], radial_tour(basis_random(6, 2), mvar = 4)) -animate_xy(flea[, 1:6], radial_tour(basis_random(6, 2), mvar = c(3,4))) -animate_dist(flea[, 1:6], radial_tour(basis_random(6, 1), mvar = 4)) -animate_scatmat(flea[, 1:6], radial_tour(basis_random(6, 3), mvar = 4)) +animate_xy(flea[, 1:6], radial_tour(basis_random(6, 2), mvar = 4), rescale=TRUE) +animate_xy(flea[, 1:6], radial_tour(basis_random(6, 2), mvar = c(3,4)), rescale=TRUE) +animate_dist(flea[, 1:6], radial_tour(basis_random(6, 1), mvar = 4), rescale=TRUE) +animate_scatmat(flea[, 1:6], radial_tour(basis_random(6, 3), mvar = 4), rescale=TRUE) }