Learn R Programming

PointedSDMs (version 2.1.6)

dataOrganize: R6 class to assist in reformatting the data to be used in dataSDM.

Description

Internal functions used to temporarily store data and other information before adding to dataSDM.

Arguments

Methods


dataOrganize$makeData()

Function to form the data into sf objects, as well as extract other information about the model required.

Usage

dataOrganize$makeData(
  datapoints,
  datanames,
  coords,
  proj,
  marktrialname,
  paresp,
  countsresp,
  trialname,
  speciesname,
  marks,
  pointcovnames,
  markfamily,
  temporalvar,
  offsetname
)

Arguments

datapoints

A list of datasets as either sf, data.frame or SpatialPoints objects.

datanames

A vector of the names of the datasets.

coords

Names of the coordinates used in the model.

proj

The projection reference system used in the model.

marktrialname

Name of the trial variable used by the binomial marks.

paresp

Name of the response variable used by the presence absence datasets.

countsresp

Name of the response variable used by the counts data.

trialname

Name of the trial variable used by the presence absence datasets.

speciesname

Name of the species name variable.

marks

Name of the marks considered in the model.

pointcovnames

Name of the point covariates used in the model.

markfamily

A vector describing the distribution of the marks.

temporalvar

The name of the temporal variable.

offsetname

The name of the offset


dataOrganize$makeSpecies()

Function used to separate the datasets by species.

Usage

dataOrganize$makeSpecies(speciesname, repl = FALSE)

Arguments

speciesname

The name of the species variable.

repl

Are species effects replicate. Defaults to FALSE.


dataOrganize$makeMultinom()

Function to make multinomial marks, if any are included in the model.

Usage

dataOrganize$makeMultinom(multinomVars, return, oldVars, repl = FALSE)

Arguments

multinomVars

Name of the multinomial marks.

return

What to return: species or marks.

oldVars

If any multinomial marks were included in a previous iteration, what where their names.

repl

Species replicate model included. Defaults to FALSE.


dataOrganize$makeFormulas()

Function used to create formulas for the processes.

Usage

dataOrganize$makeFormulas(
  spatcovs,
  spatcovclass,
  speciesname,
  paresp,
  countresp,
  marks,
  marksspatial,
  speciesintercept,
  speciesenvironment,
  spatial,
  intercept,
  temporalname,
  speciesindependent,
  markintercept,
  pointcovs,
  speciesspatial,
  biasformula,
  covariateformula
)

Arguments

spatcovs

Names of the spatial covariates used in the model.

spatcovclass

Class of the spatial covariates.

speciesname

Name of the species variable.

paresp

Name of the presence absence response variable.

countresp

Name of the count data response variable.

marks

Name of the marks used in the model.

marksspatial

Logical: should spatial fields be included for the marks.

speciesintercept

Logical: should specific species intercept terms be created for the species.

speciesenvironment

Logical: should species specific environmental terms be created.

spatial

Logical: are spatial effects run in the model.

intercept

Logical: are intercepts run in the model.

temporalname

Name of the temporal variable used in the model.

speciesindependent

Logical: make independent species effects.

markintercept

Logical: are intercepts run for the marks in the model.

pointcovs

Name of the point covariates.

speciesspatial

Logical: should the species have spatial fields.

biasformula

Terms to include for PO data.

covariateformula

Terms to include for the covariate formula.


dataOrganize$makeComponents()

Function used to make components for the model.

Usage

dataOrganize$makeComponents(
  spatial,
  intercepts,
  datanames,
  marks,
  speciesname,
  multinomnames,
  pointcovariates,
  covariatenames,
  covariateclass,
  marksspatial,
  marksintercept,
  temporalname,
  speciesspatial,
  speciesenvironment,
  speciesintercept,
  numtime,
  temporalmodel,
  offsetname,
  copymodel,
  speciesindependent,
  biasformula,
  covariateformula,
  marksCopy
)

Arguments

spatial

Logical: are spatial effects run in the model.

intercepts

Logical: are intercepts run in the model.

datanames

Names of the datasets used in the model.

marks

Names of the marks used in the model.

speciesname

Name of the species variable.

multinomnames

Names of the multinomial marks.

pointcovariates

Names of the point covariates.

covariatenames

Names of the spatially varying covariates.

covariateclass

The classes of the spatially varying covariates.

marksspatial

Logical: should spatial fields be included for the marks.

marksintercept

Logical: should intercepts be included for the marks.

temporalname

Name of the temporal variable used in the model.

speciesspatial

Logical: Should the species be run with spatial fields.

speciesenvironment

Logical: Should the species have their own environmental effects.

numtime

Number of time increments included in the model.

offsetname

Name of the offset column in the datasets.

copymodel

List of the hyper parameters for the copy model.

speciesindependent

Logical: should species effects be made independent.

biasformula

Terms to include for PO data.

covariateformula

Terms to include for the covariate formula.

marksCopy

Names of where each mark occurs in the dataset.

speciesintercept:

Logical: should intercept terms be created for each species.


dataOrganize$makeLhoods()

Function to make the datasets into likelihoods.

Usage

dataOrganize$makeLhoods(
  mesh,
  ips,
  paresp,
  ntrialsvar,
  markstrialsvar,
  speciesname
)

Arguments

mesh

An fm_mesh_2d object.

ips

Integration points used.

paresp

The response variable name for the presence absence datasets.

ntrialsvar

The trials variable name for the presence absence datasets.

markstrialsvar

The trial variable name for the binomial marks.

speciesname

The name of the species variable used.


dataOrganize$clone()

The objects of this class are cloneable with this method.

Usage

dataOrganize$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.