dataCompareR v0.1.2


Monthly downloads



Compare Two Data Frames and Summarise the Difference

Easy comparison of two tabular data objects in R. Specifically designed to show differences between two sets of data in a useful way that should make it easier to understand the differences, and if necessary, help you work out how to remedy them. Aims to offer a more useful output than all.equal() when your two data sets do not match, but isn't intended to replace all.equal() as a way to test for equality.

Functions in dataCompareR

Name Description
createCompareObject Generates an empty list of the correct class to store results
makeValidKeys makeValidKeys
processFlow processFlow Handles the process flow for the whole package
matchColumns matchColumns : create subset of DFA and DFB to contain matching column names for both data frames
variableMismatches Create variable mismatch table
compareNames compareNames : compare the intersect of colInfoA and colInfoB and return boolean of matched columns for each data frame
matchMultiIndex Generate two dataframes that contain the same rows based on a two-column index
checkEmpty checkEmpty
rCompare Compare two data frames
createAntiSubset Create a dataframe of the rows that don't match
collapseClasses collapseClasses. Collapse the classes of an object to a single string
createMeta Takes the raw info for the meta block of the output and puts it in a format usable by the updateCompareObject function
createCleaningInfo Converts cleaning info into a format consumable by updateCompareObject.
createColMatching Converts the output of the column matching logic to something consumable by updateCompareObject.
makeValidNames makeValidNames
getCoercions Subsets on the variables that have a coercion.
is.dataCompareRobject Check object is of class dataCompareRobject
getMismatchColNames Extracts the column names only in one data frame from a table of match information
isNotNull isNotNull: is object not null
outputSectionHeader outputSectionHeader: creates an outputSectionHeader
prepareData prepareData Prepares data for comparison in 3 stages. 1. Match columns - filter dataframes to those columns that match and summarise differences 2. Match rows - filter dataframes to those rows that match and summarise differences 3. Coerce data
isSingleNA isSingleNA
listObsNotVerbose listObsNotVerbose
createMismatchObject Create mismatch object
checkKeysExist checkKeysExist
colsWithUnequalValues colsWithUnequalValues: a dataframe summarising a column with unequal values
createMismatches Create mismatch object
warnLargeData Warn users if the calculation is likely to be slow
executeCoercions executeCoercions:
generateMismatchData Extract data from a dataCompareR comparison
print.dataCompareRobject Printing RCompare Output
listObsVerbose listObsVerbose
summary.dataCompareRobject Summarizing RCompare Output
updateCompareObject.colmatching Adds a colMatching block to the output
locateMismatches Checks whether elements in two input data frames are equal.
trimCharVars trimCharVars: trim white spaces in character variables from an input dataframe
compareData Compare data. Wrapper for comparison functionality.
print.summary.dataCompareRobject Printing summaryRCompare Output
updateCompareObject.matches Adds a colMatching block to the output
createReportText createReportText: prepares text which is used in the summary report Saves R markdown and HTML reports in the area specified by the user. Reports are called RcompareReport.Rmd (.html) Uses knitr package to create tables in the markdown (createReportText function) and HTML report.
updateCompareObject.rowmatching Adds a rowMatching block to the output
validateArguments validateArguments
updateCompareObject.mismatches Adds a colMatching block to the output
saveReport Save a report based on a dataCompareR object
subsetDataColumns subsetDataColumns : create subset of DFA and DFB to contain matching column names for both data frames
updateCompareObject.meta Takes raw info for meta and adds it to the compare object
createRowMatching function for updating a compare object with information passed to it from the match rows function
matchNoIndex Generate two dataframes that contain the same rows based on a two-column index
matchRows Generate two dataframes and returns subsets of these dataframes that have shared rows.
mismatchHighStop mismatchHighStop Checks if we've exceeded threshold of mismatches
orderColumns orderColumns: order columns by treated column names
updateCompareObject Generic function for updating a compare object with information passed to it, that has methods based on the class of the info argument.
updateCompareObject.cleaninginfo Updates cleaning info in the compare object
matchSingleIndex Generate two dataframes that contain the same rows based on a single index
metaDataInfo Creates a list of info about the dataframe.
validateData validateData : routine to validate the input data
rcompObjItemLength rcompObjItemLength: return length of an item, returning 0 if null, and handling the fact that we might have a data frames or a vector
variableDetails Create variable mismatch details
rounddf Round all numeric fields in a data frame
checkForRCompareCol checkForRcompareCol
allVarMatchMessage allVarMatchMessage
checkUniqueness Checks that a list of indexes areunique
cleanColNames cleanColNames : get colnames, remove leading and trailing whitespace and push to upper case
checkNA CheckNA
coerceData coerceData
coerceFactorsToChar coerceFactorsToChar: convert all factor type fields to characters
createTextSummary createTextSummary: create a text based summary of an dataCompareR object
currentObjVersion Place to store and access the current object version.
No Results!

Vignettes of dataCompareR

No Results!

Last month downloads


Include our badge in your README