ropensci / ruODK

ruODK: An R Client for the ODK Central API
https://docs.ropensci.org/ruODK/
GNU General Public License v3.0
42 stars 13 forks source link

form_detail documentation #74

Closed dmenne closed 4 years ago

dmenne commented 4 years ago
fl <- form_list()
get_default_fid()
# [1] "ScreeningBiologicals"
form_detail(get_default_pid())[,1:3] # works, note that I use pid!
# A tibble: 1 x 3
  name                 fid                  version               
  <chr>                <chr>                <chr>                 
1 ScreeningBiologicals ScreeningBiologicals vicPu2GpFeYYPzuNeVfB3R
As in documentation
# form_detail(fl$fid[[1]]) # fails

If you cannot reproduce this with your setup, I can give you a reprex with a private login to my data. Ask per email

florianm commented 4 years ago

The fid is a keyword argument, not a positional one. You can either specify the keyword parameter fid =, or if you want to skip naming your parameters, you'd have to supply all earlier keyword parameters (here: pid).

library(ruODK)
fl <- form_list()
my_pid <- get_default_pid()
py_fid <- fl$fid[[1]]

# With explicit keyword argument fid
form_detail(fid = my_fid)

# With implicit keyword argument sequence
form_detail(pid, fid)

# with explicit and complete keyword arguments - best practice
form_detail(pid = my_pid, fid = my_fid)

Closing, as this is not a bug if that's ok!

dmenne commented 4 years ago

Current Example

# The first form in the test project
f <- form_detail(fl$fid[[1]])

f <- form_detail(fid = fl$fid[[1]])

I should have noted it from the top, but I as everyone else look at examples first

florianm commented 4 years ago

Ah thanks, just found it, thanks, an update is on the way!