Thanks to visit codestin.com
Credit goes to github.com

Skip to content

with_collate does not consider environment variable #179

@bersbersbers

Description

@bersbersbers

This is an offspring of r-lib/devtools#2377. Consider this example:

env -i LC_COLLATE=  R -q -e 'withr::with_collate("en_US", sort(c("_a", "a")))' # normal run
env -i LC_COLLATE=C R -q -e 'withr::with_collate("en_US", sort(c("_a", "a")))' # as run by R CMD check

On Linux, these two output different results:

> withr::with_collate("en_US", sort(c("_a", "a")))
[1] "_a" "a" 
> withr::with_collate("en_US", sort(c("_a", "a")))
[1] "a"  "_a"

Since the documentation of with_collate does not say anything about the need to take existing environment variables into account, I wonder if Sys.setenv should be added to ensure reproducibility regardless of environment variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions