Skip to content

Error on "count column is missing in your data" #7

@wook2014

Description

@wook2014

Appreciate for creating such a good package. I meet up with a problem when using ggpie with summarized data.
I have my data like this:

dt <- data.frame(  
  Name = c("A", "B", "C","D","E"),  
  number = c(40, 35, 30,25,20)  
)  

and this is a summarized data. According to the document mentioned in https://showteeth.github.io/ggpie/reference/ggpie.html
it seemed that I can directly use number as the proportion for the pie chart by setting count_type = "count", but it is confused that how to assign the count column and after I run my code like this:

ggdonut(data = dt, group_key = "Name", count_type = "count",
                label_info = c("all"), label_type = "horizon",
                label_size = 4, label_pos = "out", label_threshold = 15)

an error occurs:
Error in PrepareData(data = data, group_key = group_key, count_type = count_type, : count column is missing in your data.
How to solve the problem? Should I rename the column numbertocount? And I suggest that there should be some examples with count_type = "count" in the readme document to show how to deal with wide data instead of long data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions