[R] ggplot / second axis / just a notation problem

John miaojpm at gmail.com
Tue Oct 17 11:24:55 CEST 2017


Hi,

   I have a question on ggplot2 with the second axis, but I don't think one
needs to know ggplot2 package in order to answer this question.

   In this example,
https://rpubs.com/MarkusLoew/226759
   since the transformation of the second axis is given by y1=y2*5,
#####
   p <- p + scale_y_continuous(sec.axis = sec_axis(~.*5, name = "Relative
humidity [%]"))
#####
   Note  "~.*5"
   What can I do if the transformation is given by y1=y2-3 or y1=y2/5?
   Should I write "~.-3" or "~./5"?

   Thanks,

John

	[[alternative HTML version deleted]]



More information about the R-help mailing list