-
Notifications
You must be signed in to change notification settings - Fork 11
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
R6 classes #47
R6 classes #47
Conversation
* change a few checks for cc as uninitializedField to NULL * update C++ loadvals() to use Environment (R6) rather than Reference * add more missing `self$` * some cleanup in other files from debugging
* functional methods no in use moved to private() * add missed self$ * minimal documentation added (some of these may be removed anyway * replace Workbook inherit checks with assert_workbook() * update workbook methods for names()
* add missing self$ * update class checks with assert_* * conversion of "NaN" for excel "$NUM!"
Codecov Report
@@ Coverage Diff @@
## main #47 +/- ##
==========================================
+ Coverage 35.67% 35.81% +0.13%
==========================================
Files 42 42
Lines 10536 10494 -42
==========================================
- Hits 3759 3758 -1
+ Misses 6777 6736 -41
Continue to review full report at Codecov.
|
Thanks so much! Will go through the changes, currently just merged. Regarding the documentation, I agreed that we write it once we're reach that bridge. |
z[nums] <- lapply(z[nums], as.numeric) | ||
# convert "#NUM!" to "NaN" -- then converts to NaN | ||
# maybe consider this an option to instead return NA? | ||
z[nums] <- lapply(z[nums], function(i) as.numeric(replace(i, i == "#NUM!", "NaN"))) |
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.
I want and will add an option here. It might not be useful for R users, but for people looking for bugs in Excel files. Previously openxlsx
and all the other packages dropped this content, similar to formulas, and if you're not working with Excel but receive a sheet and try to understand what error your colleagues mean, this could be useful.
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.
meaning: If you see NaN
it might be some kind of conversion gone wrong on the R side. Seeing #NUM
gives an indication that there is a formula that was badly evaluated, when the file was written.
closes #40
The workbook modifications might look a little confusing because I moved some functions, so the line changes may not look entirely correct.
I've also updated the names to use a prefix of
wb
to avoid any unwanted conflicts (wbHyperlink
seemed safer than justHyperlink
) and updated thenew
wrappers accordingly (e.g.,new_workbook()
,new_comment()
towb_workbook()
,wb_comment()
). As an FYI, the package nameworkbook
is available on CRAN, just sayin'.For the most part, all of the methods from the
ReferenceClass
object remain public. Only in thewbWorkbook
class did I move anything to private because it was only used inside a public method. There are some functions that weren't used at all that I moved into private as well -- not sure if we'll be keeping them or not.The documentation is also going to need a big overhaul. Most of it is the bare minimum (to prevent complaints in check) and I didn't want to spend too much time figuring out what everything is if we're going to be be removing/revamping a lot of it. I think we can probably just try our best to update the documentation on the go while we made other edits.
There are some additional changes outside of just converting from
ReferenceClass
toR6
that I made after finding some errors/warnings in thecheck()
comment$style
check inwriteComment()
-- not entirely sure what the original was doing or if multiple styles could be provided?6e057a0#diff-6b1e49feb9dd398d294b29b93e9e9d58256314ad47d03da39bbe2c99f237d6faL195-R201
|
changed to||
(gcc warnings)Plenty of other clean up to do (see #9) but I think this is a good start.