dcast and enviroments #18

mnel opened this Issue Apr 19, 2012 · 0 comments


None yet
2 participants

mnel commented Apr 19, 2012

When using knitr with caching, I came across a problem associated with dcast.

It is reported in yihui/knitr #207 and may be the same as
ggplot2 #377

eval(parse(text = "
df = data.frame(x = letters[1:2], y = letters[1:3], z = rnorm(6))
g = c('b', 'a')
dcast(df, y~ordered(x, levels = g))
"), envir = new.env())

which gives

Using z as value column: use value.var to override.
Error in factor(x, ..., ordered = TRUE) : object 'g' not found

hadley closed this in 562dd64 Apr 19, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment