Publications by Harold Nelson
Making WA Land Cover
Make WA_lc Harold Nelson 11/12/2021 Make Land Cover for Washington State Setup library(raster) library(tmap) library(sf) library(tidyverse) load("counties_us.Rdata") Get NLCD nl = raster("nlcd_2019_land_cover_l48_20210604.img") tm_shape(nl) + tm_raster() ## stars_proxy object shown at 1243 by 805 cells. ## Warning: Duplicated levels found. T...
155 sym R (1006 sym/12 pcs) 3 img
OpenStreetMap
OpenStreetMap Harold Nelson 11/13/2021 Setup library(tidyverse) library(sf) library(tmap) library(tmaptools) library(OpenStreetMap) Data Source This a demonstration of the use of OpenStreetMap in combination with other data. It is based on transit stops in Washington.The transit stop data can be obtained at https://wsdot.wa.gov/mapsdata/produ...
469 sym R (1249 sym/7 pcs) 2 img
Getting DEM Data
Getting DEM Data Harold Nelson 11/14/2021 A Youtube Video First, watch this video. It’s not me! https://www.youtube.com/watch?v=yYWdxExabHo Here’s the link to my video walkthrough. https://www.youtube.com/watch?v=RD8ItZBLIvA Setup library(sf) library(raster) library(tmap) library(tmaptools) library(tidyverse) load("counties_us.Rdata") Re...
545 sym R (1896 sym/15 pcs) 6 img
Exercises on Functions
Exercises on Functions Harold Nelson 1/26/2022 Exercise 1 Create a function my_range() that returns the value of the range of a numeric vector. Solution my_range = function(x){ return(max(x) - min(x)) } rn = rnorm(1000) my_range(rn) ## [1] 5.724946 range(rn) ## [1] -2.797251 2.927695 Note that the built-in range() function does not do th...
1605 sym R (1187 sym/20 pcs)
Exercises on ggplot2
Exercises on ggplot2 Harold Nelson 2/5/2022 Setup Load the tidyverse and the dataset “county_clean.Rdata”. Import the file “state_region.csv” into the dataframe state_region. Solution library(tidyverse) load("county_clean.Rdata") state_region <- read_csv("state_region.csv") Data Do a glimpse of county_clean and state_region. Solutio...
1402 sym R (4427 sym/16 pcs) 8 img
Notes on 5 Named Graphs
The 5 Named Graphs Harold Nelson 1/30/2022 Setup library(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ── ## ✓ ggplot2 3.3.5 ✓ purrr 0.3.4 ## ✓ tibble 3.1.5 ✓ dplyr 1.0.7 ## ✓ tidyr 1.1.4 ...
1894 sym R (2921 sym/35 pcs) 15 img
Dplyr Exercises
Dplyr Exercises Harold Nelson 2/1/2022 Setup library(tidyverse) load("county.rda") load("cdc.Rdata") Exercise 1 Create a subset of cdc, cdc2 which contains only gender, height and weight. Use head() to look at it. Solution cdc2 = cdc %>% select(gender, height, weight) head(cdc2) ## gender height weight ## 1 m 70 175 ## 2 ...
2483 sym R (16343 sym/52 pcs)
Regression 2a
Regression 2 Harold Nelson 4/3/2022 Setup library(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ── ## ✓ ggplot2 3.3.5 ✓ purrr 0.3.4 ## ✓ tibble 3.1.5 ✓ dplyr 1.0.7 ## ✓ tidyr 1.1.4 ✓...
2208 sym R (4081 sym/27 pcs) 9 img
Regression 1
Regression 1 Harold Nelson 4/1//2022 Setup library(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ── ## ✓ ggplot2 3.3.5 ✓ purrr 0.3.4 ## ✓ tibble 3.1.5 ✓ dplyr 1.0.7 ## ✓ tidyr 1.1.4 �...
1631 sym R (5811 sym/26 pcs) 2 img
Twitter 4
Twitter 4 Harold Nelson 3/29/2022 Setup library(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ── ## ✓ ggplot2 3.3.5 ✓ purrr 0.3.4 ## ✓ tibble 3.1.5 ✓ dplyr 1.0.7 ## ✓ tidyr 1.1.4 ✓ s...
941 sym R (9292 sym/51 pcs) 3 img