knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
library(knitr)
hook_output <- knit_hooks$get("output")
knit_hooks$set(output = function(x, options) {
  lines <- options$output.lines
  if (is.null(lines)) {
    return(hook_output(x, options))  # pass to default hook
  }
  x <- unlist(strsplit(x, "\n"))
  more <- "..."
  if (length(lines)==1) {        # first n lines
    if (length(x) > lines) {
      # truncate the output, but add ....
      x <- c(head(x, lines), more)
    }
  } else {
    x <- c(more, x[lines], more)
  }
  # paste these lines together
  x <- paste(c(x, ""), collapse = "\n")
  hook_output(x, options)
})

NINA package

Travis build status AppVeyor build status Codecov test coverage CRAN status

The goal of NINA is the the analysis and implementation of biotic interactions into environmental niche models using kernel density estimations.

Installation

You can install NINA from github repository with:

devtools::install_github("agarciaEE/NINA")

Example

This is a basic example which shows you how to use NINA's functions:

library(NINA)

Estimate Environmental Niche Models:

First group of species

g1_EN = EN_model(env_data, occ_data1, cluster = "env", n.clus = 5)

2nd group of species

g2_EN = EN_model(env_data, occ_data2, cluster = g1_EN$clus)

Correct EN models by biotic interactions:

g2_BC <- BC_model(g2_EN, g1_EN, A.matrix = int_matrix, type = "region")

Transform environmental niche space into ecological niche space (prioritizing the effect of biotic interactions).

g2_EC <- EC_model(g2_BC, type = "region")

You can summarize the output by using summary function or print:

summary(g1_EN)
print(g2_BC)

You can also plot a summary of the output model using plot function:

plot(g2_BC)

Models can be evaluated using models_evaluation function and visualize it by plotting the output.

eval <- models_evaluation(g2_BC)
plot(eval)


agarciaEE/NINA documentation built on Jan. 9, 2025, 10:09 a.m.