\HeaderA{Kenvl}{Compute Envelope and Average of Simulations of K-fns}{Kenvl}
\keyword{spatial}{Kenvl}
\begin{Description}\relax
Computes envelope (upper and lower limits) and average of simulations of K-fns
\end{Description}
\begin{Usage}
\begin{verbatim}
Kenvl(fs, nsim, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{fs}] full scale for K-fn

\item[\code{nsim}] number of simulations

\item[\code{...}] arguments to produce one simulation

\end{ldescription}
\end{Arguments}
\begin{Value}
list with components

\begin{ldescription}
\item[\code{x}] distances

\item[\code{lower}] min of K-fns

\item[\code{upper}] max of K-fns

\item[\code{aver}] average of K-fns

\end{ldescription}
\end{Value}
\begin{References}\relax
Ripley, B. D. (1981) \emph{Spatial Statistics.} Wiley.

Venables, W. N. and Ripley, B. D. (2002)
\emph{Modern Applied Statistics with S.} Fourth edition.  Springer.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{Kfn}{Kfn}}, \code{\LinkA{Kaver}{Kaver}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
towns <- ppinit("towns.dat")
par(pty="s")
plot(Kfn(towns, 40), type="b")
plot(Kfn(towns, 10), type="b", xlab="distance", ylab="L(t)")
for(i in 1:10) lines(Kfn(Psim(69), 10))
lims <- Kenvl(10,100,Psim(69))
lines(lims$x,lims$lower, lty=2, col="green")
lines(lims$x,lims$upper, lty=2, col="green")
lines(Kaver(10,25,Strauss(69,0.5,3.5)), col="red")
\end{ExampleCode}
\end{Examples}

