I have a complex function of y in terms of x as below
y = 1-(e^(-((x^2)/730)))
or y equals 1-(e power minus (x-square/730))
How do i represent such complex functions in R? I want to draw a curve(graph) connecting all these points. I also want to mark x-axis from 0 to 370 with interval of 10. I know how to keep the breaks, but i don’t know how i can label axes with numbers. If help is given somewhere, please guide me to that link. Much appreciated.
Check out the help for
?curve,?axis…One thing to note is that R suppresses overlapping labels, so unless you have a very wide plot you won’t actually see every axis label. You can try adding
cex.axis=0.5(or even smaller) to your side-1 axis if you like. You could also check out thestaxlabfunction from theplotrixpackage, or rotate the axis labels.(You had a lot of superfluous parentheses in your expression; more parentheses don’t really hurt, but in the long run you can make cleaner code (and spend less time counting parentheses) if you learn the order of operations.)