Can not done one graphic. Please help.

library(ggplot2)
library(readr)
library(dplyr)
library(forcats)
library(readxl)
kyc <- read_excel("Downloads/testr.xlsx")

kyc %>% count(Date, Status, wt= Count, sort = TRUE) %>%

Stacked + percent

ggplot(kyc, aes(fill=Status, y=n, x=Date)) +
geom_bar(position="fill", stat="identity")

Who can help me fix it please? DM me please

First, you need to tell us what needs fixing. Second, to debug your code we will probably need the data for the plot (the Excel file, or sample contents that produce the same problem). Third, you have a line of code that ends with %>%, which would not run. Either this is a typo or there is some code missing from your question.

I think that you need to use the output from the count() function as the data in ggplot(), not the original kyc data. Try this:

kyc %>% count(Date, Status, wt= Count, sort = TRUE) %>%
ggplot(aes(fill=Status, y=n, x=Date)) +
geom_bar(position="fill", stat="identity")

I strongly agree that you are much more likely to get help if you identify the problem and provide at least a sample of your data for us to use for finding a fix.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.