From 0396a45256168f6a2061b7046051fabe8bc8e041 Mon Sep 17 00:00:00 2001 From: Dr Rob Cooke <03rcooke@users.noreply.github.com> Date: Thu, 21 Mar 2024 15:44:42 +0000 Subject: [PATCH] fix session.info version error Fixes #258 --- R/occDetFunc.r | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/occDetFunc.r b/R/occDetFunc.r index a8eba0a..a9e9229 100644 --- a/R/occDetFunc.r +++ b/R/occDetFunc.r @@ -716,8 +716,8 @@ occDetFunc <- function (taxa_name, occDetdata, spp_vis, n_iterations = 5000, nyr # get the sessionInfo and coerce into a useable format session.info <- sessionInfo() - packages <- c(sapply(session.info[7][[1]], function(x) x$Version), - sapply(session.info[8][[1]], function(x) x$Version)) + packages <- c(sapply(session.info$otherPkgs, function(x) x$Version), + sapply(session.info$loadedOnly, function(x) x$Version)) MD <- list(method = 'sparta::occDetFunc', call = call <- match.call(), @@ -791,4 +791,4 @@ occDetFunc <- function (taxa_name, occDetdata, spp_vis, n_iterations = 5000, nyr if(write_results) save(out, file = file.path(output_dir, paste(taxa_name, ".rdata", sep = ""))) return(out) } - \ No newline at end of file +