Malone Telegram | Moose census estimates about 400 in park
"BOLTON β Three men are in a helicopter, approaching a running moose."
Why ads? π€ / Privacy Policy π³
"BOLTON β Three men are in a helicopter, approaching a running moose."
Why choose when you can have it all? Seriously, QGIS makes it easy to move labels as you like and do the styling of the Shapefile or GeoPackage you generate in R with tidycensus and sf.
library(tidycensus)
library(sf)
lowincome <- get_acs(
geography = “state”,
table = ‘B19001’,
year = 2020,
output = ‘wide’,
survey = “acs5”,
geometry = TRUE);
lowincome$under30k <- ((lowincome$B19001_002E +lowincome$B19001_003E+ lowincome$B19001_004E+ lowincome$B19001_005E+ lowincome$B19001_006E) /lowincome$B19001_001E)*100
lowincome %>% write_sf(‘/tmp/under30k.gpkg’)
With the above R code, it will generate a GeoPackage (use extension .gpkg) or Shapefile (use extension .shp) you can use to make your map in QGIS. Then in QGIS if you want to simplify the output, you can use a geometry generator in the styles:
simplify($geometry,0.003)
Or you can specify the simplification in the R script when you run get_acs(), as it is a wrapper around the tigris package:
lowincome <- get_acs(
geography = “state”,
table = ‘B19001’,
year = 2020,
output = ‘wide’,
survey = “acs5”,
geometry = TRUE,
resolution = ’20m’,
);
Neat ! R and QGIS are great tool to use together.
You can do IDW interpolation of missing Census Tracts fairly easily in R using the gstat library. The key is to make sure you use a projected dataset. Other interpolation methods are covered here: https://rspatial.org/raster/analysis/4-interpolation.html
library(tidycensus)
library(tidyverse)
library(raster)
library(gstat)
# obtain census data on veteran status by tract and then
# reproject the shapefile geometery into a projected coordinate system
acs <- get_acs("tract",
state='ny',
survey='acs5',
var=
c('Total'='B21001_001',
'Veteran'='B21001_002'
),
cache_table = T,
geometry = T,
resolution='20m',
year = 2020,
output = "wide"
) %>% st_transform(26918)
# calculate the percentage of veterans per census tract
acs <- mutate(acs, vet_per = VeteranE/TotalE)
# create a copy of census tracts, dropping any NA values
# from vet_per field
vetNA <- acs %>% drop_na(vet_per)
# a raster should be created to do interpolation into
r <- raster(vetNA, res=1000)
# set the foruma based on field (vet_per) that contains
# the veterans percent to interpolate. This use IDW interpolation
# for all points, weighting farther ones less
gs <- gstat(formula = vet_per~1, locations = vetNA)
# interpolate the data (average based on nearby points)
nn <- interpolate(r, gs)
# extract the median value of the raster interpolation from the original shapefile,
# into a new column set as est
acs<- cbind(acs, est=exactextractr::exact_extract(nn, acs, fun='median'))
# replace any NA values with interpolated data so the map doesn't contain
# holes. You should probably mention that missing data was interpolated when
# sharing your map.
acs <- acs %>% mutate(vet_per = ifelse(is.na(vet_per), est, vet_per))
For the 2010 Census, an urban area will comprise a densely settled core of census tracts and/or census blocks that meet minimum population density requirements, along with adjacent territory containing non-residential urban land uses as well as territory with low population density included to link outlying densely settled territory with the densely settled core. To qualify as an urban area, the territory identified according to criteria must encompass at least 2,500 people, at least 1,500 of which reside outside institutional group quarters.
The Census Bureau identifies two types of urban areas:
Urbanized Areas (UAs) of 50,000 or more people;
Urban Clusters (UCs) of at least 2,500 and less than 50,000 people.
“Rural” encompasses all population, housing, and territory not included within an urban area.
2020 Urban - Rural areas will be released December 2022.
I was a bit surprised to see that there isn't a stronger correlation between population density and the percent of the population that rents. But maybe it's because often Census Tracts contains things besides residential properties like roads, parks, and businesses.
New York State was one of the last states in the northeast to eliminate slavery. You can see slave counts from the 1790 Census, and the density of slavery in the state during that year. Learn more about the history of slavery in New York State: https://en.m.wikipedia.org/wiki/History_of_slavery_in_New_York_(state)