Closed UTexas80 closed 2 years ago
I'm unable to reproduce the problem on my local. Any idea what changed recently at your end?
Thank you for the prompt response. Much appreciated. I love the package and find it invaluable. I added the 'tidytables' library and thought that might have caused an issue. I removed it but still ran into the same errors. Interestingly, I am comparing two (2) data.tables and get a "error in setkeyv(value, key) : some columns are not in the data.table: STATION_ID error. Does the group column need to be formatted as character? I have the CRAN compareDF version [2.3.3] installed. Thank you for your time and consideration.
The error seems to suggest that the STATION_ID
column is not missing in one of the two tables. Are you sure there is no typo in the names?
Does the group column need to be formatted as character
It shouldn't have to, but if that's the case - It's a bug that has to be fixed :)
Using your results datasets
results_2010 <- data.frame( Maths = c(90L, 85L, 93L, 95L, 99L, 99L), Physics = c(84L, 92L, 93L, 92L, 92L, 81L), Chem = c(91L, 91L, 92L, 71L, 82L, 91L), Art = c(34L, 36L, 21L, 37L, 78L, 24L), Division = as.factor(c("A", "A", "A", "A", "A", "A")), Student = as.factor(c("Isaac","Akshay", "Vishwas","Rohit","Venu","Ananth")), Discipline = as.factor(c("B", "B", "A", "C", "A", "B")), PE = as.factor(c("B", "B", "B", "B", "E", "A")) ) results_2011 <- data.frame( Maths = c(90L, 85L, 82L, 94L, 100L, 78L), Physics = c(84L, 92L, 93L, 92L, 92L, 81L), Chem = c(91L, 91L, 92L, 71L, 82L, 91L), Art = c(34L, 36L, 21L, 37L, 78L, 24L), Division = as.factor(c("A", "A", "A", "A", "A", "A")), Student = as.factor(c("Isaac","Akshay", "Vishwas","Rohit","Venu","Ananth")), Discipline = as.factor(c("A", "A", "B", "D", "A", "B")), PE = as.factor(c("B", "B", "B", "B", "E", "A")) )
sessioninfo::session_info()
compareDF::compare_df(results_2010,results_2011,"Student")
I get a "Error in both_tables$df_new[, .SD, .SDcols = names(both_tables$df_old)] : incorrect number of dimensions"
I am at a loss...
Can you create a full reproducible example from your data that I can use to test?
Closing due to lack of activity
Hello,
I am running the example code
Reproducible Code
ctable_student = compare_df(results_2011, results_2010, c("Student"))
Describe the bug I receive an error message stating "Error in both_tables$df_new[, .SD, .SDcols = names(both_tables$df_old)] ": incorrect number of dimensions
Expected behavior I ran the code several weeks ago and it was working correctly. I was able to output an excel worksheet comparing the differences between datasets.
Desktop (please complete the following information):