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

.import.rio_xlsx dynamically discovers the formal arguments for read_… #222

Merged
merged 2 commits into from Sep 21, 2019

Conversation

@bokov
Copy link
Contributor

commented Sep 18, 2019

…xlsx or read.xlsx and discards all arguments in '...' that don't match, instead of having to catch them individually. Included tests. While I was at it, noticed there were no xls tests, so added a test file and tests (but left .import.rio_xls untouched so far)

See issue #221

.import.rio_xlsx dynamically discovers the formal arguments for read_…
…xlsx or read.xlsx and discards all arguments in '...' that don't match, instead of having to catch them individually. Included tests. While I was at it, noticed there were no xls tests, so added a test file and tests (but left .import.rio_xls untouched so far)
@codecov-io

This comment has been minimized.

Copy link

commented Sep 18, 2019

Codecov Report

Merging #222 into master will increase coverage by 1.27%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #222      +/-   ##
==========================================
+ Coverage   81.16%   82.43%   +1.27%     
==========================================
  Files          18       18              
  Lines         860      871      +11     
==========================================
+ Hits          698      718      +20     
+ Misses        162      153       -9
Impacted Files Coverage Δ
R/import_methods.R 80% <85.71%> (+6.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d26d5c...f618428. Read the comment docs.

@leeper
Copy link
Owner

left a comment

Thanks for this! Generally looks good. A couple of in-line questions and, can you please edit so code style is consistent - spaces around if () and after commas.

R/import_methods.R Outdated Show resolved Hide resolved
R/import_methods.R Outdated Show resolved Hide resolved
@@ -320,13 +320,23 @@ function(file,
}
if (isTRUE(readxl)) {
requireNamespace("readxl")
if ("rows" %in% names(a)) {
warning("'rows' argument ignored when readxl = TRUE. Use 'range' instead.")

This comment has been minimized.

Copy link
@leeper

leeper Sep 19, 2019

Owner

Why delete this?

This comment has been minimized.

Copy link
@bokov

bokov Sep 19, 2019

Author Contributor

The reason is that the code I added a few lines below...

if (length(unused)>0) {
          warning("The following arguments were ignored when readxl = TRUE:",
                  "\n", paste(unused, collapse=', '))
        }

...will already issue a warning for any invalid ignored arguments, including but not limited to rows. So if somebody passes it a rows argument, they will get warned twice.

That being said, I'll be happy to put the if statement back in if you want me to.

.import.rio_xlsx(): fixed style to comply with the rest of the projec…
…t as per #222 (review) . Please note my response in that thread to the last question about the 'rows' argument.
@bokov

This comment has been minimized.

Copy link
Contributor Author

commented Sep 19, 2019

I have pushed the requested changes and standing by to your decision about deleted part.

While we're at it, quick question-- how do you feel about committing the following not directly related changes either here or in a new PR?

  • New file, rio.Rproj to slightly help other contributors who use RStudio to comply with some project-wide style standards with no extra effort
  • Adding lines to .Rbuildignore to ignore the RStudio project files.

Thanks.

@leeper

This comment has been minimized.

Copy link
Owner

commented Sep 21, 2019

@bokov I'm going to merge this. Thanks for the contribution! Happy to have you add an .Rproj file as a separate PR.

@leeper leeper merged commit f618428 into leeper:master Sep 21, 2019

4 checks passed

codecov/patch 85.71% of diff hit (target 81.16%)
Details
codecov/project 82.43% (+1.27%) compared to 4d26d5c
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.