I am trying to create a sequence of dates from a raw string.
library(tidyverse)
tmp <- "1900-01-01 3000-01-01"
This yields a vector of length 2:
tmp %>% str_split(., " ", simplify = T) %>% as.vector() %>% as.Date
I need to create a sequence of dates based on the results of that pipe. My workflow demands use of the pipe operator.
tmp %>% str_split(., " ", simplify = T) %>% as.vector() %>% as.Date %>% seq(from = magrittr::extract(., 1), to = magrittr::extract(., 2), by = "1 day")
This implementation fails, and I'm unsure why. But I've also tried this, to no avail:
tmp %>% str_split(., " ", simplify = T) %>% as.vector() %>% as.Date %>% magrittr::extract(., 1):magrittr::extract(., 2)
Does seq()
not support piping? What am I missing?