CorrelAid / restatis

R API Client for the German Federal Statistical Office Database
https://correlaid.github.io/restatis/
Other
22 stars 3 forks source link

gen_val2var: Output is limited to a maximum of 100 entries. #18

Closed dakilian closed 1 year ago

dakilian commented 1 year ago

Hi, Thanks a lot for the great package. I downloaded data with the gen_cube function and tried to get the corrsponding names of the variables with the gen_val2var function. Unfortunateley the output of gen_val2var is limited to 100 entries ( e.g. gen_val2var("WAM8") or gen_val2var("STLAH")). I could not find a option, to a) set the limit higher than 100, or b) limit the request so that less than 100 values are returend

Is there any option? What is the recommended procedure for adding variable labels to data cubes?

KovaZo commented 1 year ago

Hi,

Thank you for bringing this up. You can extend the output limit by manually increasing the "pagelength". e.g. gen_val2var("WAM8", pagelength = 200) This will increase the output to a maximum length of 200. The maximum length allowed is 2500.

If 2500 is not enough, you can get the data by sub-sampling certain parts of the values, in your case, by further specifying a "selection" criterion. e.g. gen_val2var("WAM8", pagelength = 2500, selection = "WA29*") This will increase the output to a maximum length of 2500 and restrict the query to those values that meet the criterion that their code starts with "WA29".

Do you think this solves your problem?

dakilian commented 1 year ago

Thank you very much. Perfect solution. I see that I should have added only one parameter of the GENESIS API call to the "..." argument. For beginners who are not familiar with the GENESIS API, it is difficult to find the parameters. It would be helpful to include such an example in the vignette and also to refer to the documentation at GENESIS (e.g. https://www-genesis.destatis.de/genesis/misc/GENESIS-Webservices_Einfuehrung.pdf ).