-
Notifications
You must be signed in to change notification settings - Fork 8
Tweaking to_integer() #448
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
Conversation
…y difference is that for 'wlr', we call gs_power_wlr() with two additional arguments 'weight' and 'approx'
LittleBeannie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much, @yihui! I gained valuable insights from https://github.com/yihui/gsDesign2/blob/to_integer_tweaks/R/to_integer.R#L349 in order to avoid code duplication.
|
@LittleBeannie You are welcome! Just FYI, So normally I'd avoid using |
Gained another valuable lesson, and thank you for sharing your experience with |
Removed the large amount of code repetition and the unnecessary
for-loops. Please see individual commit messages if you find it difficult to understand the full changes.I did this only because "while I'm looking at the code here..." :)
If my performance is evaluated based on the number of lines of code deleted rather than added, I can probably do better :D I compared the
ahrandwlrcases carefully by eyes, and it will be helpful if someone else could give it another pass to make sure I didn't miss other differences in the code for the two cases. First let's see if the PR would pass R CMD check.