2021年5月4日星期二

How can I remove an empty value that is generated when I use breaks = seq()

I'm using a dataset that has some data about the number cases of a disease vs the year they occurred. The thing is that I don't have information for the year 1997, but I'm using:

scale_x_continuous("Year",                  breaks = seq(1996, 2013))   

To arrange in a bar plot (with geom_col) the years (x) vs the cases (y). However, because the 1997 doesn't even exist in my data frame, the fact that I'm using those breaks generates it, and I have a blank space in my plot.

Any suggestions?

Thanks.

https://stackoverflow.com/questions/67394276/how-can-i-remove-an-empty-value-that-is-generated-when-i-use-breaks-seq May 05, 2021 at 10:05AM

没有评论:

发表评论