library(dplyr)
library(lubridate)
# Sample data on a copy/paste friendly format
file <- data.frame(
year = c(188001, 188002, 188003, 188004, 188005)
)
file %>%
mutate(year = ymd(paste0(year, "01"))) %>%
as_tibble() # Just to show the column class
#> # A tibble: 5 x 1
#> year
#> <date>
#> 1 1880-01-01
#> 2 1880-02-01
#> 3 1880-03-01
#> 4 1880-04-01
#> 5 1880-05-01