Skip to content

Can't pipe into qplot with non-auto geom #3670

Closed
@PatrickRobotham

Description

@PatrickRobotham

I can plot a histogram with any of:

my_data <- rnorm(100);
qplot(my_data);
qplot(my_data, geom="auto");
qplot(my_data, geom="histogram");

my_data %>% qplot;
my_data %>% qplot(geom="auto");
my_data %>% qplot(geom="auto", x = .);

my_data %>% ggplot(data = data.frame(foo=.), mapping=aes(x = foo)) +
geom_histogram();

I would expect the same behaviour from

my_data %>% qplot(geom="histogram");
my_data %>% qplot(geom="histogram", x = .);

but instead these two fail with

Don't know how to automatically pick scale for object of type list.
Defaulting to continuous
Error in as.data.frame.default(x[[i]], optional = TRUE,
stringsAsFactors = stringsAsFactors) :
  cannot coerce class "c("gg", "ggplot")" to a data.frame

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions