session_info()
fails when info
is a character vector with length > 1
#96
Labels
bug
an unexpected problem or unintended behavior
tidy-dev-day 🤓
Tidyverse Developer Day rstd.io/tidy-dev-day
The
info
argument ofsession_info()
is supposed to be "auto", "all", or a character vector specifying which types of information to include.sessioninfo/R/session-info.R
Lines 28 to 35 in 064bc38
But it actually produces an error if called with a character vector with length greater than one. For example:
Created on 2024-02-22 with reprex v2.1.0
It's because of this
&&
in the if-statement in line 61.info != "auto"
andinfo != "all"
are vectors with the same length asinfo
, but the&&
operator doesn't accept vectors with more than one element.sessioninfo/R/session-info.R
Lines 59 to 72 in 064bc38
I'm not sure what the simplest/safest fix is... Some options:
if (!identical(info, "auto") & !identical(info, "all"))
works.if (length(info) == 1 && info != "auto" && info != "all")
also works, because then it only does the&&
if the length is one."any" %in% info
and"all" %in% info
cases first?The text was updated successfully, but these errors were encountered: