title: From state and county names to fips in R
body: <p>I have the following data frame in R. I would like to get fips from this dataset. I tried to use <code>fips</code> function in <code>usmap</code> (<a href="https://rdrr.io/cran/usmap/man/fips.html" rel="nofollow noreferrer">https://rdrr.io/cran/usmap/man/fips.html</a>). But I could not get fips from this function because I need to enclose double quote. Then, I tried to use <code>paste0(""", df$state, """)</code>, but I could not get it. Is there any efficient ways to get fips?</p>
  
  <pre><code>&gt; df1
                     state           county
  1             california             napa
  2                florida       palm beach
  3                florida          collier
  4                florida            duval
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I can get <code>"\"california\""</code> by using <code>dQuote</code>. Thanks. After the conversion of each column, I tried the followings. How do I deal with this issue?</p>
  
  <pre><code>&gt; df1$state &lt;- dQuote(df1$state, FALSE)
  &gt; df1$county &lt;- dQuote(df1$county, FALSE)
  &gt; fips(state = df1$state, county = df1$county)
  Error in fips(state = df1$state, county = df1$county) : 
    `county` parameter cannot be used with multiple states.
  
  &gt; fips(state = df1$state[1], county = df1$county[1])
  Error in fips(state = df1$state[1], county = df1$county[1]) : 
    "napa" is not a valid county in "california".
  
  &gt; fips(state = "california", county = "napa")
  [1] "06055"
  </code></pre>