export_data: export_data

Description Usage Arguments Value Examples

View source: R/export_data.R

Description

Export data in CSV format from local ODK Briefcase Storage directory to a specified destination directory and a specified file name

Usage

1
2
3
export_data(target = "", briefcase = "odkBriefcase_latest", id, from = "",
  to = "", filename = paste(id, "_data.csv", sep = ""), start = NULL,
  end = NULL, overwrite = FALSE, exclude = TRUE)

Arguments

target

Path to directory of ODK Briefcase .jar file. Directory path should match directory path used when calling get_briefcase(). If ODK Briefcase .jar file was downloaded manually from https://opendatakit.org, target should match the directory path where .jar file has been downloaded into.

briefcase

Filename of the downloaded ODK Briefcase .jar file. Default is odkBriefcase_latest to match the default filename used by get_briefcase(). If ODK Briefcase .jar file was downloaded manually from https://opendatakit.org, filename should match the default filename used by Open Data Kit which is usually "ODK Briefcase vX.Y.Z Production.jar" where vX.Y.Z is the version number

id

Form ID of form to be pulled

from

Path to source ODK Briefcase Storage from which to extract data. This should match directory path specified when making a call to pull_remote() or pull_local()

to

Destination directory to save output data file

filename

Filename of output CSV data; default is paste(id, "_data.csv", sep = "")

start

Include data from submission dates after (inclusive) this start date in export to CSV; format <yyyy/MM/dd>

end

Include data from submission dates before (exclusive) this date in export to CSV; format <yyyy/MM/dd>

overwrite

Overwrite existing output data in destination directory with the same filename; default is FALSE

exclude

Exclude media files on export; default is TRUE

Value

CSV file in destination directory containing data from the pulled forms

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Export data from a specified ODK Briefcase Storage directory to current
# working directory with a filename called "test.csv"
## Not run: 
  dirPath <- tempdir()
  get_briefcase(destination = dirPath)
  export_data(target = dirPath,
              from = dirPath,
              to = dirPath,
              id = "stakeholders",
              filename = "test.csv",
              overwrite = TRUE)

## End(Not run)

odkr documentation built on Feb. 11, 2018, 3:10 p.m.