[R] Interactive plot using playwith() and abline

Felix Andrews felix at nfrac.org
Sat Jul 26 04:13:31 CEST 2008


Indeed, the call you pass to playwith() must be a self-contained plot
function. Try one of these:

playwith( {plot(x,y); abline(lm(y~x)} )

playwith(plot(x,y, panel.last=abline(lm(y~x))))

playwith(xyplot(y ~ x, type=c("p", "r")))


On Sat, Jul 26, 2008 at 1:52 AM, Christoph Scherber
<Christoph.Scherber at agr.uni-goettingen.de> wrote:
> Dear all,
>
> Is it possible to use abline() after calling playwith(plot(...)))?
>
> x=1:10
> y=x^2
>
> playwith(plot(x,y)) # works fine
> playwith({abline(lm(y~x))}) # doesn?t work
>
>
> Thanks!
>
> Christoph
>
>
>



-- 
Felix Andrews / 安福立
PhD candidate
Integrated Catchment Assessment and Management Centre
The Fenner School of Environment and Society
The Australian National University (Building 48A), ACT 0200
Beijing Bag, Locked Bag 40, Kingston ACT 2604
http://www.neurofractal.org/felix/
3358 543D AAC6 22C2 D336 80D9 360B 72DD 3E4C F5D8



More information about the R-help mailing list