Title: | A 'shiny' App to Compare Two Data Frames |
---|---|
Description: | A tool developed with the 'Golem' framework which provides an easier way to check cells differences between two data frames. The user provides two data frames for comparison, selects IDs variables identifying each row of input data, then clicks a button to perform the comparison. Several 'R' package functions are used to describe the data and perform the comparison in the server of the application. The main ones are comparedf() from 'arsenal' and skim() from 'skimr'. For more details see the description of comparedf() from the 'arsenal' package and that of skim() from the 'skimr' package. |
Authors: | Sergio Ewane Ebouele [aut, cre] |
Maintainer: | Sergio Ewane Ebouele <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.4 |
Built: | 2024-11-25 14:57:12 UTC |
Source: | CRAN |
Function which perform the comparison of dataframe
compare_data_frame_object(df1, df2, id_var)
compare_data_frame_object(df1, df2, id_var)
df1 |
The first dataframe of the comparison |
df2 |
The second dataframe of the comparison |
id_var |
The character vector containing id variables which identify the observations in dataframe 'df1' and datafram 'df2' |
An object of class "comparedf" as made by the 'comparedf' S3 method is returned.
library(dplyr) compare_data_frame_object( iris %>% dplyr::mutate(ID = row_number()), iris %>% dplyr::mutate(ID = row_number()), 'ID')
library(dplyr) compare_data_frame_object( iris %>% dplyr::mutate(ID = row_number()), iris %>% dplyr::mutate(ID = row_number()), 'ID')
run the rmarkdown report of the data comparison and save it in an external directory
compare_data_frame_object_report( df1, df2, ids, report_title = "Comparator report", report_author = "Author name here", report_context = "Add a small text here to explain the context." )
compare_data_frame_object_report( df1, df2, ids, report_title = "Comparator report", report_author = "Author name here", report_context = "Add a small text here to explain the context." )
df1 |
The first dataframe of the comparison |
df2 |
The second dataframe of the comparison |
ids |
The character vector containing id variables which identify the observations in dataframe 'df1' and datafram 'df2' |
report_title |
A character string which contains the title of the report |
report_author |
A character string which contains the name of the report author |
report_context |
A character string containing the context of the report |
null.
library(dplyr) compare_data_frame_object_report( df1 = iris %>% dplyr::mutate(ID = row_number()), df2 = iris %>% dplyr::mutate(ID = row_number()), ids = 'ID', report_title = "Iris data Comparator report", report_author = "Sergio Ewane", report_context = "i'm checking if the two dataframe contains the same values" )
library(dplyr) compare_data_frame_object_report( df1 = iris %>% dplyr::mutate(ID = row_number()), df2 = iris %>% dplyr::mutate(ID = row_number()), ids = 'ID', report_title = "Iris data Comparator report", report_author = "Sergio Ewane", report_context = "i'm checking if the two dataframe contains the same values" )
Datatable formatter, to print on the screen
data_table_formatter(df, n_page = 5)
data_table_formatter(df, n_page = 5)
df |
dataframe to format |
n_page |
number of rows to display per page |
An object of class "htmlwidget" containing a formated data.frame to print on app UI
data_table_formatter(iris, 10)
data_table_formatter(iris, 10)
Run the dataCompare Shiny Application
run_data_compare_app(...)
run_data_compare_app(...)
... |
list of arguments |
No return value, launch the app
Detect common variables in two dataset
same_variables(df1, df2)
same_variables(df1, df2)
df1 |
the first dataset to use |
df2 |
The second dataset to use |
a Character vector containing all variables names in both df1 and df2
same_variables(iris, iris) same_variables(mtcars, mtcars)
same_variables(iris, iris) same_variables(mtcars, mtcars)
Skim a dataset and return only characters variables characteristics
skim_char(the_data)
skim_char(the_data)
the_data |
Data on which the skim function will apply the description on character variables |
a data.frame object containing description of all character (factor, character or date) variable in the input data.
skim_char(iris) skim_char(mtcars)
skim_char(iris) skim_char(mtcars)
Skim a dataset and return only numeric variables characteristics
skim_num(the_data)
skim_num(the_data)
the_data |
Data on which the skim function will apply the description on numeric variables |
a data.frame object containing description of all numeric (doucle or integer) variable in the input data.
skim_num(iris) skim_num(mtcars)
skim_num(iris) skim_num(mtcars)