IDEMSInternational / R-Instat

A statistics software package powered by R
http://r-instat.org/
GNU General Public License v3.0
38 stars 102 forks source link

Factor keyboard for the calculator #5504

Closed rdstern closed 4 years ago

rdstern commented 5 years ago

This is such a good idea that I am boldly suggesting it for Version 0.5.4, i.e. even by the time of the Cameroon AIMS course - though it certainly isn't vital! I am also suggesting @Wycklife, because he has become expert in adding keyboards to the calculator. But he may prefer different tasks? In which case he could support whoever does the work. We have a dates keyboard and a character keyboard. I propose a factor keyboard be added. I suggest it should go after Summary and before Strings (Character). It should then go through the forcats package and will provide some very nice features. Eventually we should also adapt the factor menu, but this should be quite quick and could be extremely useful. Here is my proposed keyboard:

factor, anon, concat, collapse cross, drop, expand, add_na inorder, infreq, innum, lump match, other, recode, relevel reorder, reverse, shift, shuffle

This omits count, related, unify, and unique that don't (I think) return a single variable - at least of the right length.

Wycklife commented 4 years ago

@rdstern I'm almost through with this issue, just a quick observation is that am not able to get the documentation for the following; forcats::fct_add_na() forcats::fct_innum() I therefore, need your help.

rdstern commented 4 years ago

@Wycklife that's because I wasn't at all clear, when making the keys! Great that you have already made progress. I suggested add_na() for the keyboard, because the function is forcats::fct_explicit_na() is a bit long to go on the key. If explicit_na fits, then fine. Otherwise, let's have add_na as the key and give forcats::fct_explicit_na() as the function.

My suggested innum is actually the forcats::fct_inseq() function and maybe inseq would be a clearer key? It is in the documentation under "inorder" and there are 3 options, that are the 3 keys I have suggested for the 3rd row of the keyboard, i.e. inorder, (for the order they appear), infreq for them in order of frequency and innum (inseq) for numerical order. I thought innum was clearer that it was numeric, but happy for it to become inseq, because that corresponds to the function.

Later a remaining task for many of the keyboards is to add tooltips and these are examples where the explanations will be really useful.