<div dir="ltr"><div>Olá Eder, tudo bem? Desculpe a demora em lhe retornar. Quero lhe agradecer pela atenção.<br> Eu ainda não tinha resolvido esta parte, era exatamente isso que queria.<br> Quando terminar o que estou fazendo compartilharei aqui na lista acredito que poderá se útil a outros<br><br></div><div>Mais uma vez meus sinceros agradecimentos.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">Em 2 de março de 2016 17:12, Éder Comunello <span dir="ltr"><<a href="mailto:comunello.eder@gmail.com" target="_blank">comunello.eder@gmail.com</a>></span> escreveu:<br><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:verdana,sans-serif">Fernando, boa tarde!</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Não sei se você já resolveu, mas consegui renomear as variáveis no exemplo que você tinha proposto...</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:monospace,monospace">### <code r></span><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:monospace,monospace">### dados pra testar</span></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">da.ori <- structure(list(Tubo = c(1L, 1L, 1L, 1L, 1L, 1L), Amostra = c(1L, </font></div><div class="gmail_default"><font face="monospace, monospace">1L, 1L, 1L, 1L, 1L), dieta = c(1L, 1L, 1L, 1L, 1L, 1L), concentracao = c(20L, </font></div><div class="gmail_default"><font face="monospace, monospace">20L, 20L, 20L, 20L, 20L), Tempo = 1:6, PG = c(4.18, 6.16, 8.13, </font></div><div class="gmail_default"><font face="monospace, monospace">9.94, 11.74, 13.72)), .Names = c("Tubo", "Amostra", "dieta", </font></div><div class="gmail_default"><font face="monospace, monospace">"concentracao", "Tempo", "PG"), row.names = c(NA, 6L), class = "data.frame")</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">require(rpanel)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">#-----------------------------------------------------------------------------</font></div><div class="gmail_default"><font face="monospace, monospace">myDB <- function(myPanel){ da <<- da.ori; print(head(da)); return(myPanel) }</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">ren_x <- function(myPanel){</font></div><div class="gmail_default"><font face="monospace, monospace"> var_indep <<- myPanel$var_x</font></div><div class="gmail_default"><font face="monospace, monospace"> colnames(da)[grep(var_indep, colnames(da))] <<- "x"</font></div><div class="gmail_default"><font face="monospace, monospace"> print(colnames(da)); return(myPanel)}</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">ren_y <- function(myPanel){</font></div><div class="gmail_default"><font face="monospace, monospace"> var_dep <<- myPanel$var_y</font></div><span class=""><div class="gmail_default"><font face="monospace, monospace"> colnames(da)[grep(var_dep, colnames(da))] <<- "y"</font></div></span><div class="gmail_default"><font face="monospace, monospace"> print(colnames(da)); return(myPanel)}</font></div><div class="gmail_default"><font face="monospace, monospace">#-----------------------------------------------------------------------------</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">{myPanel <- rp.control(title = "Adjust", size=c(500,100))</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">rp.button(myPanel, action=myDB, title="Importar dados / Reiniciar...") # botão importar bd</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">rp.textentry(panel=myPanel, variable=var_y,</font></div><span class=""><div class="gmail_default"><font face="monospace, monospace"> labels="nome da variável dependente(y):",</font></div><div class="gmail_default"><font face="monospace, monospace"> initval="",</font></div></span><div class="gmail_default"><font face="monospace, monospace"> action=ren_y)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">rp.textentry(panel=myPanel, variable=var_x,</font></div><span class=""><div class="gmail_default"><font face="monospace, monospace"> labels="nome da variável independente(x):",</font></div><div class="gmail_default"><font face="monospace, monospace"> initval="",</font></div></span><div class="gmail_default"><font face="monospace, monospace"> action=ren_x)}</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"># rp.control.dispose(myPanel)</font></div><div class="gmail_default"><font face="monospace, monospace">### </code></font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"><img src="cid:ii_ilba1n4v0_15338f4258bc3755" height="146" width="508"><br><br></font></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div></div><span class=""><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font style="font-size:small" face="arial, helvetica, sans-serif"><div style="font-family:'trebuchet ms',sans-serif;display:inline"></div></font><font style="font-size:12.8px" face="arial, helvetica, sans-serif"><span style="font-size:small">================================================</span><br>Éder Comunello</font><div style="font-size:12.8px"><span style="font-family:arial,helvetica,sans-serif">Agronomist (UEM), MSc in Environ. Sciences (UEM)</span><font face="arial, helvetica, sans-serif"><br></font></div><div style="font-size:12.8px"><div style="font-size:small"><span style="font-family:arial,helvetica,sans-serif">DSc in Agricultural Systems Engineering (USP/Esalq)</span><br></div><div><span style="font-size:small">Brazilian Agricultural Research Corporation (</span><font style="font-size:small" face="arial, helvetica, sans-serif">Embrapa)</font></div><div><div><font style="font-size:small" face="arial, helvetica, sans-serif">Dourados, MS, Brazil </font><font face="arial, helvetica, sans-serif" size="2">|<O>|</font></div><div style="font-size:small"><span style="font-family:arial,helvetica,sans-serif">================================================</span><br></div></div></div><div style="font-size:small"><font face="arial, helvetica, sans-serif">GEO, </font>-22.2752, -54.8182, 408m<span style="font-family:arial,helvetica,sans-serif"><br></span></div><div style="font-size:12.8px"><span style="font-size:small;font-family:arial,helvetica,sans-serif">UTC-04:00 / DST: UTC-03:00</span></div><div><div><div><br></div><div><br></div></div><div style="font-size:small"><br></div></div></div></div></div></div></div></div></div></div></div></div></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">=======================================================================<br>Fernando Souza<br>Zootecnista, DSc. Produção Animal<br><a href="mailto:e-mail%3Anandodesouza@gmail.com" target="_blank">e-mail:nandodesouza@gmail.com</a><br><a href="https://producaoanimalcomr.wordpress.com/" target="_blank">https://producaoanimalcomr.wordpress.com/</a><br>========================================================================<br></div></div></div></div></div></div></div></div>
</div>