I think they have changed the structure returned by sessionInfo() in more recent versions of R.
So the current code session.info <- sessionInfo() packages <- c(sapply(session.info[7][[1]], function(x) x$Version), sapply(session.info[8][[1]], function(x) x$Version)) returns the error Error in x$Version : $ operator is invalid for atomic vectors.
I think we need to be explicit with the objects within sessionInfo and that should help if they change the order. This code works and doesn't produce an error session.info <- sessionInfo() packages <- c(sapply(session.info$otherPkgs, function(x) x$Version), sapply(session.info$loadedOnly, function(x) x$Version))
Else we could use the base function, packageVersion("sparta")
This is relevant to code within
occDetFunc()
.I think they have changed the structure returned by sessionInfo() in more recent versions of R.
So the current code
session.info <- sessionInfo() packages <- c(sapply(session.info[7][[1]], function(x) x$Version), sapply(session.info[8][[1]], function(x) x$Version))
returns the errorError in x$Version : $ operator is invalid for atomic vectors
.I think we need to be explicit with the objects within sessionInfo and that should help if they change the order. This code works and doesn't produce an error
session.info <- sessionInfo() packages <- c(sapply(session.info$otherPkgs, function(x) x$Version), sapply(session.info$loadedOnly, function(x) x$Version))
Else we could use the base function,
packageVersion("sparta")