--I wish to grab the data created by plot.secr, i.e. x and y values, lcl and ucl, to use for further processing (e.g. plotting in other packages/software)My use case is a model of sex differences in g0 and sigma, where I want to plot the lines for each sex in different colors. Currently I use plot.secr like this:# create toy data# add covariate 'sex' to captset.seed(123)covariates(captdata) <- data.frame(sex = sample(c("f", "m"), size = nrow(captdata),p = c(0.4, 0.6), replace = TRUE))# set starting value of spatial scalesv <- RPSV(captdata, CC = TRUE)# fit modelm <- secr.fit(captdata, model = list(g0 ~ sex, sigma ~ sex),CL = TRUE, buffer = 4 * is, trace = FALSE)# plot males and females# plot first level of sex, female, coded as 0plot(m, newdata = data.frame(sex = 0), limits = TRUE, col = "red", xval = 0:100, ylim = c(0, 0.5))# plot second level of sex, male, coded as 1plot(m, newdata = data.frame(sex = 1), limits = TRUE, add = TRUE, col = "green")However, for consistency with other (non-secr) plots I have created, I wish to use e.g. lattice or ggplot to visualize my secr results. I therefore need to be able to save the data generated by plot.secr.I suppose I would need to add invisible(data.frame(x = xval, y = y, lcl = lcl, ucl = ucl)) to the plot.secr function somewhere (analogous to e.g. boxplot.default, where, in addition to the actual plot, also the values calculated by the function are returned), but so far my attempts have failed.Does anyone know do to grab the data from plot.secr? Is this a feature which may be considered in secr?
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.