Skip to content

Commit 9a7ec47

Browse files
committed
More workarounds
1 parent 8dcf040 commit 9a7ec47

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

demo/animation-tour-USArrests.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ library(plotly)
33

44
data("USArrests")
55

6+
# Avoids R CMD check NOTE about using `tourr` without mentioning it in DESCRIPTION
7+
# Install it via CRAN `install.packages("tourr")`
68
rescale <- getFromNamespace("rescale", "tourr")
79
new_tour <- getFromNamespace("new_tour", "tourr")
810
grand_tour <- getFromNamespace("grand_tour", "tourr")

demo/animation-tour-basic.R

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
# adapted from https://github.com/rstudio/ggvis/blob/master/demo/tourr.r
2-
library(tourr)
32
library(plotly)
43

4+
# Avoids R CMD check NOTE about using `tourr` without mentioning it in DESCRIPTION
5+
# Install it `install.packages("tourr")`
6+
rescale <- getFromNamespace("rescale", "tourr")
7+
new_tour <- getFromNamespace("new_tour", "tourr")
8+
grand_tour <- getFromNamespace("grand_tour", "tourr")
9+
lazyLoad(
10+
file.path(system.file("data", package = "tourr"), "Rdata"),
11+
filter = function(x) x == "flea"
12+
)
13+
514
mat <- rescale(as.matrix(flea[1:6]))
615
tour <- new_tour(mat, grand_tour(), NULL)
716

817
tour_dat <- function(step_size) {
918
step <- tour(step_size)
10-
proj <- center(mat %*% step$proj)
19+
proj <- scale(mat %*% step$proj, center = TRUE, scale = FALSE)
1120
data.frame(x = proj[,1], y = proj[,2],
1221
species = flea$species)
1322
}

demo/crosstalk-filter-lines.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ library(crosstalk)
22
library(ggplot2)
33
library(plotly)
44

5-
data(gapminder, package = "gapminder")
5+
# Equivalent to data(gapminder, package = "gapminder"), but avoids R CMD check NOTE
6+
# about `gapminder` not being in DESCRIPTION. Install it `install.packages("gapminder")`
7+
lazyLoad(
8+
file.path(system.file("data", package = "gapminder"), "Rdata"),
9+
filter = function(x) x == "gapminder"
10+
)
611

712
sd <- highlight_key(gapminder)
813

0 commit comments

Comments
 (0)