R/niches.R

Defines functions niches

Documented in niches

niches <-
function(blauObj, dev.range, ecologies.off = FALSE){
  uniqueEcologies <-  unique(blauObj$ids[,2])

  if (length(uniqueEcologies) == 1 || ecologies.off == TRUE){
    blauObj <- calc.niches(blauObj, dev.range)
    rownames(blauObj$isInNiche) <- rownames(blauObj$memberships)
  }
  else if (length(uniqueEcologies)) {
    blauObj <- calc.niches.ecology(blauObj, uniqueEcologies, dev.range)
  }

  presentCases <- which(complete.cases(blauObj$dimensions))
  
  blauObj <- getPresentCases(blauObj, presentCases)

  return(blauObj)
}

Try the Blaunet package in your browser

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

Blaunet documentation built on July 1, 2020, 5:22 p.m.