Last updated: 2025-01-04
Checks: 2 0
Knit directory: R_tutorial/
This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version bbf9519. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for
the analysis have been committed to Git prior to generating the results
(you can use wflow_publish
or
wflow_git_commit
). workflowr only checks the R Markdown
file, but you know if there are other scripts or data files that it
depends on. Below is the status of the Git repository when the results
were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were
made to the R Markdown (analysis/Exercises.Rmd
) and HTML
(docs/Exercises.html
) files. If you’ve configured a remote
Git repository (see ?wflow_git_remote
), click on the
hyperlinks in the table below to view the files as they were in that
past version.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | bbf9519 | Ohm-Np | 2025-01-04 | wflow_publish("analysis/Exercises.Rmd") |
html | 827ac92 | Ohm-Np | 2025-01-03 | Build site. |
Rmd | 0cc3c9d | Ohm-Np | 2025-01-03 | wflow_publish("analysis/Exercises.Rmd") |
At the end of this tutorial, you should have a solid understanding of key geospatial operations in R, from handling vector and raster data to performing advanced spatial analyses. To ensure that you’ve mastered the concepts and are able to apply the techniques covered, let’s test your skills with the following practical exercises. These tasks will help you reinforce your understanding of spatial data manipulation, analysis, and visualization:
1. Subset the Kanchanpur district polygon and extract the region named “Mahendranagar”. Plot the subsetted region to visualize it.
2. Compute the area of the Mahendranagar region in square kilometers and explore its geographic size.
3. Calculate the perimeter of the Mahendranagar region, another key geometric property that provides insights into the shape of the region.
4. Analyze the change in population in the Mahendranagar region from the year 2000 to 2020 using zonal statistics and raster data. This will help you understand how to use raster data to compute statistical summaries over specific geographic areas.
5. Create a custom function that takes polygon and raster data, masks the raster to the polygon’s boundary, converts the masked raster to a data frame with coordinate columns, and returns a preview of the data frame.
6. Create a geospatial data frame consisting of five points (A, B, C, D, and E), and add a new column representing temperature values in Celsius.
7. Load ESA Land Cover data for 2015 and 2019, compute and visualize the change raster for the Mahendranagar region, and check the summary statistics to assess the changes in land cover over time.
8. Create a function named
get_popCount()
that takes the ISO3 country code
and year as arguments, and downloads the Population Count Raster from
the WorldPop Hub. Click here for the source
URL.
These exercises will provide you with hands-on practice in performing common geospatial operations in R, ensuring you’re well-prepared to handle spatial datasets and solve real-world geographic problems using R and its geospatial packages.
If you have any questions or encounter any difficulties while solving these exercises, feel free to visit my GitHub page and open an issue.