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

Properly convert to dataframe and return the df #120

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

IdoBar
Copy link

@IdoBar IdoBar commented Mar 6, 2019

Used as.data.frame(x) instead of data.frame(x) to handle conversion of tibbles (and other sort of rectangular data).
Then at the end of the function added x to the invisible() command, so the actual data could be returned and used in a pipe.

Used as.data.frame(x) instead of data.frame(x) to handle conversion of tibbles (and other sort of rectangular data).
Then at the end of the function added x to the invisible() command, so the actual data could be returned and used in a pipe.
@codecov-io
Copy link

codecov-io commented Mar 6, 2019

Codecov Report

Merging #120 into master will decrease coverage by 9.09%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #120     +/-   ##
=========================================
- Coverage   85.83%   76.74%   -9.1%     
=========================================
  Files          25       25             
  Lines        1737      976    -761     
=========================================
- Hits         1491      749    -742     
+ Misses        246      227     -19
Impacted Files Coverage Δ
R/Alignment.R 75% <ø> (ø) ⬆️
R/Border.R 71.42% <ø> (ø) ⬆️
R/Fill.R 83.33% <ø> (ø) ⬆️
R/autoRefresh.R 0% <ø> (ø) ⬆️
R/comment.R 95.65% <ø> (+0.09%) ⬆️
R/DataFormat.R 100% <ø> (ø) ⬆️
R/Cell.R 95.45% <ø> (+0.41%) ⬆️
R/CellProtection.R 100% <ø> (ø) ⬆️
R/NamedRanges.R 18.33% <0%> (-73.98%) ⬇️
R/PrintSetup.R 62.5% <100%> (+0.79%) ⬆️
... and 26 more

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 ee59cc1...1f5dbd6. Read the comment docs.

Check if data is a data.frame OR is a tibble() to convert for a data.frame before writing.
@IdoBar
Copy link
Author

IdoBar commented Mar 9, 2019

I updated the PR to check if data is not a data.frame OR is a tibble to convert to data.frame

@colearendt colearendt changed the base branch from develop to master March 10, 2019 03:06
@colearendt colearendt changed the base branch from master to develop March 10, 2019 03:06
@colearendt
Copy link
Owner

Thanks @IdoBar ! This looks good! Would you mind adding some tests in the tests/testthat/test-write.xlsx.R file that protect this functionality from backwards incompatibilities in the future? Ideally the tests would fail without your patch, but succeed with your patch.

You can use testthat::skip_if_not_installed() if you want to use the tibble package in a test, since we do not have it as a dependency.

@colearendt colearendt changed the base branch from develop to master February 25, 2020 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants