fetch_refreshed_data: Fetch a surveygizmo csv datadump, while making sure the...

Description Usage Arguments Value Examples

View source: R/fetch_refreshed_data.R

Description

A surveygizmo data dump can be refreshed by appending &realtime=TRUE, however, when such a method is used the refresh is usually slow, and reading the file while it is being refreshed might lead to partial results. The function uses deliberate pauses (waiting times) between reading attemps. It continues to read the file as long as it is still being updated, in order to return the most updated version. This function should work as long as the waiting time is long enough and that the file is no longer than 10k lines. The 10k lines is a surveygizmo limitation (the &realtime=true works under 10k lines). #'

Usage

1
fetch_refreshed_data(link_str, wait = 5, ...)

Arguments

link_str

The link to the data dump

wait

The waiting time between successive reading attempts

...

Additional arguments to pass to read_csv

Value

A tibble with the file's contents.

Examples

1
file_results <- fetch_refreshed_data("LINK_TO_FILE", wait = 5, ...)

sarid-ins/saridr documentation built on Nov. 10, 2020, 9:07 p.m.