I have the following requirement in R script (to write a Expression function in Spotfire):
dateString <- \"04/30/2015 03/21/2015 06/28/2015 12/19/2015\"
s
Here's an alternative solution without additional packages.
First, represent strings as dates:
dates <- lapply(strsplit(dateString, " +")[[1L]], as.Date, "%m/%d/%Y")
start <- as.Date(startDate, "%m/%d/%Y")
end <- as.Date(endDate, "%m/%d/%Y")
Second, check whether the dates are between start and end:
sapply(dates, function(x) x >= start && x <= end)
# [1] TRUE FALSE TRUE FALSE