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
Windows: Backslash (\) as path separator causes error. #1009
Comments
I think use |
@fereshtehRS What exactly was the error message? @shrektan It may be okay on Windows as long as you make the assumption that your app will never run on *nix. In general I'd suggest you avoid |
For this path: read.csv("C:\Users\fereshteh\Downloads\rock.csv") Error is:
For this path: read.csv("C:\Users\fereshteh\Downloads\rock.csv")
@yihui I agree that it is a good practice to use "/" instead of "". But we should at least detect and give a proper error and hint. |
@fereshtehRS, don't you need |
Exactly. This is a general R issue: when you need a literal backslash |
That is also the case for the first error. It happens that I think this is an FAQ of R itself. Windows may be constantly surprised by the fact that they need double backslashes in file paths. I'm not sure if we really need to address this issue in Shiny. |
Yeah, the garbled message is caused by the escaping. Unfortunately R error messages are not intuitive at all. I saw this user was totally lost when he got this error for his shiny app. Not sure what we can do about it; if nothing, then we can close this ticket. |
@yihui Ha, didn't notice that |
@fereshtehRS I completely agree this is fairly confusing to those who do not understand the escaping rules in R. It may be possible to detect such problems with a certain linter (https://github.com/rstudio/rsconnect/blob/master/R/linters.R), but I'm not the right person to decide if this is worth it (given it is not an issue specific to shiny) or work on it. |
@yihui I'll close this; agree that it is not a priority. |
Might be by design. But on Windows it is more intuitive to use "" as path separator.
The text was updated successfully, but these errors were encountered: