+1 vote
in SoSci Survey (English) by s174567 (125 points)

hello,

I want to read a data record into R. I downloaded the script and the data set and got the following error message:
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : scan() expected 'a logical', got '3'

What should i do?
look for your help!

1 Answer

0 votes
by SoSci Survey (327k points)

This may be an issue with the file encoding that R uses for the import script.

First thing you may want to try is opening the script as UTF-8.

Second thing: The API import (that actually downloads the script from the server, and the script then tells R to download the data from the server) also often circumvents the issue: Click the button to enable the API download, then copy the one-liner into R/RStudio, then run the line.

by s174567 (125 points)
I tried... that shows the same errot.
by SoSci Survey (327k points)
Which of the both options did you try?
by s174567 (125 points)
both, but didn't work
by SoSci Survey (327k points)
The only thing I can offer, then, is taking a look at the data personally. If you would like me to download the data an look for the reason of the problem, please tell me the name of the survey. I can create an administrator login für the survey project then.
by s174567 (125 points)
I'd love to. The name is "Online food delivery services as a new form of distribution due to COVID-19 (OFDS)".
URL: https://www.soscisurvey.de/OFDS/
by s174567 (125 points)
hello,the problem has been solved. Thank you for your help.
by SoSci Survey (327k points)
Ahhm ... I did not do anything ... did not yet find the time. But if it's working now, that's great :)
by s174567 (125 points)
hhhh, I know. Somebody told me how to do, but also thank you.
by SoSci Survey (327k points)
Would you mind telling us the solution as well? Might well be that someone else steps over the same issue...
by s174567 (125 points)
"One of the columns that have been specified to be logical contains a 3. Try removing the colClasses= argument. Another thing to try is fread from data.table using no other arguments "  I removed the colClasses and worked:)
by SoSci Survey (327k points)
Interesting ... possibly a relict from a time when the question had a different question time. Good to know anyway, thank you!

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...