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

Improvements to the complex and maths and other keyboards in the Prepare > Column: Calculator #8878

Closed rdstern closed 1 month ago

rdstern commented 4 months ago

@N-thony I suggest this is a good @Fidel365 task, if you agree? It is essentially item d) in the issue #8877 where he has completed a) to c) already.

The maths keyboard is incomplete in the tooltips. I had not noticed this earleir. They are suggested below a) Also the R Help is for the stats package. Please add base as well. Make it the first, then stats and also add the car and circular packages. b) The missing tooltips are suggested as follows: deg: Tooltip: Change for radians to degrees. For example deg(pi/2) = 90. exp: Tooltip: The exponential function. exp(1) = e = 2.71828. exp(0) = 1, exp(-2) = 0.1353 = 1/exp(2). It is the inverse of the log function, so exp(6.238) = 512, while log(512) = 6.238. abs: Tooltip: The absolute (or positive) value. For example abs (-4.4) = abs(4.4) = 4.4. sign: Tooltip: The sign of the corresponding values. So sign(4.2)=1, sign(-20)=-1, sign(c(-2,-1,0,1,2,3))= (-1,-1,0,1,1,1) logit: Tooltip: log(p/(1-p)) for p between 0 and 1, or between 0 and 100 if you have percentages. For example logit(c(0.2, 0.5, 0.95)) is (-1.386, 0, 2.944). logistic: Tooltip: Distribution function for the logistic distribution. For example dlogis(c(-2,-1,0,1,2), 0, 5513) = (0.026, 0.14, 0.5, 0.86, 0.974). The scale of 0.5513 gives a standard deviation of 1.
atan2: atan2(x,y) gives the angle between the x axis and the vector between to origin and the point (x,y). For example atan2(1,1) = 0.7854 = pi/4 (=45 degrees).

c) In the complex keyboard the keys need to change slightly and the tooltips need to be added.

Here is the current keyboard:

image

rdstern commented 4 months ago

I continue here - for the complex keyboard: c) In the complex keyboard the keys need to change slightly and the tooltips need to be added.

Here is the current keyboard:

image

1) The complex key provides as.complex(). I suggest it is for the complex command instead and we have a second key with label as.complex as well. So the top keys become: complex, as.complex, real, imaginary 2) Then the second row could become: mod, arg, conjugate, rad 3) The third becomes: sin, cos, tan, deg 4) The 4th row of keys: sinh, cosh, tanh, exp 5) And the last full row: sqrt, roun d, signif, log 6) A 6th short row, before the R help, with 2 keys: i , pi 7) The key withi, just gives the letter i. And the key with pi, should not include the brackets. It is currently pi( ) and it just becomes pi.

I still have tooltips to add: complex: Tooltip Construct a complex number. For example complex(3, 2) gives 3 + 2i. as.complex: Tooltip Define a variable as complex. For example as.complex(-1) gives 1 + 0i real: Tooltip The real part of a complex number. For example Re(3 + 2i) gives 3. imaginary: Tooltip The imaginary part of a complex number or variable. For example Im(3 + 2i) gives 2. New second row: mod: Tooltip The modulus (polar coordinate) of a complex number or variable. For example Mod(3 + 2i) gives 3.606, which is sqrt(33 + 22). Also abs(3 + 2i) is the same as Mod(3 + 2i). arg: Tooltip The argument (polar coordinate) of a complex number or variable. For example Arg(3 + 2i) gives 0.588 where 3 = 3.606cos(0.588) and 2 = 3.606sin(0.588). conjugate: Tooltip Conjugate of a complex number or variable: For example Conj(3 + 2i) gives 3 - 2i. rad: Tooltip Change from degrees to radians. For example rad(90 + 180i) gives (1.571 + 3.142i) deg: Tooltip Change from radians to degrees. For example deg(pi/2 + 3.142i) gives (90 + 180i) sqrt: Tooltip Square root. For example sqrt(-9 + 0i) gives (0 + 3i) or just 3i. sqrt(-9 + 2i) gives 0.331 + 3.018i)
exp: The exponential function. For example exp(3 + 2i) gives round: Tooltip round(pi/2 + 3.14259i) gives 2 + 3i) so rounds to whole numbers. round(pi/2 + 3.14259i, 2) gives 1.57 + 3.14i, so rounds to 2 decimals. signif: Rounds to give the specified number off digits in the larger of the components. For example signif(0.424 + 511.38i, 3) gives (0 + 511i)

rdstern commented 4 months ago

Here are tooltips for the hydroGOF keyboard: image

br2: r-squared times the slope of the regression line between sim and obs cp: coefficent of persistence between sim and obs d: Index of agreement between sim and obs KGE: Kling-Gupta efficiency between sim and obs mae: mean absolute error between sim and obs md: modified index of agreement between sim and obsmNSE me: mean error between sim and obs mNSE: modified Nash-Sutcliffe efficiency between sim and obs mse: mean squared error between sim and obs, nrmse: normalized root mean square error between sim and obs nse: Nash-Sutcliffe efficiency between sim and obs pbias: percent bias between sim and obs pbiasfdc: percent bias in the slope of the midsegment of the flow duration curve rd: relative index of agreement (d) between sim and obs. (Value is between 0 and 1) rmse: root mean square error between sim and obs, so the standard deviation of the model prediction error rNSE: relative Nash-Sutcliffe efficiency between sim and obs rPearson: correlation between sim and obs rSD: ratio of standard deviations between sim and obs rsr: ratio of the root mean square error between sim and obs to the standard deviation of obs ssq: sum of squared residuals between sim and obs VE: volumetric efficiency between sim and obs (Value is between 0 and 1)