View source: R/odkc_svs_sve_as_wastd_surveys.R
| odkc_svs_sve_as_wastd_surveys | R Documentation | 
Reconstruct WAStD Surveys from ODKC Site Visit Start/End
odkc_svs_sve_as_wastd_surveys(svs, sve, user_mapping)
svs | 
 ODKC Site Visit Start, e.g.   | 
sve | 
 ODKC Site Visit End, e.g.   | 
Surveys are reconstructed from Site Visit Start records.
Survey end details are populated from Site Visit End records, where matching
by device_id, calendar_date_awst, and site_id.
Sources of error:
SVS forgotten to record
SVE forgotten to record
 SVS recorded outside known site boundaries (WAStD Area),
site_id mismatch, svs$site_id empty
 SVE recorded outside known site boundaries (WAStD Area),
site_id mismatch, sve$site_id empty
 Changed devices mid survey (device_id mismatch, likely reporter mismatch,
see end_comments)
Things to provide as QA reports outside this function:
Stray SVE without matching SVS
SVS joined to SVE only by device_id and calendar_date_awst minus "good" surveys (location out of bounds)
SVS joined to SVE only by calendar_date_awst and site_id minus "good" surveys (device swapped?)
A tibble in the correct format to upload as WAStD Surveys
## Not run: 
wastdr::wastdr_setup(
  api_url = Sys.getenv("WASTDR_API_DEV_URL"),
  api_token = Sys.getenv("WASTDR_API_DEV_TOKEN")
)
drake::loadd(odkc_ex)
drake::loadd(user_mapping)
x <- odkc_svs_sve_as_wastd_surveys(odkc_ex$svs, odkc_ex$sve, user_mapping)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.