How to solve the error related to UTF-8 characters on new Lenovo (Windows 11 - R version 4.3.1)

115 Views Asked by At

I am obtaining an error which I do not how to solve

Error in `mutate()`:
i In argument: `term = stringr::str_trim(term)`.
Caused by error in `stri_trim_both()`:
! invalid UTF-8 byte sequence detected; try calling stri_enc_toutf8()
Run `rlang::last_trace()` to see where the error occurred.

The code I have written down uses the tidy() function on a series of models with polish character. To enable the reading of those characters I have used the following code

Sys.setlocale(category = "LC_ALL", locale = "Polish")

and then:

list_of_fitting[['anova']] = lapply(list_of_fitting[['anova']], function(x) 
  lapply(x, function(y) tidy(y) %>% mutate(term = str_replace_all(
    term, c('rsptsk'='Taskresp','Płeć'='Gender', ":" = "*")))))

Can anyone suggest something? Specifically since on my last PC (having Windows 10 an operative system and R version 4.1.1, downloaded both as 32 or 64 bits, while here I have just the one with 64 bits) do you possibly think that it is due on the lack of this 32 bits version? Has anyone did something else on Windows 11?

Thanks

0

There are 0 best solutions below