1

Pick a city of the world to your liking and retrieve its bounding box. Then plot it: What do you see?
The function you may search for is part of the data package. Have a look at the slides.

2

Please choose a couple of building types you are interested in and set them as key and value pairs. You can find a list of building types in the Overpass API documentation. But don’t forget to set the timeout query parameters using the osmdata::opq() function first.
First, specify the bounding box like before; second, the query parameters; and third, the key and value pairs. Try using a pipe workflow, as it makes it easier.

3

Download the data using the osmadata::osmdata_sf() function and extract only the polygons.
The downloaded data is a list. The polygons are a named list element that you can extract with its name osm_polygons, just like a variable in a data table.

4

Take some time to browse through the data. Depending on your chosen building type, you may find some interesting information. You can also plot the data you have just downloaded.
You may consider converting the data into a tibble using tibble::as_tibble() and maybe a sf::st_as_sf() afterward for a nicer browsing experience.