title: 'st_intersects' applied to an object of class "data.frame"
body: <p>I am trying to convert latitude/longitude to Census Tract or FIPS using R studio. I am getting the following error message when I am running &quot;system.time&quot;</p>
  <p>&quot;Error in UseMethod(&quot;st_intersects&quot;) :
  no applicable method for 'st_intersects' applied to an object of class &quot;data.frame&quot;
  Timing stopped at: 0 0 0&quot;</p>
  <p>Entire Code:</p>
  <pre><code>library(sf)
  
  list.files(&quot;./tl_2010_22_tract10&quot;)
  
  census_tracts &lt;- st_read(&quot;./tl_2010_22_tract10/tl_2010_22_tract10.shp&quot;)
  
  head(census_tracts)
  
  
  library(readxl)
  
  DAT &lt;- read_excel(&quot;~/DAT.xlsx&quot;)
  
  View(DAT)
  
  latlong_dat = data.frame(DAT)
  
  
  
  latlong_sf &lt;- latlong_dat 
  filter(!is.na(LAT), !is.na(LONG)) 
  st_as_sf(latlong_dat, coords = c(&quot;LONG&quot;, &quot;LAT&quot;), crs = 
  st_crs(census_tracts))
  
  head(latlong_dat)
  
  
  system.time({intersected &lt;- st_intersects(latlong_sf, census_tracts)})
  </code></pre>
  <p><a href="https://i.stack.imgur.com/d0XgV.png" rel="nofollow noreferrer">Screenshot of code</a></p>
  <p><a href="https://i.stack.imgur.com/ppJna.png" rel="nofollow noreferrer">DAT FILE</a></p>