Stack Exchange
Remove positions in a vector containing characters that contains a specific letter
I have the vector asset.name_vct with the following characters 
 [1] "A3TV"    "ABE"     "ABG"     "ABG.P_0" "ABG.P_1" "ACS"     "ACX"     "ACX_0"  
 [9] "AENA"    "AGS"     "ALT"     "AMS"     "ANA"     "ANA_0"   "BBVA"    "BKIA"   
[17] "BKIA_0"  "BKT"     "BME"     "BTO_0"   "BTO_1"   "CABK"    "CAR"     "CIE"    
[25] "CIN"     "CLNX"    "COL"     "COL_0"   "CRI"     "DIA"     "EBRO_0"  "EBRO_1" 
[33] "ELE"     "ELE_0"   "ENC"     "ENG"     "EVA"     "FAD"     "FCC"     "FER"    
[41] "GRF"     "IAG"     "IBE"     "IBLA"    "IBR"     "IDR"     "ITX"     "JAZ"    
[49] "LOR"     "MAP"     "MAP_0"   "MAS"     "MEL"     "MRL"     "MTS"     "NHH_0"  
[57] "NHH_1"   "NTGY"    "OHL"     "POP"     "PRS_1"   "REE"     "REE_0"   "REP"    
[65] "SAB"     "SAN"     "SCYR_0"  "SCYR_1"  "SGC"     "SGRE"    "SGRE_0"  "TEF"    
[73] "TEM"     "TL5"     "TRE"     "UNF"     "VIS"     "VIS_0"   "ZEL"

I would like to remove all positions that contains "_". 

You can use grepl() to create a boolean condition to filter your vector. Here's a reproducible example:
vec <- c("ABC", "DEF", "A_C", "GHI", "JK_")
vec[!(grepl("_", vec))]
#> [1] "ABC" "DEF" "GHI"

Created on 2020-05-15 by the reprex package (v0.3.0)
