2

I am trying to compare two data sets df1 and df2, both having 1000 rows and 161 columns which I have loaded from Excel.

When I use compare_df(df1, df2) and then try to view the HTML output by view_html(compare_df(df1, df2)) to see the difference, I notice that there are missing rows in the HTML output.

view_html() only displays the first 100 records in the HTML

How can I change this limit to more than 100 so that I can see all my records in the HTML output?

Please suggest how this can be done. Or if there is any better way to compare the Excel and see the visible results of the difference. I am kind of new in R so trying my best.

Capt.Krusty
  • 597
  • 1
  • 7
  • 26
kaydee
  • 67
  • 5

1 Answers1

0

I know this is an old post, but I recently needed to do the same thing where I wanted to have >100 rows of output shown. The documentation (https://cran.r-project.org/web/packages/compareDF/compareDF.pdf) does not recommend doing it for >1000 rows.

Here's an example to do for 508 rows:

ctable <- compare_df(df1, df2, c("linker"))

# Output html with 508 rows 
create_output_table(
  ctable,
  output_type = "html",
  file_name = NULL,
  limit = 508, #change this to number of rows required
  color_scheme = c(addition = "#52854C", removal = "#FC4E07", unchanged_cell = "#999999",
                   unchanged_row = "#293352"), headers = NULL, 
  change_col_name = "chng_type", group_col_name = "grp")

# Export xlsx file with 508 rows (maintains the html colour differences)
create_output_table(
  ctable,
  output_type = "xlsx",
  file_name = here("folder", "ctable_file.xlsx"),
  limit = 508, #change this to number of rows required
  color_scheme = c(addition = "#52854C", removal = "#FC4E07", unchanged_cell = "#999999",
                   unchanged_row = "#293352"), headers = NULL, 
  change_col_name = "chng_type", group_col_name = "grp")
smicaela
  • 109
  • 8