title: Opening csv-file in R
body: <p>I want to read a csv-data record into R. I downloaded the script and the data set from SoSci Survey and got the following error message:</p>
  <blockquote>
  <p>Error in scan(file = file, what = what, sep = sep, quote = quote, dec
  = dec, : scan() expected 'a logical', got '3'</p>
  </blockquote>
  <p>in the script:</p>
  <pre><code>zh = read.table(
    file=zh_file, encoding=&quot;UTF-8&quot;,
    header = FALSE, sep = &quot;\t&quot;, quote = &quot;\&quot;&quot;,
    dec = &quot;.&quot;, row.names = &quot;CASE&quot;,
    col.names = c(
      &quot;CASE&quot;,&quot;SERIAL&quot;,&quot;REF&quot;,&quot;QUESTNNR&quot;,&quot;MODE&quot;,&quot;LANGUAGE&quot;,&quot;STARTED&quot;,&quot;ZH02&quot;,&quot;ZH03&quot;,
      &quot;ZH19&quot;,&quot;ZH19_03&quot;,&quot;ZH04&quot;,&quot;ZH05&quot;,&quot;ZH08_01&quot;,&quot;ZH08_02&quot;,&quot;ZH08_03&quot;,&quot;ZH08_04&quot;,
      &quot;ZH08_05&quot;,&quot;ZH08_06&quot;,&quot;ZH09_01&quot;,&quot;ZH09_02&quot;,&quot;ZH11_01&quot;,&quot;ZH11_02&quot;,&quot;ZH11_03&quot;,&quot;ZH11_04&quot;,
      &quot;ZH13_01&quot;,&quot;ZH13_02&quot;,&quot;ZH13_03&quot;,&quot;ZH13_04&quot;,&quot;ZH13_05&quot;,&quot;ZH14&quot;,&quot;ZH14_01&quot;,&quot;ZH14_02&quot;,
      &quot;ZH14_03&quot;,&quot;ZH14_04&quot;,&quot;ZH14_05&quot;,&quot;ZH14_06&quot;,&quot;ZH14_07&quot;,&quot;ZH14_09&quot;,&quot;ZH14_08&quot;,
      &quot;ZH14_08a&quot;,&quot;ZH15&quot;,&quot;ZH15_01&quot;,&quot;ZH15_02&quot;,&quot;ZH15_03&quot;,&quot;ZH15_04&quot;,&quot;ZH15_05&quot;,&quot;ZH15_06&quot;,
      &quot;ZH15_07&quot;,&quot;ZH15_08&quot;,&quot;ZH15_09&quot;,&quot;ZH15_09a&quot;,&quot;ZH16&quot;,&quot;ZH16_01&quot;,&quot;ZH16_02&quot;,&quot;ZH16_03&quot;,
      &quot;ZH16_04&quot;,&quot;ZH16_05&quot;,&quot;ZH16_06&quot;,&quot;ZH16_07&quot;,&quot;ZH16_08&quot;,&quot;ZH16_09&quot;,&quot;TIME001&quot;,&quot;TIME002&quot;,
      &quot;TIME003&quot;,&quot;TIME004&quot;,&quot;TIME005&quot;,&quot;TIME006&quot;,&quot;TIME007&quot;,&quot;TIME008&quot;,&quot;TIME009&quot;,&quot;TIME010&quot;,
      &quot;TIME011&quot;,&quot;TIME012&quot;,&quot;TIME013&quot;,&quot;TIME014&quot;,&quot;TIME015&quot;,&quot;TIME016&quot;,&quot;TIME017&quot;,
      &quot;TIME_SUM&quot;,&quot;MAILSENT&quot;,&quot;LASTDATA&quot;,&quot;FINISHED&quot;,&quot;Q_VIEWER&quot;,&quot;LASTPAGE&quot;,&quot;MAXPAGE&quot;,
      &quot;MISSING&quot;,&quot;MISSREL&quot;,&quot;TIME_RSI&quot;,&quot;DEG_TIME&quot;
    ),
    as.is = TRUE,
    colClasses = c(
      CASE=&quot;numeric&quot;, SERIAL=&quot;character&quot;, REF=&quot;character&quot;, QUESTNNR=&quot;character&quot;,
      MODE=&quot;character&quot;, LANGUAGE=&quot;character&quot;, STARTED=&quot;POSIXct&quot;, ZH02=&quot;numeric&quot;,
      ZH03=&quot;numeric&quot;, ZH19=&quot;numeric&quot;, ZH19_03=&quot;character&quot;, ZH04=&quot;numeric&quot;,
      ZH05=&quot;numeric&quot;, ZH08_01=&quot;numeric&quot;, ZH08_02=&quot;numeric&quot;, ZH08_03=&quot;numeric&quot;,
      ZH08_04=&quot;numeric&quot;, ZH08_05=&quot;numeric&quot;, ZH08_06=&quot;numeric&quot;, ZH09_01=&quot;numeric&quot;,
      ZH09_02=&quot;numeric&quot;, ZH11_01=&quot;numeric&quot;, ZH11_02=&quot;numeric&quot;, ZH11_03=&quot;numeric&quot;,
      ZH11_04=&quot;numeric&quot;, ZH13_01=&quot;numeric&quot;, ZH13_02=&quot;numeric&quot;, ZH13_03=&quot;numeric&quot;,
      ZH13_04=&quot;numeric&quot;, ZH13_05=&quot;numeric&quot;, ZH14=&quot;numeric&quot;, ZH14_01=&quot;logical&quot;,
      ZH14_02=&quot;logical&quot;, ZH14_03=&quot;logical&quot;, ZH14_04=&quot;logical&quot;, ZH14_05=&quot;logical&quot;,
      ZH14_06=&quot;logical&quot;, ZH14_07=&quot;logical&quot;, ZH14_09=&quot;logical&quot;, ZH14_08=&quot;logical&quot;,
      ZH14_08a=&quot;character&quot;, ZH15=&quot;numeric&quot;, ZH15_01=&quot;logical&quot;, ZH15_02=&quot;logical&quot;,
      ZH15_03=&quot;logical&quot;, ZH15_04=&quot;logical&quot;, ZH15_05=&quot;logical&quot;, ZH15_06=&quot;logical&quot;,
      ZH15_07=&quot;logical&quot;, ZH15_08=&quot;logical&quot;, ZH15_09=&quot;logical&quot;,
      ZH15_09a=&quot;character&quot;, ZH16=&quot;numeric&quot;, ZH16_01=&quot;logical&quot;, ZH16_02=&quot;logical&quot;,
      ZH16_03=&quot;logical&quot;, ZH16_04=&quot;logical&quot;, ZH16_05=&quot;logical&quot;, ZH16_06=&quot;logical&quot;,
      ZH16_07=&quot;logical&quot;, ZH16_08=&quot;logical&quot;, ZH16_09=&quot;logical&quot;, TIME001=&quot;integer&quot;,
      TIME002=&quot;integer&quot;, TIME003=&quot;integer&quot;, TIME004=&quot;integer&quot;, TIME005=&quot;integer&quot;,
      TIME006=&quot;integer&quot;, TIME007=&quot;integer&quot;, TIME008=&quot;integer&quot;, TIME009=&quot;integer&quot;,
      TIME010=&quot;integer&quot;, TIME011=&quot;integer&quot;, TIME012=&quot;integer&quot;, TIME013=&quot;integer&quot;,
      TIME014=&quot;integer&quot;, TIME015=&quot;integer&quot;, TIME016=&quot;integer&quot;, TIME017=&quot;integer&quot;,
      TIME_SUM=&quot;integer&quot;, MAILSENT=&quot;POSIXct&quot;, LASTDATA=&quot;POSIXct&quot;,
      FINISHED=&quot;logical&quot;, Q_VIEWER=&quot;logical&quot;, LASTPAGE=&quot;numeric&quot;,
      MAXPAGE=&quot;numeric&quot;, MISSING=&quot;numeric&quot;, MISSREL=&quot;numeric&quot;, TIME_RSI=&quot;numeric&quot;,
      DEG_TIME=&quot;numeric&quot;
    ),
    skip = 1,
    check.names = TRUE, fill = TRUE,
    strip.white = FALSE, blank.lines.skip = TRUE,
    comment.char = &quot;&quot;,
    na.strings = &quot;&quot;
  )
  </code></pre>
  <p>What should I do?<br />
  Looking for help!</p>