[1] "Welcome to R Coding Workshop!"
sfPPOL 6805: GIS for Spatial Data Science
2026-09-11
print() and comment out⌘ + /: Commenting<-: initialize a variable and assign a value
class()[1] "Bryce Canyon"
[1] "Canyonlands" "Arches" "Zion" "Capitol Reef"
data.frame as a collection of column vectorsWays to create a df
| mth | mth_str |
|---|---|
| 1 | Jan |
| 2 | Feb |
| 3 | Mar |
| 4 | Apr |
| 5 | May |
| 6 | Jun |
| 7 | Jul |
| 8 | Aug |
| 9 | Sep |
| 10 | Oct |
| 11 | Nov |
| 12 | Dec |
data.frame attributes| national_park | lat | lon |
|---|---|---|
| Bryce Canyon | 37.64062 | -112.1696 |
| Canyonlands | 38.47878 | -109.8252 |
data.frame[1] "Bryce Canyon" "Canyonlands" "Arches" "Zion" "Capitol Reef"
national_park lat lon
1 Bryce Canyon 37.64062 -112.1696
[1] "Bryce Canyon" "Canyonlands" "Arches" "Zion" "Capitol Reef"
[1] "Bryce Canyon" "Canyonlands" "Arches" "Zion" "Capitol Reef"
national_park lat lon
Length:5 Min. :37.20 Min. :-113.0
Class :character 1st Qu.:37.64 1st Qu.:-112.2
Mode :character Median :38.29 Median :-111.3
Mean :38.05 Mean :-111.2
3rd Qu.:38.48 3rd Qu.:-109.8
Max. :38.62 Max. :-109.6

sf and a map| national_park | geometry |
|---|---|
| Bryce Canyon | POINT (-112.1696 37.64062) |
| Canyonlands | POINT (-109.8252 38.47878) |
| Arches | POINT (-109.6198 38.61676) |
| Zion | POINT (-112.987 37.20027) |
| Capitol Reef | POINT (-111.2619 38.2916) |
factor class: How were the points colored? Why are we having a legend on the map?