<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Olá, pessoal! Boa tarde!<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Uma ideia é entrar com múltiplos comandos para os argumentos e acionar o script com source().<br></div><br><div class="gmail_default" style="font-family:verdana,sans-serif">###</div><br><span style="font-family:monospace,monospace">C:\Program Files\R\R-2.15.3\bin>echo print(a+b) > script.R<br><br>C:\Program Files\R\R-2.15.3\bin>type script.R<br>print(a+b)<br><br>C:\Program Files\R\R-2.15.3\bin>R -e "a=2; b=3; source('script.R')<br><br>R version 2.15.3 (2013-03-01) -- "Security Blanket"<br>Copyright (C) 2013 The R Foundation for Statistical Computing<br>ISBN 3-900051-07-0<br>Platform: i386-w64-mingw32/i386 (32-bit)<br><br>R is free software and comes with ABSOLUTELY NO WARRANTY.<br>You are welcome to redistribute it under certain conditions.<br>Type 'license()' or 'licence()' for distribution details.<br><br> Natural language support but running in an English locale<br><br>R is a collaborative project with many contributors.<br>Type 'contributors()' for more information and<br>'citation()' on how to cite R or R packages in publications.<br><br>Type 'demo()' for some demos, 'help()' for on-line help, or<br>'help.start()' for an HTML browser interface to help.<br>Type 'q()' to quit R.<br><br>> a=2; b=3; source('script.R')<br><span style="background-color:rgb(255,0,0)"><b>[1] 5</b></span><br>><br>><br><br>C:\Program Files\R\R-2.15.3\bin></span><br><div class="gmail_extra"><br clear="all"><div><div 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"><span><br>================================================<br>Éder Comunello<br>Researcher at Brazilian Agricultural Research Corporation (Embrapa)<br>DSc in Agricultural Systems Engineering (USP/Esalq)<br>MSc in Environ. Sciences (UEM), <span>Agronomist (UEM)</span><br>---<br>Embrapa Agropecuária Oeste, Dourados, MS, Brazil |<O>|<br>================================================<br>GEO, -22.2752, -54.8182, 408m<br>UTC-04:00 / DST: UTC-03:00</span><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></div>
<br><div class="gmail_quote">Em 26 de outubro de 2016 08:58, Walmes Zeviani 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 dir="ltr"><div style="font-family:trebuchet ms,sans-serif">Usando o DOS sinceramente eu não sei. Usando Shell linux eu tenho alguns scripts que recebem argumentos na linha de comando. Alguns exemplos:<br><br><a href="http://stackoverflow.com/questions/2151212/how-can-i-read-command-line-parameters-from-an-r-script" target="_blank">http://stackoverflow.com/<wbr>questions/2151212/how-can-i-<wbr>read-command-line-parameters-<wbr>from-an-r-script</a><br><a href="http://stackoverflow.com/questions/14167178/passing-command-line-arguments-to-r-cmd-batch" target="_blank">http://stackoverflow.com/<wbr>questions/14167178/passing-<wbr>command-line-arguments-to-r-<wbr>cmd-batch</a><br><a href="http://stackoverflow.com/questions/26691764/r-rscript-vector-as-argument" target="_blank">http://stackoverflow.com/<wbr>questions/26691764/r-rscript-<wbr>vector-as-argument</a><br><a href="https://linuxconfig.org/how-to-access-a-command-line-arguments-using-rscript-gnu-r" target="_blank">https://linuxconfig.org/how-<wbr>to-access-a-command-line-<wbr>arguments-using-rscript-gnu-r</a><br><a href="http://www.milanor.net/blog/bashr-howto-pass-parameters-from-bash-script-to-r/" target="_blank">http://www.milanor.net/blog/<wbr>bashr-howto-pass-parameters-<wbr>from-bash-script-to-r/</a><br><br>À disposição.<br></div><div style="font-family:trebuchet ms,sans-serif">Walmes.<br></div><div style="font-family:trebuchet ms,sans-serif"><br></div><br></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>