lundi 31 mai 2021

!all(is.na(df)) returns FALSE in console but passes the if

here is the code: if(sapply(pcol,class)!= sapply(dfcol,class) & !all(is.na(dfcol))){, which is intended to harmonise var types between two dataframes. The !all(is.na(dfcol))) is supposed to rule out empty dataframes .If I test one that it empty, my console returns [1] FALSE but it get through the if in the code above. Any thoughts ? Highly appreciated !!

Aucun commentaire:

Enregistrer un commentaire