Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems reading files with Windows path containing special characters #728

Open
jansunde opened this issue Apr 13, 2023 · 0 comments
Open

Comments

@jansunde
Copy link

Please briefly describe your problem and what output you expect. If you have a question, please don't use this form. Instead, ask on https://stackoverflow.com/ or https://community.rstudio.com/.

Please include a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.


Brief description of the problem
I have always read Excel files into RStudio using read_excel(). My data files are stored inside a company OneDrive account and the path includes the name of the company. The issue only appeared recently.

This is the error message I get:

Error in file.exists(path) :
file name conversion problem -- name too long?

I think the issue is that the company name contains an unusual character, the Norwegian character ("ø"). If I move the Excel file to another location, e.g. "C:/Users/jansun/test folder" it loads without any problem.
As soon as I add the "ø" character in the folder name, it returns the same error message.
The same applies to the other specifically Norwegian characters "æ" and "å".
I think the issue is related to R or Windows' handling of unusual characters, unfortunately I don't have a Mac or Linux install to test this hypothesis.

library(readxl)
colour <- read_excel(path = "C:/Users/jansun/OneDrive - Møreforsking AS/R/SAFERIMTA/data/Colour analysis SAFERIMTA.xlsx", 
                                        sheet = "til R")

Error message:
Error in file.exists(path) :
file name conversion problem -- name too long?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant