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

File encoding doesn't work for some computers #5

Open
grace-hansen opened this issue Sep 4, 2018 · 3 comments
Open

File encoding doesn't work for some computers #5

grace-hansen opened this issue Sep 4, 2018 · 3 comments

Comments

@grace-hansen
Copy link

Describe the bug
On keyboards set to a non-English setting, e.g. for Mandarin speaking users, files will be encoded with ASCII, which throws errors unless explicitly stated on some R commands.

To Reproduce
papers <- read.csv("~/BSD-QBio4/tutorials/basic_computing_2/data/citations/nature_neuroscience.csv", stringsAsFactors = FALSE)
papers$TitleLength <- nchar(papers$Title)
Error at [something]:
invalid multibyte string at [something]

FIX:
read csv with explicit file encoding, e.g.
papers <- read.csv("~/BSD-QBio4/tutorials/basic_computing_2/data/citations/nature_neuroscience.csv", stringsAsFactors = FALSE,fileEncoding='ASCII')

@pcarbo
Copy link
Collaborator

pcarbo commented Sep 5, 2018

@gracilis Thanks for sharing. I see that the file is encoded in UTF-8 because it has some non-ASCII characters. Perhaps in the future it would be simpler to remove (or replace) the non-ASCII characters from this file so that it is less likely to cause issues.

Can you please send us output from running sessionInfo()? In particular, I would be interested to find out what your locale setting is.

@grace-hansen
Copy link
Author

grace-hansen commented Sep 5, 2018 via email

@pcarbo
Copy link
Collaborator

pcarbo commented Sep 5, 2018

@gracilis I will need the sessionInfo() from one the students experiencing the error.

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

2 participants