Learn R Programming

nprcgenekeepr (version 1.0.5)

removeEarlyDates: removeEarlyDates removes dates before a specified year

Description

Dates before a specified year are set to NA. This is often used for dates formed from malformed character representations such as a date in

Usage

removeEarlyDates(dates, firstYear)

Arguments

dates

vector of dates

firstYear

integer value of first (earliest) year in the allowed date range.

Value

A vector of dates after the year indicated by the numeric value of firstYear.

Details

NA values are ignored and not changed.

Examples

Run this code
# NOT RUN {
dates <- structure(c(12361, 14400, 15413, NA, 11189, NA, 13224, 10971,
                     -432000, 13262), class = "Date")
cleanedDates <- removeEarlyDates(dates, firstYear = 1000)
dates
cleanedDates
# }

Run the code above in your browser using DataLab