inbo / iassetR

Interact with the iAsset api using R
https://inbo.github.io/iassetR/
Other
0 stars 1 forks source link

Convert data from answercode to answer #21

Closed SanderDevisscher closed 8 months ago

SanderDevisscher commented 9 months ago

Currently fields of fieldtype == "select" or "radio" (maybe also others) contain a code related to their answer in the output of get_records. It would be usefull to have the actual answers instead. The actual answers can be found in the "options" column of get_fields "fields" slot. There is no data column present to link the answer with the answer code.

Pay attention: the content of the column "fieldlabel" is not snakecase while the column names from get_records are! Pay attention: some select/radio columns from get_records are of class "list" these merit a different approach!

Some testing from myself: https://github.com/inbo/aspbo/blob/ae995deb42686abc644d6e02f290f78c4204d1d8/src/get_data_from_iAsset.Rmd#L27-L49

PietrH commented 9 months ago

In the future, if you want to do some experimentation, you can totally do that in a branch on this repo! That'll make it easier to transplant your code into the package :wink:

PietrH commented 9 months ago

Is this vital for our first version? I would maybe move this to the v0.1 milestone

SanderDevisscher commented 9 months ago

The tibble is content wise very unusable without :-/

PietrH commented 9 months ago

That is a pickle, alright, lets keep it in this milestone.

So perhaps this should have priority above the quality of life improvements on authentication?

Do you want to tackle this? Or do you want me to have a look at it?

SanderDevisscher commented 9 months ago

That is a pickle, alright, lets keep it in this milestone.

So perhaps this should have priority above the quality of life improvements on authentication?

Yes please

Do you want to tackle this? Or do you want me to have a look at it?

I can try but will probably loose a lot of time

PietrH commented 9 months ago

A note, the reason the fieldlabels have changed to snakecase is because I standardize them using janitor::clean_names() so they are easier to use in R. We could get rid of this, so they are exactly the same as they are in iAsset, or even make this transformation optional.

I personally don't like spaces or other weird characters in my column names, which is why I get rid of them early on.

PietrH commented 9 months ago

For aangeduide_bestrijder I have only one value; 2 and I see no place to recode it from. Any idea what this could mean? Are we not using this field?