jasp-desktop icon indicating copy to clipboard operation
jasp-desktop copied to clipboard

add power and logit transforms

Open Kucharssim opened this issue 3 years ago • 10 comments

closes https://github.com/jasp-stats/INTERNAL-jasp/issues/1728 closes https://github.com/jasp-stats/INTERNAL-jasp/issues/1866

Kucharssim avatar Jun 22 '22 15:06 Kucharssim

Also, I was wondering if we should typeset inverse functions like invLogit like logit⁻¹(y). On the one hand, logit⁻¹(y) is more readable (at least to me), while on the other hand, it's convenient that invLogit can also be used in the R code. Then again, there are a few other symbols that cannot be typed in R either

Good point. I think the whole point of the point and click interface is to be human friendly (and not programmer friendly), so it does make sense to me to typeset it like logit⁻¹(y).

Just a question about implementation. I thought I could just change it to logit\u207B\u00B9 (assuming unicode would work). However, it seems like we did not implement the option to replace the name of the function with another string? I could only replace it with an image like for the symbols here?

https://github.com/jasp-stats/jasp-desktop/blob/7c8c2a91fc914bc3a1c3b998611517d2fe0bdaf6/Desktop/components/JASP/Widgets/FilterConstructor/Function.qml#L17

(If @vandenman does not know perhaps @JorisGoosen would). I must admit I am not happy about the prospect of making these images and in two themes 😅

Kucharssim avatar Jun 23 '22 06:06 Kucharssim

I could easily add a "pretty functionname" property and then you could enter the unicode directly there?

JorisGoosen avatar Jul 25 '22 14:07 JorisGoosen

If you can easily add that, that would be nice!

Kucharssim avatar Jul 25 '22 15:07 Kucharssim

If you can easily add that, that would be nice!

I added it to stable just now, see log2 and log10 in ComputeColumnWindow.qml

JorisGoosen avatar Jul 25 '22 19:07 JorisGoosen

For some reason I cannot build right now to test it, but the needed changes looked easy enough to make.

Kucharssim avatar Jul 26 '22 10:07 Kucharssim

so this probably works, but because we no longer do library(jaspBase) by default I'm now seeing

image

for all our custom functions...

vandenman avatar Jul 26 '22 11:07 vandenman

So... I can move https://github.com/jasp-stats/jasp-desktop/commit/e9e8011c7d663cfefc75eb3e23b05b390064b072 to stable

JorisGoosen avatar Jul 26 '22 13:07 JorisGoosen

So... I can move https://github.com/jasp-stats/jasp-desktop/commit/e9e8011c7d663cfefc75eb3e23b05b390064b072 to stable

I don't like it, but maybe it's best to do that for now. The downside is that every module needs to be aware that they should not clash with anything in https://github.com/jasp-stats/jaspBase/blob/master/NAMESPACE, but perhaps they should do that anyway because otherwise, we need to provide syntax with jaspBase:: and jaspModule:: rather than library.

vandenman avatar Jul 26 '22 16:07 vandenman

Ok, I moved the commit to stable so here it is: https://github.com/jasp-stats/jasp-desktop/commit/e4b61bc23767e1bb1c9d64b6ef6683880aed9a13

JorisGoosen avatar Aug 09 '22 11:08 JorisGoosen

so those custom functions should work again

JorisGoosen avatar Aug 09 '22 11:08 JorisGoosen

Now it works!

There is just some funky business going on with the pretty labels: Screenshot 2022-08-25 at 15 47 08

You can see on the right that the pretty labels are very pretty indeed, and they also look pretty if I drag them to the computation window alone, but if I drag it inside of another function, then the R function name is displayed instead of the pretty label (i.e., logit(invLogit(contNormal)) should look like logit(logit⁻¹((contNormal)))

Kucharssim avatar Aug 25 '22 13:08 Kucharssim

Aah hey could you make a bug for it in 0.16.4? SHould be easy to fix but also to forget im afraid :p

JorisGoosen avatar Aug 25 '22 14:08 JorisGoosen

Ok so this should be fine now, I guess @vandenman can give it a go once more but otherwise it should be ready

Kucharssim avatar Sep 02 '22 08:09 Kucharssim

Looks good to me! The only nitpick I have is that the log2 and log10 should use subscript base rather than superscript base:

image

but Wikipedia (and others) do this:

image

vandenman avatar Sep 02 '22 11:09 vandenman

Thanks for spotting that! Should be fixed now

Kucharssim avatar Sep 06 '22 07:09 Kucharssim