find.dates: find.dates

Description Usage Arguments Value

Description

Will parse query text and returns base on return.place. If true function returns a vector of the available dates in a query. If false, returns a vector of the logical position of dates in the vector created by query.split.

Usage

1
2
3
find.dates(text, return.place = F,
  date.reg = "\\d+[/-]\\d+[/-]\\d+", text.split = function(x) x
  %>% as.character %>% strsplit(" ") %>% unlist)

Arguments

text

- query as a single character string

return.place

- switch for showing date values, or date locations

date.reg

- The regular expression for the date string. Allows the user to change to match different formatting, if necessary.

Value

If return.place = F, function returns a string of booleans, one for each word in the query, where T indicates that the string is coded as a date. If return.place = T, the function returns a vector of each date string coded into the query.


christiantillich/AnaliTools documentation built on May 13, 2019, 6:59 p.m.