Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Integer Keyboard to the Calculator #7490

Merged

Conversation

anastasia-mbithe
Copy link
Contributor

@anastasia-mbithe anastasia-mbithe commented May 20, 2022

Fixes #7483
This is still in progress.

@anastasia-mbithe anastasia-mbithe changed the title Added Arihmetic Keyboarrd to the Calculator Added Arithmetic Keyboard to the Calculator May 22, 2022
Copy link
Collaborator

@rdstern rdstern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anastasia-mbithe that's a good start.
a) I think call it Integer, rather than arithmetic.
b) Change Prime as the label to prime. And get rid of the dash in the function- it doesn't work currently.
c) Add the factorizeZ key and the chooseZ functions, as factorial and choose keys.
d) add a nextprime key.
That should be quick - next some puzzles:
e) Now some puzzles for you - not so simple, and each to be considered only if there is a reasonably easy solution.

  1. I really like factorize, but it seems to work for just a single number, rather than a column of numbers. And it gives the result in a short column, which then get repeated down the variable. Could you get it to produce the results in a single list each time, and to work for a variable, rather than a number?
  2. And a fib key would be nice. Again that works only for a single number, while fib2 gives 2 Fibonacci numbers. Could you add sapply as described under the Eulerian in the guide?
  3. And look for more keys to add from the package

@anastasia-mbithe
Copy link
Contributor Author

@rdstern, if its integer then I'll change the first key to "bigz" instead of bigq. I can still keep the bigq if you need it too.

@lloyddewit
Copy link
Contributor

@anastasia-mbithe Thank you for this, is this PR ready again for test/review or is it still in progress?
Thanks

@anastasia-mbithe
Copy link
Contributor Author

Hello @lloyddewit, This is still in progress.

Wycklife and others added 2 commits June 7, 2022 12:26
Set the cursor position for the keys
More changes to integer keyboard
@rdstern
Copy link
Collaborator

rdstern commented Jun 8, 2022

@anastasia-mbithe this is starting to look good. And well done on using the Desctools package.
a) I know the keyboard is called integer, but is there any advantage using bigz, rather than bigq as the first function? If so, then perhaps we include both? But we may want to use the function on non-integer data, and bigz truncates, while bigq seems fine. I tried on the fert column in the survey data.
b) Could you and @Wycklife add tooltips to the keys?
c) Then I am happy to approve. But could you also, between you, find any other keys that could be useful to add? I am particularly thinking of interesting things that would be fun in a maths camp.

@anastasia-mbithe
Copy link
Contributor Author

@rdstern , I have added some other functions as Fibonacci(), Divisors(), PercentRank() and DigitSum() from the DescTools package. I have also added the tooltips and bigq function.
Have a look at it.

@anastasia-mbithe anastasia-mbithe changed the title Added Arithmetic Keyboard to the Calculator Added Integer Keyboard to the Calculator Jun 8, 2022
@rdstern
Copy link
Collaborator

rdstern commented Jun 8, 2022

Sounds good. Can you add an example of each that I can use. Do they all work with columns of data, or are some simpler than that?

@anastasia-mbithe
Copy link
Contributor Author

Fibonacci(c(1,2,5,7,8,10))
[1] 1 1 5 13 21 55
Divisors(c(4,8,21,45))
$4
[1] 1 2

$8
[1] 1 2 4

$21
[1] 1 3 7

$45
[1] 1 3 5 9 15

PercentRank(c(1,2,5,6,7))
[1] 0.2 0.4 0.6 0.8 1.0
DigitSum(c(234,567,12345,987))
[1] 9 18 15 24

Yeah they all can work with a number, a list and even a column.

Copy link
Collaborator

@rdstern rdstern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be happy for this to be merged. We may wish to add more, but that may always be the case.

@lloyddewit lloyddewit merged commit 685c022 into IDEMSInternational:master Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new arithmetic keyboard to the calculator
4 participants