Skip to contents

This assessment covers both the indicator and the constituent species. An assessment is made of the indicator over the time period given, examining whether the initial indicator value falls within the credible interval of the final year. Over the same time period the change in each species is assessed and reported.

Usage

trend_assessment(
  dat,
  method = "lambda",
  start_year = NULL,
  end_year = NULL,
  species_stat = "mean"
)

Arguments

dat

An object returned by lambda_interpolation or bma

method

Which indicator method was used to produce the data. One of "lambda" or "bma".

start_year

(Optional) a numeric value, defaults to the first year

end_year

(Optional) a numeric value, defaults to the last year

species_stat

(Optional) character, the statistic used to average across a species yearly change values to arrive at a single value per species. This can be either 'mean' (default) or 'median'.

Value

Returns a list of two elements, a summary of the species and indicator assessments. A plot of the species assessment is returned to the device.

Examples

### Running from an array ####
set.seed(123)
# number of species
nsp = 50

# number of years
nyr = 40

#number of iterations
iter = 500

# Build a random set of data
myArray <- array(data = rnorm(n = nsp*nyr*iter,
                              mean = 0.5,
                              sd = 0.1),
                 dim = c(nsp, nyr, iter),
                 dimnames = list(paste0('SP',1:nsp),
                                 1:nyr,
                                 1:iter))

# Ensure values are bounded by 0 and 1
myArray[myArray > 1] <- 1
myArray[myArray < 0] <- 0

# Run the lambda_indicator method on this data                
myIndicator <- lambda_indicator(myArray)

# Plot the trend stack
trend_assessment(myIndicator)
#> $species_assessment
#>      percent_change_year  category
#> SP1         0.0905194271 no change
#> SP2        -0.0799339038 no change
#> SP3        -0.0560302992 no change
#> SP4         0.0506986293 no change
#> SP5         0.0568966703 no change
#> SP6         0.0081296028 no change
#> SP7         0.0814661373 no change
#> SP8        -0.0250134002 no change
#> SP9        -0.0697988570 no change
#> SP10        0.0795581466 no change
#> SP11       -0.0753321163 no change
#> SP12        0.0010294928 no change
#> SP13        0.0365834217 no change
#> SP14       -0.0813422894 no change
#> SP15        0.0223639048 no change
#> SP16       -0.1084968105 no change
#> SP17       -0.0508159392 no change
#> SP18        0.0082710499 no change
#> SP19       -0.0005364494 no change
#> SP20        0.0224533381 no change
#> SP21       -0.0743542872 no change
#> SP22        0.0235321974 no change
#> SP23       -0.1372121637 no change
#> SP24        0.0068900108 no change
#> SP25       -0.0717393802 no change
#> SP26        0.0649905351 no change
#> SP27        0.0496135655 no change
#> SP28        0.0460645899 no change
#> SP29       -0.0154301373 no change
#> SP30       -0.0820871270 no change
#> SP31       -0.0122093641 no change
#> SP32       -0.0804416837 no change
#> SP33        0.1000944876 no change
#> SP34        0.0491616761 no change
#> SP35        0.0457235228 no change
#> SP36       -0.0423739548 no change
#> SP37        0.0445838358 no change
#> SP38        0.0195071361 no change
#> SP39       -0.0479727135 no change
#> SP40        0.0294197844 no change
#> SP41       -0.0266787063 no change
#> SP42       -0.0291441558 no change
#> SP43        0.0172679059 no change
#> SP44       -0.0066940954 no change
#> SP45        0.0442883770 no change
#> SP46       -0.2454249077 no change
#> SP47        0.0190180208 no change
#> SP48       -0.1036430275 no change
#> SP49       -0.0218004687 no change
#> SP50       -0.0117518859 no change
#> 
#> $indicator_asssessment
#>   start_index end_lower end_upper assessment
#> 1         100  84.59769  116.2142     stable
#>