Spatial Data Analysis Fundamentals
Instruction: Explain how to perform basic spatial data analysis in R, including working with spatial data types and visualizing geographic data.
Context: This question tests the candidate's skills in spatial data analysis, an increasingly important area in data science for geographic data interpretation.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
First identify whether the data is vector geometry—points, lines or polygons—or raster cells, and inspect its coordinate reference system, units, resolution and provenance. In R, sf supports vector workflows and terra supports raster workflows; choose tools compatible with the data and required operation.
For a store/service-area example, read vector files with sf::st_read, inspect geometry validity and CRS, and transform layers to a suitable common coordinate system with st_transform when...