R Language: How to Set Ylim?
I Am Trying to Plot Data with Maximum 9.70 and Minimum -58.9. I Coded: Plot(Briannajan[,3, I], Type = "Line", Col="Black", Main = "Brianna January Trend", Xlab...
I am trying to plot data with maximum 9.70 and minimum -58.9.
I coded:
plot(BriannaJan[,3,i], type = "line", col="black",
main = "Brianna January Trend", xlab = "days", ylab="Temperature",
ylim = -60:10)
But I get error:
Error in plot.window(...) : invalid 'ylim' value
How can I set ylim? y value range has to be from -60 to 10.
2 Answers
-60:10 generates a sequence from -60 to 10, what you need as the ylim is a min and max value (with syntax c(min, max)) instead of a sequence, try this:
ylim=c(-60,10)
You need to change it to
ylim=c(-60,10)
so the whole thing would be:
plot(BriannaJan[,3,i], type = "line", col="black", main ="Brianna January Trend",
xlab = "days", ylab="Temperature", ylim=c(-60,10))