The function calls matchColumnName
internally to match the
column names.
assertColumnName(data.frame.cols, reqCols, ignore.case = FALSE)
If all required column names are present, their indices are returned *invisibly*. Otherwise an error message is printed.
myTestDf <- data.frame(HBV=1:3, VFB=0:2, BVB=4:6, FCB=2:4)
myFavTeams <- c("HBV", "BVB")
assertColumnName(myTestDf, myFavTeams)
myFavTeamsCase <- c("hbv", "bVb")
assertColumnName(myTestDf, myFavTeamsCase, ignore.case=TRUE)