<div dir="ltr"><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)"><div class="gmail_default">Bom dia amigos,<br></div></div><div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)">estou tentando criar um padrão com as strings de busca do meu dataset. Essa é minha string:</div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)"><div class="gmail_default">"municipio == Limeira" </div><div class="gmail_default">"municipio == Limeira & diasemanaincident == terca" </div><div class="gmail_default">"municipio == Limeira & diasemanaincident == terca & <b>trechoklmetros == ]12.200, 245.000]</b>" "municipio == Manaus" </div><div class="gmail_default">"municipio == Manaus & diasemanaincident == sexta" </div><div class="gmail_default">"municipio == Manaus & diasemanaincident == sexta & turnoincidente == manha" </div></div><br></div><div><br></div><div><br></div><div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)">o resultado que pretendo alcançar é:</div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)"></div><span style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif">municipio == <div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline">'</div>Limeira<div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline">'</div></span><br></div><div><span style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif">municipio == <div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline">'</div>Limeira<div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline">'</div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline"></div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline"></div> & diasemanaincident == <div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline">'</div>terca<div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline">'</div></span><span style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif"><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline"><br></div></span></div><div><span style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif">municipio == <div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline">'</div>Limeira<div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline">'</div> & diasemanaincident == <div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline">'</div>terca<div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline">'</div> & <div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline"><b></b></div><b>trechoklmetros <div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline">> </div>12.200<div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148);display:inline"> & </div></b></span><b><span style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif">trechoklmetros</span><span style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif"><div class="gmail_default" style="display:inline"> </div></span><div class="gmail_default" style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif;display:inline"><= </div></b><span style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif"><b>245.000</b><div class="gmail_default" style="display:inline">)</div></span><span style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif"><div class="gmail_default" style="display:inline"></div></span></div><div><div class="gmail_default" style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif">municipio == 'Manaus' </div><div class="gmail_default" style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif">municipio == 'Manaus' & diasemanaincident == 'sexta' </div><div class="gmail_default" style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif">municipio == 'Manaus' & diasemanaincident == 'sexta' & turnoincidente =='manha' </div></div><div class="gmail_default" style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif"><br></div><div class="gmail_default" style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif"><br></div><div class="gmail_default" style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif"><br></div><div class="gmail_default" style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif">Ou seja, em termos gerais, inserir <b>aspas simples (ou duplas</b>) depois do sinal de atribuição ==</div><div class="gmail_default" style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif"><br></div><div class="gmail_default" style="color:rgb(11,83,148);font-family:'arial narrow',sans-serif">e a segunda condicao é <b>ajustar o intervalo ]12.200, 245.000]</b> (em negrito).</div><div><br></div><div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)">Tentei gsub, sub, package stringr, porém sem sucesso, nao sou muito familiarizado com regex :/</div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)">Quem puder me ajudar...</div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="text-align:center"><font color="#0c343d" face="arial narrow, sans-serif" size="2">Att,</font></div><div style="text-align:center"><font color="#0c343d" face="arial narrow, sans-serif" size="2"><br></font></div><div style="text-align:center"><font color="#0c343d" face="arial narrow, sans-serif" size="2">Fernando Gama da Mata</font></div><div style="text-align:center"><font color="#0c343d" face="arial narrow, sans-serif" size="2"><br></font></div><div style="text-align:center"><br></div></div></div></div></div>
</div>