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

Fixes single column dataframe #78

Merged
merged 2 commits into from
Apr 16, 2020
Merged

Fixes single column dataframe #78

merged 2 commits into from
Apr 16, 2020

Conversation

robne1982
Copy link
Collaborator

Description

Fixes #71, where the rCompare function would error if a single column dataframe was passed.

This was caused by the way R handles filtering dataframes with a single column. df[1:2, ] returns a dataframe if df has 2+ columns but returns a vector if df has 1 column.

This behaviour can be changed by passing drop=TRUE (see https://stackoverflow.com/questions/21025609/how-do-i-extract-a-single-column-from-a-data-frame-as-a-data-frame)

Motivation and Context

Fixes #71 reported by an external user

How Has This Been Tested?

  • added a new end to end test that checks that the whole dataCompareR flow works for single column dataframes
  • did not amend the tests for the modified matchNoIndex function because those tests look like they could use a refactor/tidy up anyway - I can go back and do this if needed?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Tests throw existing warnings around testthat . Travis isn't happy, but that appears to be due to #76 .

@sajohnston sajohnston self-assigned this Apr 15, 2020
@sajohnston sajohnston merged commit 5cd591e into dev Apr 16, 2020
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.

Error when unequal number of rows
2 participants