Open nspyrison opened 3 years ago
@nspyrison try out the code again. I fixed one problem that the initialisation wasn't happening correctly if one of the first variables was frozen.
@dicook, that fixed the first issue! To list the remaining issue and re-hash 2 cases from the example section of ?frozen_tour
:
require(tourr) ## SHA1 (272a2f88) from 30/05/2021
#> Loading required package: tourr
#install.packages("ellipsis") ## required newer ver
#install.packages("vctrs") ## required newer ver
print("Case 4 remains unexpected success.")
#> [1] "Case 4 remains unexpected success."
## Norm > 1, variable contribution larger than 1; unexpected success
frozen <- matrix(NA, nrow = 4, ncol = 2)
frozen[3, ] <- .9
if(interactive())
animate_xy(flea[, 1:4], frozen_tour(2, frozen))
print("Now working, but sometimes has discrete jumps, step size seem much larger than ussual for 2 consecutive frames, seems undesirable.")
#> [1] "Now working, but sometimes has discrete jumps, step size seem much larger than ussual for 2 consecutive frames, seems undesirable."
# Doesn't work - a bug?
frozen <- matrix(NA, nrow = 4, ncol = 2)
frozen[1:2, 1] <- 1 / 4
if(interactive())
animate_xy(flea[, 1:4], frozen_tour(2, frozen))
print("Less importantly, when norm = 1, error code should suggest use of dependence_tour() to set 1 variable to 1 axis. As pointed out in this example code:")
#> [1] "Less importantly, when norm = 1, error code should suggest use of dependence_tour() to set 1 variable to 1 axis. As pointed out in this example code:"
## Not run:
# This freezes one entire direction which causes a problem,
# and is caught by error handling.
# If you want to do this it would be best with a dependence
# tour, with one variable set one axis, eg 3rd variable to
# x axis would be indicated from the code below
frozen <- matrix(NA, nrow = 4, ncol = 2)
frozen[3, ] <- c(0, 1)
animate_xy(flea[, 1:4], frozen_tour(2, frozen))
#> Converting input data to the required matrix format.
#> Error: Columns of frozen matrix must have squared norm < 1
Created on 2021-05-30 by the reprex package (v2.0.0)
1) works for some but not all variables 2) Only seems to check the column norm, not the row (variable norm) 3) see other comments in the example section, not run
Created on 2021-04-12 by the reprex package (v1.0.0)