R CMD error fails, devtools :: test () is working fine

Sometimes the R CMD check fails when all of your test runs run normally when you start manually (or using devtools :: test ()).

I ran into one of these problems when I wanted to compare download results using a boot package. I entered a rabbit hole looking for problems caused by parallel computing (performed by boot) and random number generators (RNG).

All these are not answers.

+3
source share
1 answer

In the end, the problem was trivial. I used base :: sort () to create factor levels. (To ensure that they will always be aligned, even if the data was in a different order)

, . R CMD , .

: R : LC_COLLATE = en_US.UTF-8; R CMD : LC_COLLATE = C;

:: sort :

Except for method ‘"radix"’, the sort order for character vectors
will depend on the collating sequence of the locale in use: 
see ‘Comparison’.  The sort order for factors is the order of their 
levels (which is particularly appropriate for ordered factors).

, .

.

+5

Source: https://habr.com/ru/post/1686092/


All Articles