title: "non-numeric argument to binary operator" error when using tmap to plot sf data
body: <p>When I try to display point data using <code>tm_symbols</code>, I get the error message:
  <code>non-numeric argument to binary operator</code>.</p>
  
  <p>I have stripped my code back to try to pinpoint the problem, and of course I have searched the <code>tmap</code> and other documentation.</p>
  
  <p>Some links to other people doing something like what I am trying to do:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/a/45484314/5168907">https://stackoverflow.com/a/45484314/5168907</a></li>
  <li><a href="https://stackoverflow.com/a/52951856/5168907">https://stackoverflow.com/a/52951856/5168907</a></li>
  <li><a href="https://www.rdocumentation.org/packages/tmap/versions/2.2/topics/tm_symbols" rel="nofollow noreferrer">https://www.rdocumentation.org/packages/tmap/versions/2.2/topics/tm_symbols</a></li>
  </ul>
  
  <p>See also:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/q/48859637/5168907">line connecting label text and point in tmap plot</a></li>
  <li><a href="https://stackoverflow.com/a/48226819/5168907">https://stackoverflow.com/a/48226819/5168907</a></li>
  </ul>
  
  <p>Here's my reprex:</p>
  
  <pre><code>library(sf)
  library(tmap)
  library(leaflet)
  
  item_data &lt;- data.frame(
      name=c("Epping Forest District Citizens Advice (Epping)","Epping Forest District Citizens Advice (Loughton)","Epping Forest District Citizens Advice (Waltham Abbey)"),
      latitude=c("51.696921", "51.649158", "51.687181"),
      longitude=c("0.110474", "0.05899", "-0.004736"),
      stringsAsFactors = FALSE
  )
  items_sf &lt;- st_as_sf(item_data, coords=c("longitude", "latitude"), crs=3857)
  
  tmap_mode("view")
  epmap &lt;- tm_basemap(leaflet::providers$Stamen.TonerBackground) +
    tm_shape(items_sf, name="CA Locations") +
    tm_symbols(shape=21)
  epmap
  </code></pre>
  
  <p>This gives me:</p>
  
  <pre><code>## Error in b[3:4] - b[1:2] : non-numeric argument to binary operator
  </code></pre>
  
  <p>I'm trying to use <code>tmap</code> as I have seen it recommended, but I thought I'd also try different ways of generating the map instead... If I do:</p>
  
  <pre><code>plot(items_sf)
  </code></pre>
  
  <p>...it gives the error:</p>
  
  <pre><code>## Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] : non-numeric argument to binary operator
  </code></pre>
  
  <p>and if I do:</p>
  
  <pre><code>library(mapview)
  mapview(items_sf)
  </code></pre>
  
  <p>... I get a mapview with the three points plotted but at a scale of less than a metre, total extent, so the coords are not being processed as lat and lon for some reason.</p>
  
  <p>I am happy to work on solving problems but I think I am really stuck here because I have no idea what to do with these error messages.</p>
  
  <p>I am expecting a tmap plot of the three locations as points (dots/symbols) overlaid onto the basemap. Actual results: error messages and no map rendered.</p>
  
  <p>** Edit :
  well, the quoting numerics error was pretty stupid of me, good spot by the respondent. Caused by me typing out the data frame rather than simply copying from the one I was actually using.
  Once that was fixed I still had some other errors with my script but i got them fixed eventually.</p>
  
  <p>The projection/ESPG thing was helpful because I don't really understand those yet and was basically guessing what to do. So I learned something there, too. **</p>