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


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 (315k 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 SoSci Survey (315k 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 (315k 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 (315k 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