I have the following data --
structure(list(k = structure(c(17563, 17591, 17622, 17652, 17683
), class = "Date"), startdt = structure(c(17532, 17561, 17589,
17620, 17650), class = "Date"), enddt = structure(c(17560, 17588,
17619, 17649, 17652), class = "Date")), row.names = c(NA, -5L
), class = c("grouped_df", "tbl_df", "tbl", "data.frame"), .Names = c("k",
"startdt", "enddt"), vars = "k", drop = TRUE, indices = list(
0L, 1L, 2L, 3L, 4L), group_sizes = c(1L, 1L, 1L, 1L, 1L),
biggest_group_size = 1L, labels = structure(list(
k = structure(c(17563, 17591, 17622, 17652, 17683), class = "Date")),
row.names = c(NA,
-5L), class = "data.frame", vars = "k", drop = TRUE, .Names = "k"))
and I want to pipe it into a function. here's how I would use map3, which does not exist (hooray) --
dates %>% map3_df(.x = $.k, .y = $.startdt, .z = $.enddt,
.f = ~ fetchdata(startdate = .z, enddate = .z, k = .x)
Pmap may be an option? i'm just not too familiar, and an issue seems to be that i can't assign variables explicitly (ie .x, .y, .z) and the function i want to map to takes a ton of optional variables (and i only want to specify startdate, enddt, and k).
Any help appreciated, thanks in advance.