Message-ID: <000001c3ec37$a5085910$78f05a99@msu.montana.edu>
Date: 2004-02-05T22:29:53Z
From: Andy Bunn
Subject: (Novice-) Problem with the plot-function
In-Reply-To: <200402052245.58610.atropin75@t-online.de>
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)