<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12px"><div id="yui_3_16_0_1_1414528226140_9980" dir="ltr"><span id="yui_3_16_0_1_1414528226140_14196">Maraisa,</span></div><div id="yui_3_16_0_1_1414528226140_9980" dir="ltr"><span><br></span></div><div id="yui_3_16_0_1_1414528226140_9980" dir="ltr">A resposta fica limitada com a ausencia dos dados, mas me parece que você está referenciando as camadas do raster incorretamente (lembre-se que o pacote raster cria objetos de classe S4). Usar dois colchetes ao especificar a camada do raster deve resolver o seu problema (assumindo que as variaveis anteriores tenham sido criadas corretamente). Veja a diferença:</div><div id="yui_3_16_0_1_1414528226140_9980" dir="ltr"><br></div>
<div class="" style="" id="yui_3_16_0_1_1414528226140_13768"><span class="" style="" id="yui_3_16_0_1_1414528226140_13767">b <- brick(system.file("external/rlogo.grd", package="raster"))</span></div>
<div id="yui_3_16_0_1_1414528226140_9980" dir="ltr">b[1] #acessa os valores da primeira linha de cada camada</div><div id="yui_3_16_0_1_1414528226140_9980" dir="ltr">b[[1]] #aponta para a primeira camada</div><div id="yui_3_16_0_1_1414528226140_9980" dir="ltr"><br></div><div id="yui_3_16_0_1_1414528226140_9980" dir="ltr">Portanto, a minha recomendação para o seu código seria:</div><div id="yui_3_16_0_1_1414528226140_9980" dir="ltr"><br></div><div dir="ltr" id="yui_3_16_0_1_1414528226140_8995" style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" class=""><div class="" id="yui_3_16_0_1_1414528226140_9000" style=""><div class="" id="yui_3_16_0_1_1414528226140_9451" style=""><font face="courier new, monospace" id="yui_3_16_0_1_1414528226140_9450" class="" style="">vairaveis<-brick(stack(JJA[[1]]),anual[[1]],seasonal[[1]])</font></div><div class="" style="" id="yui_3_16_0_1_1414528226140_15126"><br></div></div></div><div id="yui_3_16_0_1_1414528226140_9980" dir="ltr">Saudações,<br></div><div id="yui_3_16_0_1_1414528226140_9966"><div id="yui_3_16_0_1_1414528226140_9965">--<br>Thiago V. dos Santos<br>PhD student<br>Land and Atmospheric Science<br>University of Minnesota<br>http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm<br>Phone: (612) 323 9898</div></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font size="2" face="Arial"> On Tuesday, October 28, 2014 11:42 AM, Maraisa Braga <bragamaraisa@gmail.com> wrote:<br> </font> </div> <br><br> <div class="y_msg_container"><div id="yiv2818407571"><div><div dir="ltr"><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;">Oi Davi!</div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;">Mas acho que não posso enviar meus dados em anexo. Eis um resumo do meu scrip:</div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;"><br clear="none"></div><div class="yiv2818407571gmail_default" style=""><div class="yiv2818407571gmail_default" style=""><font face="courier new, monospace">CCSM_0k<-read.table("bio_var_CCSM_0k_global.txt",h=T)</font></div><div class="yiv2818407571gmail_default" style=""><font face="courier new, monospace">seasonal_CCSM_0k<-stack(rasterFromXYZ(data.frame(CCSM_0k[,c(2:3)],CCSM_0k$bio.7)), </font></div><div class="yiv2818407571gmail_default" style=""><font face="courier new, monospace"> rasterFromXYZ(data.frame(CCSM_0k[,c(2:3)],CCSM_0k$bio.15)))</font></div><div class="yiv2818407571gmail_default" style=""><font face="courier new, monospace">anual_CCSM_0k<-stack(rasterFromXYZ(data.frame(CCSM_0k[,c(2:3)],CCSM_0k$bio.1)),</font></div><div class="yiv2818407571gmail_default" style=""><font face="courier new, monospace"> rasterFromXYZ(data.frame(CCSM_0k[,c(2:3)],CCSM_0k$bio.12)),</font></div><div class="yiv2818407571gmail_default" style=""><font face="courier new, monospace"> rasterFromXYZ(data.frame(CCSM_0k[,c(2:3)],CCSM_0k$bio.5)),</font></div><div class="yiv2818407571gmail_default" style=""><font face="courier new, monospace"> rasterFromXYZ(data.frame(CCSM_0k[,c(2:3)],CCSM_0k$bio.6)))</font></div><div class="yiv2818407571gmail_default" style=""><font face="courier new, monospace"><br clear="none"></font></div><div class="yiv2818407571gmail_default" style=""><font face="courier new, monospace">JJA<-list.files(pattern="JJA.grd")</font></div><div class="yiv2818407571gmail_default" style=""><font face="courier new, monospace">anual<-apropos(what="anual_")</font></div><div class="yiv2818407571gmail_default" style=""><font face="courier new, monospace">seasonal<-apropos(what="seasonal_")</font></div><div class="yiv2818407571gmail_default" style=""><font face="courier new, monospace"><br clear="none"></font></div><div class="yiv2818407571gmail_default" style=""><font face="courier new, monospace">vairaveis<-brick(stack(JJA[1]),anual[1],seasonal[1])</font></div></div></div><div class="yiv2818407571gmail_extra"><br clear="none"><div class="yiv2818407571yqt1980522051" id="yiv2818407571yqtfd28649"><div class="yiv2818407571gmail_quote">Em 28 de outubro de 2014 13:12, David Feitosa <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:contato@davidfeitosa.com" target="_blank" href="mailto:contato@davidfeitosa.com">contato@davidfeitosa.com</a>></span> escreveu:<br clear="none"><blockquote class="yiv2818407571gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div dir="ltr">Não tenho ideia do que seja isso, mas você não teria um exemplo de código que pudéssemos reproduzir?<div>Sem o código e o dataset fica um tanto complicado...</div></div><div class="yiv2818407571gmail_extra"><br clear="all"><div><div><br clear="none"></div><div><br clear="none"></div><div>Atenciosamente,</div><div><br clear="none"></div>David Feitosa<br clear="none"><div><div></div></div><div><br clear="none"></div><div><div>(\_(\</div><div>(=°;°)</div><div>(("")("")</div></div></div>
<br clear="none"><div class="yiv2818407571gmail_quote">Em 28 de outubro de 2014 11:51, Maraisa Braga <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:bragamaraisa@gmail.com" target="_blank" href="mailto:bragamaraisa@gmail.com">bragamaraisa@gmail.com</a>></span> escreveu:<br clear="none"><blockquote class="yiv2818407571gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="yiv2818407571h5"><div dir="ltr"><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;">Olá a todos!</div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;">Sou nova por aqui, então se cometer alguma gafe, por favor me avisem.</div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;"><br clear="none"></div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;">Preciso fazer rasterbricks de objetos que são rasterstacks e estão no meu ambiente do R com arquivos que tb são rasterstacks e estão no meu working diretory. Então, tenho isso:</div><div class="yiv2818407571gmail_default"><div class="yiv2818407571gmail_default"><font face="courier new, monospace">JJA<-list.files(pattern="JJA.grd")</font></div><div class="yiv2818407571gmail_default"><span style="font-family:'courier new', monospace;">seasonal<-apropos(what="seasonal_")</span><br clear="none"></div><div class="yiv2818407571gmail_default"><span style="font-family:'courier new', monospace;">anual<-apropos(what="anual_")</span><br clear="none"></div><div class="yiv2818407571gmail_default"><span style="font-family:'courier new', monospace;"><br clear="none"></span></div></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace">>JJA<br clear="none"></font></div><div class="yiv2818407571gmail_default"><div class="yiv2818407571gmail_default"><div class="yiv2818407571gmail_default"><font face="courier new, monospace"> [1] "CCSM_0k_JJA.grd" "CCSM_26_JJA.grd" "CCSM_85_JJA.grd" </font></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace"><br clear="none"></font></div><div class="yiv2818407571gmail_default"><div class="yiv2818407571gmail_default"><font face="courier new, monospace">> seasonal</font></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace"> [1] "seasonal_CCSM_0k" "seasonal_CCSM_26" "seasonal_CCSM_85" </font></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace"><br clear="none"></font></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace">> anual</font></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace"> [1] "anual_CCSM_0k" "anual_CCSM_26" "anual_CCSM_85" </font></div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;"><br clear="none"></div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;">Assim, os objetos "anual" e "seasonal" estão no ambiente do R e o objeto "JJA" está no working diretory.</div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;">Tentei fazer isso, mas não dá certo:</div><div class="yiv2818407571gmail_default"><font face="courier new, monospace"><br clear="none"></font></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace">>brick(stack(JJA[1]), anual[1], seasonal[1])<br clear="none"></font></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace">Error in round(nl) : non-numeric argument to mathematical function<br clear="none"></font></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace"><br clear="none"></font></div><div class="yiv2818407571gmail_default"><div class="yiv2818407571gmail_default"><font face="courier new, monospace">> brick(stack(JJA[1]), stack(anual[1]), stack(seasonal[1]))</font></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace">Error in .local(.Object, ...) : </font></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace"> `D:\...\seasonal_CCSM_0k' does not exist in the file system, and is not recognised as a supported dataset name.</font></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace"><br clear="none"></font></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace">Error in .rasterObjectFromFile(x, objecttype = "RasterBrick", ...) : </font></div><div class="yiv2818407571gmail_default"><font face="courier new, monospace"> Cannot create a RasterLayer object from this file. (file does not exist)</font></div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;"><br clear="none"></div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;">Alguma sugestão?</div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;"><br clear="none"></div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;">Maraísa</div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;"><br clear="none"></div><div class="yiv2818407571gmail_default" style="font-family:garamond, serif;font-size:large;"><br clear="none"></div></div></div></div></div></div>
<br clear="none"></div></div>_______________________________________________<br clear="none">
R-br mailing list<br clear="none">
<a rel="nofollow" shape="rect" 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">
<a rel="nofollow" shape="rect" 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><br clear="none">
Leia o guia de postagem (<a rel="nofollow" shape="rect" 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.<br clear="none"></blockquote></div><br clear="none"></div>
<br clear="none">_______________________________________________<br clear="none">
R-br mailing list<br clear="none">
<a rel="nofollow" shape="rect" 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">
<a rel="nofollow" shape="rect" 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><br clear="none">
Leia o guia de postagem (<a rel="nofollow" shape="rect" 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.<br clear="none"></blockquote></div><br clear="none"></div></div></div></div><br><div class="yqt1980522051" id="yqtfd53398">_______________________________________________<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ça código mínimo reproduzível.</div><br><br></div> </div> </div> </div> </div></body></html>