title: reduce number of points of a geometry of sf object in R
body: <p>I am facing the following problem:</p>
  <p>when using the shape file of intercommunal limits in France (which you can download here: <a href="https://www.data.gouv.fr/fr/datasets/r/971027a8-3ceb-48c6-97e3-59deaf7e2704" rel="nofollow noreferrer">https://www.data.gouv.fr/fr/datasets/r/971027a8-3ceb-48c6-97e3-59deaf7e2704</a>), plotting the map is really slow:</p>
  <pre><code>library(sf)
  library(ggplot2)
  
  epci_france &lt;- read_sf(&quot;./epci_shape/EPCI_SHAPEFILE.shp&quot;)
  
  ggplot()+
    geom_sf(data = test,
            aes(geometry = geometry),
            color = &quot;black&quot;)+
    guides(fill = &quot;none&quot;)+
    theme_void()
  </code></pre>
  <p>I think this is due to the high number of points in the shapefile.</p>
  <p>Following comments in here: <a href="https://github.com/tidyverse/ggplot2/issues/2655" rel="nofollow noreferrer">https://github.com/tidyverse/ggplot2/issues/2655</a>, I tried</p>
  <pre><code>sum(rapply(st_geometry(epci_france), nrow))
  [1] 1913182
  </code></pre>
  <p>which looks like a lot of points. I am looking for a way to lower this number, i.e. lower the precision of the limits of the geometry. I tried <code>smooth</code> from <code>library(smoothr)</code>, but it has the opposite effect: it increases the number of points. I tried to cast it to other formats with <code>st_cast</code>, but it did not work either.</p>
  <p>How should I proceed? My objective is to have a simple delimitation of the intercommunal limits to make choropleth maps. Thanks!</p>