title: readr forcing column type
body: <p>I am trying to read in a CSV file - and am attempting to force the columns to be of a certain type. But the very last column gives me an error: &quot;Error in is.list(col_types) : Unknown shortcut: g&quot;</p>
  <p>Any advice, please? Thank you!</p>
  <pre><code>library(readr)
  
  # Create data frame &amp; write it out:
  temp &lt;- data.frame(a = 1:1001,
                     mystring_b = c(rep(NA, 1000), &quot;1&quot;),
                     mystring_c = c(rep(NA, 1000), &quot;2&quot;))
  write.csv(temp, &quot;temp.csv&quot;, row.names = F)
  
  # Grab its names:
  temp_labels &lt;- names(read_csv(&quot;temp.csv&quot;, n_max = 0))
  
  # Specify data type - for each column:
  labels_type &lt;- ifelse(grepl(&quot;mystring&quot;, temp_labels), &quot;numeric&quot;, &quot;guess&quot;)
  
  # Reading in while forcing column types:
  temp &lt;- read_csv(&quot;temp.csv&quot;, col_types = labels_type)
  
  # Error in is.list(col_types) : Unknown shortcut: g
  </code></pre>