R/prepare-acdc-covars.R

# Generated by autofun (0.0.0.9000): do not edit by hand!!!
# Please edit source code in R-autofun/prepare-acdc-covars.R
.prepare_acdc_covars<-function(...){
expression(if (use.coords) {
  covars <- data.frame(covars, candi[, 2:3])
}, covars.type <- ifelse(pedometrics::anyFactor(covars), "factor", "numeric"), 
    if (covars.type == "factor") {
      if (!pedometrics::allFactor(covars)) {
        i <- which(sapply(covars, is.factor) == FALSE)
        mes <- paste("converting ", length(i), " numeric covariates into factor covariates...", sep = "")
        message(mes)
        num_covars <- data.frame(covars[, i])
        # breaks <- .strataACDC(
        #   n.pts = n_pts, strata.type = strata.type, covars = num_covars, covars.type = "numeric")[[1]]
        # Use 'n_pts + n_fixed_pts' to account for existing fixed points.
        breaks <- .strataACDC(
          n.pts = n_pts + n_fixed_pts, strata.type = strata.type, covars = num_covars, covars.type = "numeric")[[1]]
        num_covars <- pedometrics::cont2cat(x = num_covars, breaks = breaks)
        covars[, i] <- num_covars
      }
    }, n_cov <- ncol(covars), sm <- covars[points[, 1], ])
}

Try the spsann package in your browser

Any scripts or data that you put into this service are public.

spsann documentation built on May 2, 2019, 1:36 p.m.