Re: [R] logical vector of the indices of a string in a vector

2016-01-24 Thread ruipbarradas
Hello, Try x[grepl("Yes", x) & x != ""] Hope this helps, Rui Barradas   Citando carol white via R-help : > Hi, it might be trivial but is there any way to get the logical > vector of the indices of a string in a vector? I thought that %in% > would do but it doesn't. I also want to filter

[R] logical vector of the indices of a string in a vector

2016-01-24 Thread carol white via R-help
Hi, it might be trivial but is there any way to get the logical vector of the indices of a string in a vector? I thought that %in% would do but it doesn't. I also want to filter the empty fields. Here I want to extract the non-empty elements containing "Yes":x =c("Yes, fsd", "", "No","","Yes, fj