Skip to content

Commit

Permalink
Per #2805, enhance the R differencing logic to handle NA strings in t…
Browse files Browse the repository at this point in the history
…he header columns. Previously, differences that include the NA string were ignored. This enhances the compareStatLty() function to handle NA strings properly.
  • Loading branch information
MET Tools Test Account committed Feb 2, 2024
1 parent aa3e14e commit a9f61cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/test_unit/R_test/test_util.R
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,9 @@ compareStatLty = function(stat1, stat2, lty, verb=0, strict=0){
# compare the information in the header columns
for(intCol in 2:21){
listMatch = apply(data.frame(dfV1[,intCol], dfV2[,intCol]), 1,
function(a){ a[1] == a[2] });
function(a){ same = (a[1] == a[2]) | (is.na(a[1]) & is.na(a[2]));
same[is.na(same)] = FALSE;
return(same); });
intNumDiff = sum( !listMatch[ !is.na(listMatch) ] );
if( 0 < intNumDiff ){
if( 1 <= verb ){
Expand Down

0 comments on commit a9f61cf

Please sign in to comment.