return a Year column containing the earliest year from the available 'date' fields.
Source:R/metadata_cleanup_tools.R
extract_earliest_year.Rd
return a Year column containing the earliest year from the available 'date' fields.
Examples
extract_earliest_year(klebsiella_example_dat)
#> Warning: There was 1 warning in `dplyr::mutate()`.
#> ℹ In argument: `year = base::as.numeric(...)`.
#> Caused by warning:
#> ! NAs introduced by coercion
#> # A tibble: 200 × 2
#> target_acc Year
#> <chr> <dbl>
#> 1 PDT000030652.1 2013
#> 2 PDT000031665.1 2013
#> 3 PDT000031688.1 2013
#> 4 PDT000031691.1 2013
#> 5 PDT000061807.1 2014
#> 6 PDT000065089.4 2014
#> 7 PDT000077413.3 2015
#> 8 PDT000086702.1 2014
#> 9 PDT000128121.2 2015
#> 10 PDT000130459.2 2011
#> # ℹ 190 more rows