<div dir="auto">Uma correção <div dir="auto"><br></div><div dir="auto"><span style="font-family:"times new roman",serif">read.csv("dados.csv", sep = ';', dec = ",", header = TRUE)</span><br></div><div dir="auto"><span style="font-family:"times new roman",serif"><br></span></div><div dir="auto"><span style="font-family:"times new roman",serif">read.csv2("dados.csv"),</span><span style="font-family:"times new roman",serif"><br></span></div><div dir="auto"><span style="font-family:"times new roman",serif"><br></span></div><div dir="auto"><span style="font-family:"times new roman",serif">Considerando que ser arquivo csv utilize o ponto e virgula como separador. Abre ele no bloco de notas ou qualquer outro editor de texto plano para ver.</span></div><div dir="auto"><span style="font-family:"times new roman",serif"><br></span></div><div dir="auto"><span style="font-family:"times new roman",serif">Cade seu csv use como separador a virgula, vc tera de mudar o decimal de virgula para ponto e remover o ponto ( separafor de milhar). Use o localizar e substituir do excel. Ai fica assim</span></div><div dir="auto"><span style="font-family:"times new roman",serif">read.csv("dados.csv", sep = ',', dec = ".", header = TRUE),</span><span style="font-family:"times new roman",serif"><br></span></div><div dir="auto"><span style="font-family:"times new roman",serif"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em sex., 25 de ago. de 2023 10:12, Fernando Souza <<a href="mailto:nandodesouza@gmail.com">nandodesouza@gmail.com</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"><span style="font-family:"times new roman",serif">read.csv("dados.csv", sep = '.', dec = ",", header = TRUE)</span><div dir="auto"><span style="font-family:"times new roman",serif"><br></span></div><div dir="auto"><font face="times new roman, serif">ou</font></div><div dir="auto"><font face="times new roman, serif"><br></font></div><div dir="auto"><span style="font-family:"times new roman",serif">read.csv2("dados.csv") </span><font face="times new roman, serif"><br></font></div><div dir="auto"><span style="font-family:"times new roman",serif"><br></span></div><div dir="auto"><span style="font-family:"times new roman",serif"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em sex., 25 de ago. de 2023 10:01, Elias Carvalho por (R-br) <<a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank" rel="noreferrer">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="ltr"><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">Bom dia amigos<br></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">Tenho um arquivo .csv com uma variável chamada patrimônio que possui valores acima de 100.000 reais, assim:</div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large"></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">
<span></span>
<table style="font-family:"Liberation Sans";font-size:x-small" cellspacing="0" border="0">
<colgroup width="75"></colgroup>
<tbody style="font-family:"Liberation Sans";font-size:x-small"><tr style="font-family:"Liberation Sans";font-size:x-small">
<td style="font-family:"Liberation Sans";font-size:x-small" height="17" align="left">Patrimonio</td>
</tr>
<tr style="font-family:"Liberation Sans";font-size:x-small">
<td style="font-family:"Liberation Sans";font-size:x-small" height="17" align="right">100.000,00</td>
</tr>
<tr style="font-family:"Liberation Sans";font-size:x-small">
<td style="font-family:"Liberation Sans";font-size:x-small" height="17" align="right">110.000,00</td>
</tr>
<tr style="font-family:"Liberation Sans";font-size:x-small">
<td style="font-family:"Liberation Sans";font-size:x-small" height="17" align="right">120.000,00</td>
</tr>
<tr style="font-family:"Liberation Sans";font-size:x-small">
<td style="font-family:"Liberation Sans";font-size:x-small" height="17" align="right">120.000,00</td>
</tr>
<tr style="font-family:"Liberation Sans";font-size:x-small">
<td style="font-family:"Liberation Sans";font-size:x-small" height="17" align="right">120.000,00</td>
</tr>
</tbody></table>
</div><div><br></div><div><div style="font-family:times new roman,serif;font-size:large" class="gmail_default">Leio no RStudio com o comando: read.csv("dados.csv", sep = ',', dec = ",", header = TRUE), porém a variável vem sem casas decimais<br></div><div style="font-family:times new roman,serif;font-size:large" class="gmail_default"><br></div><div style="font-family:times new roman,serif;font-size:large" class="gmail_default"><img src="cid:ii_llqlm5lt0" alt="Captura de tela de 2023-08-25 09-58-01.png" width="434" height="20"><br></div><div style="font-family:times new roman,serif;font-size:large" class="gmail_default">Tentei converter com: <br><pre aria-label="Console Output" role="document" id="m_-6037602527536574613m_-2172428615309974398m_3386995487499888885gmail-rstudio_console_output" style="font-family:"Ubuntu Mono",monospace;font-size:13.3333px;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" style="outline:currentcolor none medium"><span style="color:blue"><a href="http://data.to.work" rel="noreferrer noreferrer" target="_blank">data.to.work</a>$Patrimonio <- as.double(<a href="http://data.to.work" rel="noreferrer noreferrer" target="_blank">data.to.work</a>$Patrimonio)</span></span></pre></div></div><div><br></div><div><div style="font-family:times new roman,serif;font-size:large" class="gmail_default">Porém só mudou para num e sem casas decimais.</div><div style="font-family:times new roman,serif;font-size:large" class="gmail_default"><br></div><div style="font-family:times new roman,serif;font-size:large" class="gmail_default">Onde estou errando?<br></div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font size="4" face="times new roman, serif"><i><span>In Jesu et Maria</span><br><br></i></font><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><font size="4" face="times new roman, serif"><i>Obrigado / Thank you<br></i></font></div><div><font size="4" face="times new roman, serif"><i>Prof. Dr. Elias Carvalho</i></font></div><div><font size="4" face="times new roman, serif"><i><br></i></font></div><div><font size="4" face="times new roman, serif"><i><div>"Felix, qui potuit rerum cognoscere causas" (Virgil 29 BC)</div><div>"Blessed is he who has been able to understand the cause of things"</div></i></font></div></div></div></div></div></div></div></div></div></div></div></div></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>
</blockquote></div>