grepall | R Documentation |
grep string for all columns of type character
grepall(dataframe, string, print_values = FALSE, ...)
dataframe |
Object of class data.frame |
string |
Character. Specify string to search for |
print_values |
Logical. Choose wether to print values. |
... |
further arguments passed to grep |
testdata <- data.frame(a = c(1, "?"), b = 1:2, C = c("?", "?"), d = c("?", "a"), stringsAsFactors = FALSE)
index <- which(as.matrix(testdata) == "?", arr.ind = TRUE)
testdata[index]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.