kobo_media_downloader: Downloads media data from Kobotoolbox

View source: R/Koboconnect.R

kobo_media_downloaderR Documentation

Downloads media data from Kobotoolbox

Description

'kobo_media_downloader' downloads media from data downloaded using 'kobo_df_download'. Loops through media columns and downloads files individually.

Usage

kobo_media_downloader(
  url = "eu.kobotoolbox.org",
  uname,
  pwd,
  assetid,
  fsep = ";",
  sleep = 2,
  identifier = "URL",
  timeoutval = 300,
  destfolder = "media"
)

Arguments

url

The '[url]' of kobotoolbox Default is "eu.kobotoolbox.org".

uname

is username of your kobotoolbox account

pwd

is the password of the account

assetid

is the id of the asset for which the export is to be created

fsep

is the separator of the downloaded csv file. In most of the cases, it is ";", which is the default. However,

sleep

is the sleep time between API actions. For example, it takes time to download an export. But R does not wait for the download to finish before going to next step. Hence the need to provide a break between consecutive API actions. Default value is 2 (seconds).

identifier

is the key using with the columns with URL is identified. Default value is "URL" because in most of the cases, the columns containing the URL values end with "URL". Please note that any other column name with similar value may cause error.

timeoutval

is the timeout value in seconds to download the media files. Default is 300 seconds.

destfolder

is the folder where the media is to be stored.

Details

The function creates an export of survey data in 'csv'. If successful, it attempts to download the data and and returns a data frame. From that data frame, the function extracts the URLs of media and attempts to download them.

Value

The function returns a data frame of data downloaded from 'Kobotoolbox'.


KoboconnectR documentation built on Sept. 11, 2024, 8:07 p.m.