R/attr_age_unique_landscape.R

Defines functions attr_age_unique_landscape

attr_age_unique_landscape <- function(rland, span_age, position)
{
  
  l1 <- rland$nodes.characteristics
  l2 <- span_age[[position]]
  l3 <- cbind(l1,l2$age)
  if(inherits(rland, "metapopulation")) names(l3)[10] <- "age"
  if(inherits(rland, "landscape")) names(l3)[9] <- "age"
  #if(class(rland)=="metapopulation")names(l3)[10] <- "age"
  #if(class(rland)=="landscape")names(l3)[9] <- "age"
  rland$nodes.characteristics <- l3
  return(rland)
}

Try the MetaLandSim package in your browser

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

MetaLandSim documentation built on Jan. 13, 2023, 1:11 a.m.