[R] expression() and plot title

Cheng Peng cpeng at usm.maine.edu
Sat Aug 28 07:09:02 CEST 2010


Try this:

> LinePlot(1,1)
> LinePlot=function(a,b){
+ # a = slope
+ # b = y intercept
+ x=seq(-10,10,0.4)
+ y=a*x+b
+ plot(x,y, type="l")
+ title(paste("a=",a,"b=",b))
+ }
> 
> #test
> LinePlot(a=-2,b=9)

HTH


-- 
View this message in context: http://r.789695.n4.nabble.com/expression-and-plot-title-tp2348566p2350361.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list