Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dicook committed Jan 31, 2025
1 parent 07f1d49 commit a1df406
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tourr
Title: Tour Methods for Multivariate Data Visualisation
Version: 1.2.3
Version: 1.2.4
Authors@R: c(
person("Hadley", "Wickham", email = "[email protected]", role = c("aut", "ctb"), comment = c(ORCID = "0000-0003-4757-117X")),
person("Dianne", "Cook", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-3813-7155")),
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# tourr 1.2.4

* Fixed an error with draw_tour_axes
* Added documentation on plotting a particular projection

# tourr 1.2.3

* New optimisation routine, using the jellyfish optimiser.
Expand Down
8 changes: 5 additions & 3 deletions R/display-xy.r
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
#' @examples
#' animate_xy(flea[, 1:6])
#' animate(flea[, 1:6], tour_path = grand_tour(), display = display_xy())
#' # This won't do anything because the flea data is standardised
#' # but use rescale option to force scaling before displaying
#' animate(flea[, 1:6],
#' tour_path = grand_tour(),
#' display = display_xy(),
#' scale = TRUE
#' rescale = TRUE
#' )
#' animate(flea[, 1:6],
#' tour_path = grand_tour(),
Expand Down Expand Up @@ -289,10 +291,10 @@ 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(prj, colnames(flea)[1:6], axislablong=TRUE)
#' draw_tour_axes(prj, colnames(flea)[1:6], longlabels=TRUE)
draw_tour_axes <- function(proj, labels, limits=1, position="center",
axis.col="grey50", axis.lwd=1, axis.text.col="grey50",
longlabels, ...) {
longlabels=FALSE, ...) {
position <- match.arg(position, c("center", "bottomleft", "off"))
if (position == "off") {
return()
Expand Down
9 changes: 8 additions & 1 deletion R/history.r
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@
#' testdata <- matrix(rnorm(100 * 3), ncol = 3)
#' testdata[1:50, 1] <- testdata[1:50, 1] + 10
#' testdata <- sphere_data(testdata)
#' t2 <- save_history(testdata, guided_tour(holes(), max.tries = 10),
#' t2 <- save_history(testdata, guided_tour(holes()),
#' max = 5
#' )
#' animate_xy(testdata, planned_tour(t2))
#'
#' # Or you can use saved histories to visualise the path that the tour took.
#' plot(path_index(interpolate(t2), holes()))
#'
#' # And you can plot any individual frame using
#' best_prj <- matrix(t2[,,3], ncol=2)
#' p <- render_proj(testdata, best_prj)
#' # which creates a data frame with the elements
#' # to make the plot, see render_proj() for plotting code
#' # OR see draw_tour_axes() for similar code in base graphics
save_history <- function(data, tour_path = grand_tour(), max_bases = 100, start = NULL,
rescale = FALSE, sphere = FALSE, step_size = Inf, ...) {
if (!is.matrix(data)) {
Expand Down
2 changes: 1 addition & 1 deletion R/search-jellyfish.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ search_jellyfish <- function(current, index, tries, max.tries = 50, ...) {
#' @param bases a list of bases extracted from the data collection object, see examples
#' @param min_dist the minimum distance between two bases
#' @rdname jellyfish
#' @export;
#' @export
check_dup <- function(bases, min_dist) {
res <- list()
res[[1]] <- bases[[1]]
Expand Down
4 changes: 3 additions & 1 deletion man/display_xy.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/draw_tour_axes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion man/save_history.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tourr.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 5fab2785-ed39-43d4-a1dc-d96ebd55dfd1

RestoreWorkspace: No
SaveWorkspace: No
Expand Down

0 comments on commit a1df406

Please sign in to comment.