Error in as.vector(x, "character")

Hi! I'm very new to rstudio, trying to plot a simple graph with ggplot2.

When I tried to run my code, this error showed up:

Error in as.vector(x, "character") : 
  cannot coerce type 'closure' to vector of type 'character'

It seems to be a common error but I don't understand...
What is missing from the code?

g <- ggplot(grievances.japan, aes(x=Fiscal_Year, y=Number)) + geom_point() +
  ggtitle("Testing") + 
  xlab("Fiscal Year")  + scale_x_discrete(breaks_pretty(10))


I think you should name the param you want to pass breaks_pretty in for

 xlab("Fiscal Year")  + scale_x_discrete(breaks = breaks_pretty(10))

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