So far I have the following from my ggplot compilation:
And I got the axis just right this time ... with the following code snippet:
p<- p + ylim(c(0,100))
p<- p + geom_hline(aes(yintercept=0))
p<- p + scale_x_continuous(breaks = c(seq(1940,1985,by=5)))
p
so I have an x-axis from 1940-1985 by steps of 5 and a y-axis from 0-100 by steps of 20 ...
The first question
How do I make the 100 appear on the y-axis?
The second question
How do I change my x-labels into the following string vectors?
abbrev_x <- c("1940","'45","'50","'55","'60","'65","'70","'75","'80","'85")
abbrev_y <- c("0","20","40","60","80","100%")
So, the best solution I've found revolves around scale_x_continuous, which the following code snippet example suggests work with already pre-existing string axis labels:
p + scale_x_discrete(limit = c("I1", "SI2", "SI1"),
labels = c("Ione","SItwo","SIone"))
This is certainly an issue, as what I want to write is the following:
abbrev_x <- c("1940","'45","'50","'55","'60","'65","'70","'75","'80","'85")
abbrev_y <- c("0","20","40","60","80","100%")
p<- p + scale_x_continuous(breaks = abbrev_x)
p<- p + scale_y_continuous(breaks = abbrev_y)
p
But this seems to be a fictitious reality in my world right now. To justify this fiction, here is the following error code, among others as I tweak:
Error in x - from[1] : non-numeric argument to binary operator
Any thoughts?


