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

Optionally suppress name repair message in odata_submission_get #79

Closed dmenne closed 4 years ago

dmenne commented 4 years ago

It would be nice to be able to suppress the name-repair messages in odata_submission_get.

new names:
* `@odata.context` -> .odata.context
* `@odata.nextLink` -> .odata.nextLink

I tried .name_repair = ~ vctrs::vec_as_names(..., quiet = TRUE) documented for readxl, but this does not work here. Correct me when there is a dplyr setting to suppress this, I could not find one.

florianm commented 4 years ago

Edit after identifying the problem:

These messages come from a call to tibble::as_tibble() in odata_submission_rectangle which now is wrapped in a suppressMessages.

tidyr::unnest_wider indeed uses vec_as_names which unfortunately does not take the dots argument so you can't pass quiet=TRUE. Moreover, ruODK already suppresses messages (not errors) from tidyr::unnest_wider.

dmenne commented 4 years ago

Currently, I am using suppressMessages, but it is ugly because it hides other stuff.

But unnest_wider has names_repair options?

florianm commented 4 years ago

Found the squeaky bit - tibble::as_tibble needed a muffler. Does this address your suggestion?

dmenne commented 4 years ago

Cool ... as we Germans say.