Banding Variable in R

For the following code: x <- data.frame(year = c(1730, 1860, 1941, 2011)) century_bands <- data.frame(min_year = c(1700, 1800, 1900, 2000), max_year = c(1799, 1899, 1999, 2099), century_name = c(“18th”, “19th”, “20th”, “21st”)) I’d like, for each value in x, to work out the name of the century it falls into, using the information in century_bands.…

Details