Session Ready
Exercise

Converting sf objects to sp objects

In order to convert an sf object to an sp object (which has a Spatial class) you can use the as() function with Class = "Spatial". To convert back to sf you can use st_as_sf() and accept the defaults.

Instructions
100 XP
  • Read in the trees shapefile ("trees.shp").
  • Convert the sf object trees to an sp object (class Spatial) with as().
  • Use the class() function to confirm the conversion.
  • Convert your new Spatial object back to sf with st_as_sf()
  • Use the class() function to confirm the conversion.