<div dir="ltr">Isto serve?<div><br></div><div><pre tabindex="0" class="gmail-GCWXI2KCJKB" id="gmail-rstudio_console_output" style="font-family:Consolas,"Lucida Console",monospace;font-size:13.8667px;outline:none;border:none;word-break:break-all;margin-top:0px;margin-bottom:0px;line-height:1.1;color:rgb(255,255,255);background-color:rgb(0,34,64);white-space:pre-wrap"><span class="gmail-GCWXI2KCPKB gmail-ace_keyword" style="color:rgb(255,157,0);white-space:pre">> </span><span class="gmail-GCWXI2KCPJB gmail-ace_keyword" style="color:rgb(255,157,0)">A
</span>8 x 10 sparse Matrix of class "dgCMatrix"
[1,] . 7 . . . . . . . .
[2,] . . . . . . . . . .
[3,] . . . . . . . . 14 .
[4,] . . . . . 21 . . . .
[5,] . . . . . . 28 . . .
[6,] . . . . . . . 35 . .
[7,] . . . . . . . . 42 .
[8,] . . . . . . . . . 49<br></pre><pre tabindex="0" class="gmail-GCWXI2KCJKB" id="gmail-rstudio_console_output" style="font-family:Consolas,"Lucida Console",monospace;font-size:13.8667px;outline:none;border:none;word-break:break-all;margin-top:0px;margin-bottom:0px;line-height:1.1;color:rgb(255,255,255);background-color:rgb(0,34,64);white-space:pre-wrap"><span class="gmail-GCWXI2KCPKB gmail-ace_keyword" style="color:rgb(255,157,0);white-space:pre">> mat_A <- </span><span class="gmail-GCWXI2KCPJB gmail-ace_keyword" style="color:rgb(255,157,0)">as.matrix(A)</span></pre><pre tabindex="0" class="gmail-GCWXI2KCJKB" id="gmail-rstudio_console_output" style="font-family:Consolas,"Lucida Console",monospace;font-size:13.8667px;outline:none;border:none;word-break:break-all;margin-top:0px;margin-bottom:0px;line-height:1.1;color:rgb(255,255,255);background-color:rgb(0,34,64);white-space:pre-wrap"><span class="gmail-GCWXI2KCPJB gmail-ace_keyword" style="color:rgb(255,157,0)">> mat_A
</span> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 0 7 0 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0 0 14 0
[4,] 0 0 0 0 0 21 0 0 0 0
[5,] 0 0 0 0 0 0 28 0 0 0
[6,] 0 0 0 0 0 0 0 35 0 0
[7,] 0 0 0 0 0 0 0 0 42 0
[8,] 0 0 0 0 0 0 0 0 0 49</pre></div><div class="gmail_extra"><br></div><div class="gmail_extra">A classe será `matrix` e está com zero no lugar dos pontos.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div>Atenciosamente,</div><div><br></div><div dir="ltr">Tomás Barcellos<div><br></div></div></div></div></div></div><div class="gmail_quote">Em 14 de setembro de 2017 10:33, Edimeire Alexandra Pinto via R-br <span dir="ltr"><<a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a>></span> escreveu:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:13px"><div id="m_-8255376730302293372yui_3_16_0_ym19_1_1505395712297_4625">Bom dia.</div><div id="m_-8255376730302293372yui_3_16_0_ym19_1_1505395712297_4625"><br></div><div id="m_-8255376730302293372yui_3_16_0_ym19_1_1505395712297_4625">Gente, alguem sabe como transformar objetos do tipo sparseMatrix em matrizes porem com zeros onde tem pontos, veja exemplo abaixo. Obs: tem de ser como classe matriz, ou seja, class(A) tem de retornar matriz.</div><div id="m_-8255376730302293372yui_3_16_0_ym19_1_1505395712297_4625"><br></div><div id="m_-8255376730302293372yui_3_16_0_ym19_1_1505395712297_4625"><br></div><div id="m_-8255376730302293372yui_3_16_0_ym19_1_1505395712297_4625"><br></div><div id="m_-8255376730302293372yui_3_16_0_ym19_1_1505395712297_4625">i <- c(1,3:8); j <- c(2,9,6:10); x <- 7 * (1:7)</div><div dir="ltr" id="m_-8255376730302293372yui_3_16_0_ym19_1_1505395712297_4626">(A <- sparseMatrix(i, j, x = x))</div><div dir="ltr" id="m_-8255376730302293372yui_3_16_0_ym19_1_1505395712297_4626"><br></div><div dir="ltr" id="m_-8255376730302293372yui_3_16_0_ym19_1_1505395712297_4626"><br></div></div></div><br>______________________________<wbr>_________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="noreferrer" target="_blank">https://listas.inf.ufpr.br/<wbr>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" target="_blank">http://www.leg.ufpr.br/r-br-<wbr>guia</a>) e forneça código mínimo reproduzível.<br></blockquote></div><br></div></div>