<div dir="auto">Daniel a sua ajuda também funcionou. Obrigado!!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em seg., 14 de fev. de 2022 18:54, Daniel Guimarães Tiezzi por (R-br) <<a href="mailto:r-br@listas.c3sl.ufpr.br">r-br@listas.c3sl.ufpr.br</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">A função table() faz isso</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 14, 2022, 4:59 PM Sergio Pinto por (R-br) <<a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank" rel="noreferrer">r-br@listas.c3sl.ufpr.br</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace"> Prezados</div><div class="gmail_default" style="font-family:monospace,monospace">Tenho um data-frame (dfp21) com duas variáveis, a primeira variável,  chamada Deficiências, é categórica com sete níveis ('TEA', 'SCe', 'NE', 'DV', 'DF', 'DA/S', 'AH/S') a segunda, chamada p21, também é categórica com dois níveis ("8" e "9").</div><div class="gmail_default" style="font-family:monospace,monospace"> Coloquei os dados em anexo. Não consegui usar o DATAFILEHOST.<br></div><div class="gmail_default" style="font-family:monospace,monospace"><pre aria-label="Console Output" role="document" id="m_7238805252489690774m_3471303217588329367gmail-rstudio_console_output" style="font-family:"Ubuntu Mono",monospace;font-size:16px;outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap;line-height:1.25;color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span role="document"><span style="color:blue;white-space:pre-wrap"><span role="document"><span style="color:blue;white-space:pre-wrap">> dfp21<br># A tibble: 127 × 2<br>   p21   DEFICIÊNCIAS<br>   <fct> <fct>       <br> 1 9     TEA         <br> 2 9     TEA         <br> 3 8     TEA         <br> 4 9     TEA         <br> 5 9     TEA         <br> 6 9     TEA         <br> 7 9     TEA         <br> 8 9     TEA         <br> 9 9     TEA         <br>10 9     TEA         <br># … with 117 more rows</span></span></span></span></pre></div><div class="gmail_default" style="font-family:monospace,monospace"><pre aria-label="Console Output" role="document" id="m_7238805252489690774m_3471303217588329367gmail-rstudio_console_output" style="font-family:"Ubuntu Mono",monospace;font-size:16px;outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap;line-height:1.25;color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span role="document"><span style="color:blue;white-space:pre-wrap"><span role="document"><span style="color:blue;white-space:pre-wrap"><br></span></span></span></span></pre></div><div class="gmail_default" style="font-family:monospace,monospace"><pre aria-label="Console Output" role="document" id="m_7238805252489690774m_3471303217588329367gmail-rstudio_console_output" style="font-family:"Ubuntu Mono",monospace;font-size:16px;outline:currentcolor none medium;border:medium none;word-break:break-all;margin:0px;white-space:pre-wrap;line-height:1.25;color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span role="document"><span style="color:blue;white-space:pre-wrap"><span role="document"><span style="color:blue;white-space:pre-wrap"><span role="document"><span style="color:blue;white-space:pre-wrap"><span role="document"><span style="color:blue;white-space:pre-wrap"><br></span></span></span></span></span></span></span></span></pre></div><div class="gmail_default" style="font-family:monospace,monospace"><b>A dúvida:</b> como criar uma nova coluna com a contagem  da segunda variável em cada nível da primeira? <br clear="all"></div><div style="font-family:monospace,monospace" class="gmail_default">ex: TEA 8 20</div><div style="font-family:monospace,monospace" class="gmail_default">    TEA 9 13<br></div><div style="font-family:monospace,monospace" class="gmail_default">    NE  8 17</div><div style="font-family:monospace,monospace" class="gmail_default">    NE  9 15 ...</div><div style="font-family:monospace,monospace" class="gmail_default">Estou tentando usar o dplyr para isso.<br></div><div style="font-family:monospace,monospace" class="gmail_default">Desde já agradeço a atenção.<br></div><div style="font-family:monospace,monospace" class="gmail_default"></div><div style="font-family:monospace,monospace" class="gmail_default"></div><br>-- <br><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="text-align:left"><span style="color:rgb(0,0,255)"><font size="2"><span style="font-family:monospace,monospace"><b><span style="color:rgb(0,0,0)">_______________________________________<br></span></b></span></font></span></div><div style="text-align:left"><span style="color:rgb(0,0,255)"><font size="2"><span style="font-family:monospace,monospace"><b><span style="color:rgb(0,0,0)">Prof. Dr. SERGIO MEDEIROS PINTO</span><br></b></span></font></span></div><div style="text-align:left"><span style="font-family:monospace,monospace"><font size="2">LABICOM/IEFD-UERJ</font></span></div><div style="text-align:left"><span style="font-family:monospace,monospace"><font size="2">FAMERC-RJ</font></span></div><div style="text-align:left"><span style="font-family:monospace,monospace"><font size="2">UNESA-RJ<br></font></span></div><div style="text-align:left"><span style="font-family:monospace,monospace"><font size="2"><a href="http://lattes.cnpq.br/5897044784217523" rel="noreferrer noreferrer" target="_blank">http://lattes.cnpq.br/5897044784217523</a><br></font></span></div><div style="text-align:left"><span style="font-family:monospace,monospace"><font size="2"><br></font></span></div><div style="text-align:left"><font size="2"><br></font></div><div style="text-align:left"><font size="2"></font><br><span style="font-family:monospace,monospace"><font size="2"></font></span></div><div style="text-align:center"><br></div></div></div></div></div></div></div></div>
_______________________________________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br" rel="noreferrer noreferrer" target="_blank">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="noreferrer noreferrer noreferrer" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" rel="noreferrer noreferrer noreferrer" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br>
</blockquote></div>
_______________________________________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank" rel="noreferrer">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="noreferrer noreferrer" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" rel="noreferrer noreferrer" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br>
</blockquote></div>