Duncan Murdoch <murdoch.duncan <at> gmail.com> writes:
>
> curve(L1, add=TRUE) should handle it.
> 

Thanks Duncan,

Your solution worked great! 
However, I'm puzzled for a problem in the same line: When I passed a 
"function producer" to plot, again it works well; however it doesn't work in 
the same way when I try to use this same argument in curve. See what I'm 
referring to:

  # A particular normal distribution function: 
  dn8 <- function(z,m) dnorm(z,m,8) #  norm dist with sd=8

  # A function that produces functions:
  #   returns a function such that given a mean(i) depends only
  #   on z
  fi <- function(i) function(z) dn8(z,i)

  plot(fi(370),xlim=c(360,420)) # Works well!
   
  curve(fi(380),add=T) # This doesn't work 

  # But in this way, it works!
  ff <- fi(380)
  curve(ff,add=T)

I cannot understand this behaviour. Could anyone give me some feedback on 
this?

Thanks,
 -Sergio.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to