In the following R code chunk, load_packages is the code chunk name. include=FALSE suggests that the code chunk will run, but the code itself and its outputs will not be included in the rendered HTML. echo=TRUE in the following code chunk suggests that the code and results from running the code will be included in the rendered HTML.
R Spatial Lab Assignment # 3
task 1:
Code
acsdata <-st_read("acsPopByZip.gpkg")
Reading layer `NYC_COVID_Pop_by_Zip' from data source
`C:\Users\Antonio\Documents\Week9\acsPopByZip.gpkg' using driver `GPKG'
Simple feature collection with 180 features and 13 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 913129 ymin: 120020.9 xmax: 1067113 ymax: 272710.9
Projected CRS: NAD83 / New York Long Island (ftUS)
ℹ tmap modes "plot" - "view"
ℹ toggle with `tmap::ttm()`
Code
q3_map <-tm_shape(acsdata_q1, name ="Covid Data") +tm_polygons("positive_cat", style="quantile", title="COVID Cases by Zip Code", palette="RdPu") +tm_shape(acsdata_q1pt2, name ="Elderly Population") +tm_polygons("elderly_cat", style="quantile",title="Elderly Population by Zip Code", palette="RdPu") +tm_shape(acsdataq3, name="Hispanic Population") +tm_polygons("hisp_cat",style="quantile", title="Hispanic Population by Zip Code", palette="RdPu")
── tmap v3 code detected ───────────────────────────────────────────────────────
[v3->v4] `tm_polygons()`: instead of `style = "quantile"`, use fill.scale =
`tm_scale_intervals()`.
ℹ Migrate the argument(s) 'style', 'palette' (rename to 'values') to
'tm_scale_intervals(<HERE>)'[v3->v4] `tm_polygons()`: migrate the argument(s) related to the legend of the
visual variable `fill` namely 'title' to 'fill.legend = tm_legend(<HERE>)'[v3->v4] `tm_polygons()`: migrate the argument(s) related to the legend of the
visual variable `fill` namely 'title' to 'fill.legend = tm_legend(<HERE>)'[v3->v4] `tm_polygons()`: migrate the argument(s) related to the legend of the
visual variable `fill` namely 'title' to 'fill.legend = tm_legend(<HERE>)'
Code
q3_map
[cols4all] color palettes: use palettes from the R package cols4all. Run
`cols4all::c4a_gui()` to explore them. The old palette name "RdPu" is named
"brewer.rd_pu"
Multiple palettes called "rd_pu" found: "brewer.rd_pu", "matplotlib.rd_pu". The first one, "brewer.rd_pu", is returned.
Multiple palettes called "rd_pu" found: "brewer.rd_pu", "matplotlib.rd_pu". The first one, "brewer.rd_pu", is returned.
Multiple palettes called "rd_pu" found: "brewer.rd_pu", "matplotlib.rd_pu". The first one, "brewer.rd_pu", is returned.