Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I resolve this error and generate a bar chart?: Error in check_aesthetics(evaled, n)

I’m familiarizing myself with tidyverse. Able to produce a barchart with the default barchart(), but I’m running into issues with this. All objects are of equal length and I’m not sure what exact mistake I’m making within aoe(). Thank you in advance.

### Sample data
    df <- data.frame(a = c(sample(500:2000,50)),
                     b = c(sample(500:2000,50)),
                     c = c(sample(500:2000,50)),
                     d = c(sample(500:2000,50)),
                     e = c(sample(500:2000,50)),
                     f = c(sample(500:2000,50)),
                     g = c(sample(500:2000,50)),
                     h = c(sample(500:2000,50)),
                     i = c(sample(500:2000,50)),
                     j = c(sample(500:2000,50)),
                     k = c(sample(500:2000,50)),
                     l = c(sample(500:2000,50)),
                     m = c(sample(500:2000,50)),
                     n = c(sample(500:2000,50)))
    
### Assign values to objects    
    totals <- apply(df, 2, sum)
    names <- c(colnames(df))
### Create bar chart    
    ggplot(df, aes(x = names, y = totals)) + geom_bar(stat = "identity")

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Does Ge19WdSt refer to anything?

library(ggplot2)
ggplot(cbind.data.frame(names,totals),aes(x = names, y = totals)) + geom_bar(stat = "identity")


Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading