ruODK_usage_problem

Hi, everyone.
In order to retrieve through R the submissions of a given Central project, I intended to run the three following commands within R:

ru.setup<-ru_setup(
svc =paste0(
"https://odkcprojects.coliassocloudservers.com/v1/projects/2/",
"forms/EnqteSocioDadhesionAuxEaveTubes.svc"),un="altessedac@gmail.com",pw="mypword")

Step 2: List all submissions of form

sl <- submission_list(ru.setup)

Get submissions

subs <- submission_get(sl$instance_id)

But, after runing the sl command (second command), I got the message below:
"No encoding supplied: defaulting to UTF-8.
Error: Can't pluck from a externalptr"
I'm wondering what went wrong in my first two commands above?
Thanks in advance for your help.
Best,

Hi and thanks for giving ruODK a whirl!
The function submission_list does not take ru.setup as parameter.
You can see available parameters at ??submission_list.
Does that work?

Hi, @Florian_May
thanks for your advice.
I know run the following command
"
sl2 <- submission_list("https://odkcprojects.coliassocloudservers.com/v1/projects/2/",
"forms/EnqteSocioDadhesionAuxEaveTubes",un="altessedac@gmail.com",pw="mypword")
"
which does not work
It seems that I should set up ruODK through ru_setup();
vignette("setup", package = "ruODK") should help for that, but when I run this command, I receive the messsage "not available".
Can you please, share a commented working example?
Thanks in advance.
Best,

No worries.
You can run ??submission_list, which opens the reference for that function which is also online here.

You need to correctly specify project ID (an integer number), form ID (an alphanumeric string), server URL, UN and PW.
It looks like the first argument in your example is neither of those.
Also, always use named parameters, as in pid=2.

Does that help?

1 Like

@Florian_May,
thank you so much; it worked fine.
the result of submission_get() is of class "list"; but, I would like to get submissions in a dataframe (table) in order to directly manage them within R; how can I deal with that?
Best,

Great to hear it worked!
The latter is explained in great detail in the package vignettes.
There's also an Rmarkdown template which guides you step by step.

1 Like

Thanks, @Florian_May.
I will take a look at the package's vignettes.
Best,

1 Like