I like dplyr\'s \"progress_estimated\" function but I can\'t figure out how to get a progress bar to work inside a dplyr chain. I\'ve put a reproducible example with code at the
I dont really like my solution but it works.
print_tick_function <- function(x, p) {
p$tick()$print()
data.frame(x)
}
SunriseSet <- function(dataframe, timezone){
p <- progress_estimated(nrow(dataframe))
dataframe %>%
rowwise() %>%
do(print_tick_function(.,p)) %>%
mutate(
datetime = as.POSIXct(substr(cdatetime, 1, 20), tz = timezone),
sunrise = sunrise.set(latitude, longitude, datetime, timezone, num.days = 1)[1,1]
)
}
test2 <- SunriseSet(test, "CST6CDT")