I am trying to find rows for a subset of a data frame. My df looks like this:
dput(df)
structure(list(Cause = structure(c(2L, 1L), .Label = c("jasper not able to read the property table after the release",
"More than 7000 messages loaded which stuck up"), class = "factor"),
Resolution = structure(1:2, .Label = c("jobs and reports are processed",
"Updated the property table which resolved the issue."), class = "factor")), .Names = c("Cause",
"Resolution"), class = "data.frame", row.names = c(NA, -2L))
I am trying to do this:
df1<-subset(df, grepl("*MQ*|*queue*|*Queue*", df$Cause))
search for an MQ or queue or queue in the Cause column, a subset of the df data frame with matched entries. It doesn't seem to work, it catches other entries that the MQ, queue or Queue lines are missing.
Is this the way you do it, any other ideas that I can implement?
source
share