Skip to content
This repository was archived by the owner on Feb 9, 2024. It is now read-only.

no applicable method for 'group_by_' applied to an object of class "ggvis" #474

@maspotts

Description

@maspotts

I have run into an unexpected problem when including a call to ggvis::group_by in a library I'm building. This is the offending code:

x %>% gather(key, value, -x) %>% bind_rows(s) %>% ggvis(~x, ~value) %>%
         layer_points(fill=~key) %>% group_by(key) %>% layer_paths(stroke=~key)

and it works great if I paste it directly into my R shell. But when I build it into a library, using:

 #' @importFrom ggvis ggvis layer_points layer_paths group_by

and then try to execute that code I get this error:

Error in UseMethod("group_by_") :
no applicable method for 'group_by_' applied to an object of class "ggvis"

I see that ggvis::group_by is just UseMethod("group_by") in the dplyr namespace. I've tried importing group_by (and even also group_by_) from dplyr, but nothing helped. I'm at a loss to understand what I'm doing wrong, or conceivably I've found a bug? I did find references to this error message being due to a long-fixed bug in ggvis (6c1ebbe), which appears to add group_by_ as an export in ggvis' namespace.

I've replicated this problem under the latest ggvis (0.4.3) and both dplyr 0.5.0 and 0.7.0.

Any help will be gratefully appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions