[R] (Novice-) Problem with the plot-function
Andy Bunn
abunn at montana.edu
Thu Feb 5 23:29:53 CET 2004
See ?range. And note that I changed plot to more explicitly show what is
being plotted.
HTH, Andy
#~~~~~~~~~~~~~~~~~~
n.Plot <- function(x,my,sigma) {
e <- exp(1)
names(x) <- x
f.x <- (1/(sigma*sqrt(2*pi)))*e^(-1*(((x-my)^2)/2*(sigma^2)))
plot(x, f.x, type="l", xlim = range(x))
return(f.x)
}
n.Plot(seq(-5,5,0.01),0,1)
n.Plot(seq(-50,50,0.01),0,0.1)
More information about the R-help
mailing list