Running ‘aitchison-tests.R’ [1s/2s]
  Comparing ‘aitchison-tests.Rout’ to ‘aitchison-tests.Rout.save’ ... OK
  Running ‘cca-object-tests.R’ [3s/8s]
  Comparing ‘cca-object-tests.Rout’ to ‘cca-object-tests.Rout.save’ ... OK
  Running ‘decostand-tests.R’ [1s/2s]
  Running ‘oecosimu-tests.R’ [2s/3s]
  Comparing ‘oecosimu-tests.Rout’ to ‘oecosimu-tests.Rout.save’ ... OK
  Running ‘vegan-tests.R’ [4s/5s]
  Comparing ‘vegan-tests.Rout’ to ‘vegan-tests.Rout.save’ ... OK
Running the tests in ‘tests/decostand-tests.R’ failed.
Complete output:
  > ###<--- BEGIN TESTS --->
  > suppressPackageStartupMessages(require(vegan))
  > 
  > ############################### CLR ####################################
  > # Calculates clr-transformation. Should be equal.
  > 
  > # Test data
  > data(varespec)
  > set.seed(42)
  > testdata <- matrix(round(runif(1000, 0, 100)), nrow = 20)
  > testdata <- testdata - 50
  > testdata[testdata < 0] <- 0
  > rownames(testdata) <- paste0("row", seq_len(nrow(testdata)))
  > colnames(testdata) <- paste0("col", seq_len(ncol(testdata)))
  > testdata.with.pseudo <- testdata + 1
  > 
  > # Calculates relative abundance table
  > relative <- decostand(testdata, "total")
  > relative.with.pseudo <- decostand(testdata + 1, "total")
  > 
  > # CLR data
  > x.clr  <- decostand(testdata + 1, method = "clr")
  > x.rclr <- decostand(testdata, method = "rclr")
  > x.clr.pseudo <- decostand(testdata, method = "clr", pseudocount = 1)
  > 
  > max(abs(x.clr - x.clr.pseudo)) < 1e-6
  [1] TRUE
  > max(abs(decostand(testdata + 1, method = "clr", pseudocount = 0) - x.clr.pseudo)) < 1e-6
  [1] TRUE
  > 
  > # Tests clr
  > alt.clr <- t(apply(as.matrix(relative.with.pseudo), 1, FUN = function(x){log(x) - mean(log(x))}))
  > max(abs(x.clr - alt.clr)) < 1e-6
  [1] TRUE
  > 
  > # Test that NAs are handled as expected in CLR
  > x <- testdata
  > set.seed(24)
  > x[sample(prod(dim(x)), 50)] <- NA # insert some NAs in the data
  > # NAs in the original data remain NAs in the returned data
  > all(is.na(decostand(x, "clr", na.rm = FALSE, pseudocount = 1)[is.na(x)])) == TRUE # NAs
  [1] TRUE
  > # For the other (non-NA) values, we get non-NA values back
  > any(is.na(decostand(x, "clr", na.rm = FALSE, pseudocount = 1)[!is.na(x)])) == FALSE
  [1] TRUE
  > any(is.na(decostand(x, "clr", MARGIN = 2, na.rm = FALSE, pseudocount = 1)[!is.na(x)])) == FALSE 
  [1] TRUE
  > # Results match for the non-NA values always (with tolerance 1e-6)
  > inds <- !is.na(x) # Non-NA values
  > max(abs(decostand(x, "clr", na.rm = FALSE, pseudocount = 1)[inds] -
  +         decostand(x, "clr", na.rm = TRUE, pseudocount = 1)[inds])) < 1e-6
  [1] TRUE
  Warning message:
  In .calc_clr(x, na.rm = na.rm, ...) :*** buffer overflow detected ***: terminated
  Aborted