11.4 Random useful functions

11.4.1 Formatting for display

Code
str_to_title('hello there')
[1] "Hello There"

11.4.2 Identifying GEOIDs

Often we are interested in identify which census tract a location is in. Given lat/lon coordinates for a location, and shape files for census tracts, we can determine which census tract the location is in using point.in.polygon.

11.4.4 Holidays

Use timeDate::holiday to get the date of a holiday in a year.

Code
library(timeDate)
holiday(year = 2023, Holiday = "USThanksgivingDay") %>%
  as.Date()
[1] "2023-11-23"