<html><head></head><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1460907532451_7484">Acho que essa rotina está faltando uma pequena correção</div><div id="yui_3_16_0_ym19_1_1460907532451_7484" dir="ltr"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" id="yui_3_16_0_ym19_1_1460907532451_7489"> teste<-subset(banco, SE_TEM_MBA %in% NÃO)</span><span><br></span></div><div></div><div id="yui_3_16_0_ym19_1_1460907532451_7485"> </div><div id="yui_3_16_0_ym19_1_1460907532451_7485">Faça assim:</div><div id="yui_3_16_0_ym19_1_1460907532451_7485"><br></div><div id="yui_3_16_0_ym19_1_1460907532451_7485" dir="ltr"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" id="yui_3_16_0_ym19_1_1460907532451_7527">nao <-subset(banco, banco$SE_TEM_MBA %in%  c("NÃO"))</span><br></div><div id="yui_3_16_0_ym19_1_1460907532451_7485"><br></div><div id="yui_3_16_0_ym19_1_1460907532451_7485"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1460907532451_7608"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" id="yui_3_16_0_ym19_1_1460907532451_7609">sim<-subset(banco, banco$SE_TEM_MBA %in%  c("SIM"))</span><br id="yui_3_16_0_ym19_1_1460907532451_7610"></div><div class="signature" id="yui_3_16_0_ym19_1_1460907532451_7486"><br></div><div class="signature" id="yui_3_16_0_ym19_1_1460907532451_7486">[  ]'s.</div><div class="signature" id="yui_3_16_0_ym19_1_1460907532451_7486">Edson Lira <br>Estatístico<br> Manaus-Amazonas</div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: times new roman, new york, times, serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> Em Domingo, 17 de Abril de 2016 9:17, Daniel Tiezzi <dtiezzi@usp.br> escreveu:<br></font></div>  <br><br> <div class="y_msg_container"><div id="yiv1122612740"><div><div class="yiv1122612740">Amiko</div><div class="yiv1122612740"><br clear="none" class="yiv1122612740"></div><div class="yiv1122612740">Tente isso:</div><div class="yiv1122612740"><br clear="none" class="yiv1122612740"></div><div class="yiv1122612740"><br clear="none" class="yiv1122612740"></div>teste <- banco[banco$SE_TEM_MBA == “NÃO”,]<div class="yiv1122612740"><br clear="none" class="yiv1122612740"></div><div class="yiv1122612740">daniel</div><div class="yiv1122612740"><br clear="none" class="yiv1122612740"></div><div class="yiv1122612740"><br clear="none" class="yiv1122612740"></div><div class="yiv1122612740"><br clear="none" class="yiv1122612740"><div class="yiv1122612740">
<div class="yiv1122612740" style="color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;word-wrap:break-word;"><div class="yiv1122612740"><div class="yiv1122612740" style="font-size:12px;">Daniel Tiezzi, MD, PhD</div><div class="yiv1122612740" style="font-size:12px;">Professor Associado</div><div class="yiv1122612740" style="font-size:12px;">Departamento de Ginecologia e Obstetrícia</div><div class="yiv1122612740" style="font-size:12px;">Setor de Mastologia e Oncologia Ginecológica</div><div class="yiv1122612740" style="font-size:12px;">Faculdade de Medicina de Ribeirão Preto - USP</div><div class="yiv1122612740" style="font-size:12px;">Tel.: 16 3602-2488</div><div class="yiv1122612740" style="font-size:12px;">e-mail: <a rel="nofollow" shape="rect" class="yiv1122612740" ymailto="mailto:dtiezzi@fmrp.usp.br" target="_blank" href="mailto:dtiezzi@fmrp.usp.br">dtiezzi@fmrp.usp.br</a></div></div><div class="yiv1122612740"><br clear="none" class="yiv1122612740"></div><div class="yiv1122612740"><br clear="none" class="yiv1122612740"></div></div><br clear="none" class="yiv1122612740Apple-interchange-newline"><br clear="none" class="yiv1122612740Apple-interchange-newline">
</div>
<br clear="none" class="yiv1122612740"><div class="yiv1122612740yqt1472852307" id="yiv1122612740yqt59896"><div><blockquote class="yiv1122612740" type="cite"><div class="yiv1122612740">On Apr 17, 2016, at 1:39 PM, Jobenil Luiz Magalhães Júnior <<a rel="nofollow" shape="rect" class="yiv1122612740" ymailto="mailto:pjobenil@gmail.com" target="_blank" href="mailto:pjobenil@gmail.com">pjobenil@gmail.com</a>> wrote:</div><br clear="none" class="yiv1122612740Apple-interchange-newline"><div class="yiv1122612740"></div></blockquote></div></div></div></div><div class="yiv1122612740yqt1472852307" id="yiv1122612740yqt66833"><div><div class="yiv1122612740"><div class="yiv1122612740">Veja os exemplos aqui.</div><div class="yiv1122612740"><a rel="nofollow" shape="rect" class="yiv1122612740" target="_blank" href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/subset.html">https://stat.ethz.ch/R-manual/R-devel/library/base/html/subset.html</a></div><div class="yiv1122612740">At.</div><div class="yiv1122612740">Jobenil Junior<br clear="none" class="yiv1122612740"><br clear="none" class="yiv1122612740">Enviado do meu iPad</div><div class="yiv1122612740"><br clear="none" class="yiv1122612740">Em 16 de abr de 2016, às 21:58, Amiko Bh <<a rel="nofollow" shape="rect" class="yiv1122612740" ymailto="mailto:amikobh@gmail.com" target="_blank" href="mailto:amikobh@gmail.com">amikobh@gmail.com</a>> escreveu:<br clear="none" class="yiv1122612740"><br clear="none" class="yiv1122612740"></div><blockquote class="yiv1122612740" type="cite"><div class="yiv1122612740"><div class="yiv1122612740" dir="ltr"><div class="yiv1122612740"><div class="yiv1122612740"><div class="yiv1122612740">Prezados,<br clear="none" class="yiv1122612740"><br clear="none" class="yiv1122612740"></div>Tenho o seguinte banco (com aproximadamente 15000 linhas):<br clear="none" class="yiv1122612740"><br clear="none" class="yiv1122612740">



        
        
        
        
        
        



<table class="yiv1122612740" border="0" cellspacing="0"><colgroup span="1" class="yiv1122612740" width="103"></colgroup><colgroup span="1" class="yiv1122612740" width="262"></colgroup><colgroup span="1" class="yiv1122612740" width="171"></colgroup><tbody class="yiv1122612740"><tr class="yiv1122612740"><td align="left" colspan="1" rowspan="1" class="yiv1122612740" height="17">SE_TEM_MBA</td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">MOTIVO_DO_MBA</td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">ATO_INFRACIONAL_MBA</td></tr><tr class="yiv1122612740"><td align="left" colspan="1" rowspan="1" class="yiv1122612740" height="17">NÃO </td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td></tr><tr class="yiv1122612740"><td align="left" colspan="1" rowspan="1" class="yiv1122612740" height="17">NÃO </td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td></tr><tr class="yiv1122612740"><td align="left" colspan="1" rowspan="1" class="yiv1122612740" height="17">SIM </td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td></tr><tr class="yiv1122612740"><td align="left" colspan="1" rowspan="1" class="yiv1122612740" height="17">NÃO </td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td></tr><tr class="yiv1122612740"><td align="left" colspan="1" rowspan="1" class="yiv1122612740" height="17">NÃO </td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td></tr><tr class="yiv1122612740"><td align="left" colspan="1" rowspan="1" class="yiv1122612740" height="17">SIM </td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td></tr><tr class="yiv1122612740"><td align="left" colspan="1" rowspan="1" class="yiv1122612740" height="17">NÃO </td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td></tr><tr class="yiv1122612740"><td align="left" colspan="1" rowspan="1" class="yiv1122612740" height="17">NÃO </td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td></tr><tr class="yiv1122612740"><td align="left" colspan="1" rowspan="1" class="yiv1122612740" height="17">NÃO </td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td><td align="left" colspan="1" rowspan="1" class="yiv1122612740">NSA</td></tr></tbody></table>



<br clear="none" class="yiv1122612740"></div>Gostaria de criar um novo data frame selecionando apenas a linhas com o dado NÃO na coluna SE_TEM_MBA.<br clear="none" class="yiv1122612740"></div>Usei os dois comandos abaixo e vejam o que acontece:<br clear="none" class="yiv1122612740"><br clear="none" class="yiv1122612740">1) > teste<-subset(banco, SE_TEM_MBA %in% NÃO)<br clear="none" class="yiv1122612740">Erro em match(x, table, nomatch = 0L) : objeto 'NÃO' não encontrado<br clear="none" class="yiv1122612740"><div class="yiv1122612740"><div class="yiv1122612740"><br clear="none" class="yiv1122612740">2) teste<-subset(banco, SE_TEM_MBA %in% "SIM")<br clear="none" class="yiv1122612740"></div><div class="yiv1122612740">Quando uso este retorna um data frame com os títulos da coluna, mas sem observação alguma.<br clear="none" class="yiv1122612740"><br clear="none" class="yiv1122612740"></div><div class="yiv1122612740">Muito obrigado.<br clear="none" class="yiv1122612740"></div></div></div>
</div></blockquote><blockquote class="yiv1122612740" type="cite"><div class="yiv1122612740"><span class="yiv1122612740">_______________________________________________</span><br clear="none" class="yiv1122612740"><span class="yiv1122612740">R-br mailing list</span><br clear="none" class="yiv1122612740"><span class="yiv1122612740"><a rel="nofollow" shape="rect" class="yiv1122612740" ymailto="mailto:R-br@listas.c3sl.ufpr.br" target="_blank" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a></span><br clear="none" class="yiv1122612740"><span class="yiv1122612740"><a rel="nofollow" shape="rect" class="yiv1122612740" target="_blank" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a></span><br clear="none" class="yiv1122612740"><span class="yiv1122612740">Leia o guia de postagem (<a rel="nofollow" shape="rect" class="yiv1122612740" target="_blank" href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.</span></div></blockquote></div>_______________________________________________<br clear="none" class="yiv1122612740">R-br mailing list<br clear="none" class="yiv1122612740"><a rel="nofollow" shape="rect" class="yiv1122612740" ymailto="mailto:R-br@listas.c3sl.ufpr.br" target="_blank" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br clear="none" class="yiv1122612740">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br<br clear="none" class="yiv1122612740">Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça código mínimo reproduzível.<br clear="none" class="yiv1122612740"></div></div></div><br><div class="yqt1472852307" id="yqt33647">_______________________________________________<br clear="none">R-br mailing list<br clear="none"><a shape="rect" ymailto="mailto:R-br@listas.c3sl.ufpr.br" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br clear="none"><a shape="rect" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br clear="none">Leia o guia de postagem (<a shape="rect" href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forne� c�igo m�imo reproduz�el.</div><br><br></div>  </div> </div>  </div></div></body></html>