hadley/ggplot2 — Issue #279: rescaler() causing an example to fail in ggplot2 0.9.0
Author: djmurphy420
Created: 2011-12-05 17:35:29+00:00
State: open

Decided to try running all the examples in the latest development version of ggplot2 - one fails because it cannot find the rescaler() function from reshape (not loaded at this point). Probably want to remove references to it in the examples unless the package is explicitly loaded. AFAICT, there are three references to rescaler() in the development version of ggplot2:

(i) an example in aes-linetype-size-shape.r:

#' # Mapping line type from a variable
#' ec_scaled <- data.frame(date = economics$date, rescaler(economics[, -(1:2)], "range"))

(ii) inside the function body of ggpcp() in templates.r:

ggpcp <- function(data, vars=names(data), scale="range", ...) {
force(vars)
scaled <- rescaler(data[, vars], type=scale)
...

(iii) commented out in the function definition in matrix.r.

Currently, running examples_run('ggplot2') will terminate after it encounters (i):

> ec_scaled <- data.frame(date = economics$date, rescaler(economics[, -(1:2)], "range"))
Error in data.frame(date = economics$date, rescaler(economics[, -(1:2)], :
could not find function "rescaler"
In addition: Warning message:
In .recacheSubclasses(def@className, def, doSubclasses, env) :
undefined subclass "Scales" of class "refObject"; definition not updated

Should be an easy fix, but mentioning it to put it on the to-do list.

Dennis