Hi Abby, Tried this new version but did not execute... Clearly I am missing a step.
Bruce > library (barsurf) > library (KernSmooth) > set.bs.theme ("heat") > > plot_ds <- function (dataset, main="", xlim, ylim, ..., + ncontours=3, labcex=0.8, ndec=3, + k1=1, k2=1, n=30) + { names <- names (dataset) + x <- dataset [,1] + y <- dataset [,2] + bw.x <- k1 * bw.nrd (x) + bw.y <- k2 * bw.nrd (y) + if (missing (xlim) ) + xlim <- range (x) + c(-1, 1) * bw.x + if (missing (ylim) ) + ylim <- range (y) + c(-1, 1) * bw.y + + ks <- bkde2D (dataset, c (bw.x, bw.y), + c (n, n), list (xlim, ylim), FALSE) + + fb <- seq (min (ks$fhat), max (ks$fhat), + length.out = ncontours + 2) + fb <- fb [2:(ncontours + 1)] + fb <- round (fb, ndec) + + plot_cfield (ks$x1, ks$x2, ks$fhat, + contours=FALSE, + main=main, xlab = names [1], ylab = names [2], + xyrel="m") + points (x, y, pch=16, col="#00000040") + contour (ks$x1, ks$x2, ks$fhat, levels=fb, labcex=labcex, add=TRUE) + } > > plot_ds (bat_call, "plot 2", c (25, 28), c (-15, 10), k1=1.25, k2=1.25) *Error in plot_ds(bat_call, "plot 2", c(25, 28), c(-15, 10), k1 = 1.25, : ** ** object 'bat_call' not found* [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.