@HanOostdijk, thank you for the suggestion. I don't know why, but it returns data.frame with just one raw and only first column has non-NA value (which was in English in original file). Without encoding = ...it loads everything.
file1 <- file("rates.csv", encoding="windows-1251")
rates <- read.csv(file1, skip=2, sep=";")
#> Warning in read.table(file = file, header = header, sep = sep, quote = quote, :
#> invalid input found on input connection 'rates.csv'
#> Warning in read.table(file = file, header = header, sep = sep, quote = quote, :
#> incomplete final line found by readTableHeader on 'rates.csv'
close(file1)
#> Error in close.connection(file1): invalid connection
I found different solution. Essentially convert values with iconv() after loading as is:
library(tidyverse)
rates <- read_delim("rates.csv", skip = 2, delim = ";")
rus_cols <- c(...)
rates <- rates %>%
mutate(across(all_of(rus_cols), ~iconv(.x, from="windows-1251", to = "UTF-8")))