Description Usage Arguments Value Examples
The function calls assertColumnName
internally to match the
column names.
1 | subsetByColumnName(data.frame, reqCols, ignore.case = FALSE)
|
data.frame |
A data.frame object |
reqCols |
required columns |
ignore.case |
logical, whether the case is considered |
If all required column names are present, the data.frame object will be subset to include only these columns and the result data.frame is returned. Otherwise an error message is printed.
1 2 3 4 5 | myTestDf <- data.frame(HBV=1:3, VFB=0:2, BVB=4:6, FCB=2:4)
myFavTeams <- c("HBV", "BVB")
subsetByColumnName(myTestDf, myFavTeams)
myFavTeamsCase <- c("hbv", "bVb")
subsetByColumnName(myTestDf, myFavTeamsCase, ignore.case=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.