Encoding problem in a file folder

Asked

Viewed 84 times

2

I switched computer today on the service and my codes stopped working, giving encoding error in the files folder:

> setwd("I:/AGG/01. DIGEP/Relatórios Gerenciais/Edição/2018-08-17")
> getwd()
[1] "I:/AGG/01. DIGEP/Relatórios Gerenciais/Edição/2018-08-17"
> listao <- read_csv2('listao.csv', locale = locale(encoding = 'latin1'), col_types = cols(.default = col_character())) %>% clean_names
Using ',' as decimal and '.' as grouping mark. Use read_delim() for more control.
Error in guess_header_(datasource, tokenizer, locale) : 
  Cannot read file I:/AGG/01. DIGEP/Relatórios Gerenciais/Edição/2018-08-17/listao.csv: O sistema não pode encontrar o caminho especificado.

Does anyone have any idea how to fix this? I know that without reproducible code it’s hard, but I don’t think I can reproduce that error on another computer.

  • Spin list.files("I:\\AGG\\01. DIGEP\\Relatórios Gerenciais\\Edição\\2018-08-17") and/or list.files("I:/AGG/01.\\ DIGEP/Relatórios\\ Gerenciais/Edição/2018-08-17") to check if the problem is in the encoding of accents or in spaces.

  • Only the first listed files, the second empty. From what I could see it is a read_csv2 (readr package) problem, as the other commands (read.csv2, for example) work. I had to go back to an older version of R.

  • I have just come across this package that may be useful to you: https://github.com/jennybc/here_here

1 answer

0

Try this:

arquivoDados <- 'I:\\AGG\\01. DIGEP\\Relatórios Gerenciais\\Edição\\2018-08-17\\listao.csv'
listao <- read_csv2(arquivoDados, ...
  • Keeps making the same mistake

Browser other questions tagged

You are not signed in. Login or sign up in order to post.