<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:14pt"><div><span><div class="MsoNormal"><span class="apple-style-span"><span style="color:#454545;
background:white">Benilton, o que eu quero é um plot das funções e não dos
pontos. Operacionalizar o que esta em vermelho abaixo.<o:p></o:p></span></span></div>
<div class="MsoNormal"><span class="apple-style-span"><span style="color:#454545;
background:white">Obrigado. Emmanuel<o:p></o:p></span></span></div>
<div class="MsoNormal"><span class="apple-style-span"><span style="color:#454545;
background:white"><o:p> </o:p></span></span></div>
<div class="MsoNormal"><span class="apple-style-span"><span style="color:#454545;
background:white">x0 = sort(rnorm(10))</span></span><span style="color:#454545"><br>
<span class="apple-style-span"><span style="background:white"><span style="float: none; ">f1 = function(x) x^1</span></span><br>
<span class="apple-style-span"><span style="background:white"><span style="float: none; ">f2 = function(x) x^2</span></span><br>
<span class="apple-style-span"><span style="background:white"><span style="float: none; ">f3 = function(x) x^3</span></span></span><br>
<span class="apple-style-span"><span style="background:white"><span style="float: none; ">listaFs = list(f1,
f2, f3)</span></span></span><br>
<span class="apple-style-span"><span style="background:white"><span style="float: none; ">resul</span></span></span><span class="apple-style-span"><span lang="EN-US" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; background-position: initial initial; background-repeat: initial initial; ">ts = do.call(cbind, lapply(listaFs, function(myf,
myarg) myf(myarg), x0))</span></span></span><span lang="EN-US"><br>
<span class="apple-style-span"><span style="background:white"><span style="float: none; ">matplot(x0,
results, type='l')</span></span></span></span><span lang="EN-US"><o:p></o:p></span></span></span></div>
<div class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></div>
<div class="MsoNormal"><span lang="EN-US" style="color:red;mso-ansi-language:EN-US">plot(f1,
1,10)<o:p></o:p></span></div>
<div class="MsoNormal"><span lang="EN-US" style="color:red;mso-ansi-language:EN-US">plot(f2,
1,10, add=T, col=2, lty=2)<o:p></o:p></span></div>
<div class="MsoNormal"><span lang="EN-US" style="color:red;mso-ansi-language:EN-US">plot(f3,
1,10, add=T, col=3, lty=3)<o:p></o:p></span></div></span></div><div><br></div> <div style="font-size: 14pt; font-family: 'times new roman', 'new york', times, serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">De:</span></b> Benilton Carvalho <beniltoncarvalho@gmail.com><br> <b><span style="font-weight: bold;">Para:</span></b> r-br@listas.c3sl.ufpr.br <br> <b><span style="font-weight: bold;">Enviadas:</span></b> Terça-feira, 6 de Dezembro de 2011 3:10<br> <b><span style="font-weight: bold;">Assunto:</span></b> Re: [R-br] Plotar uma lista de funções em um único gráfico<br> </font> <br>set.seed(1)<br>x0 = sort(rnorm(10))<br>f1 = function(x) x^2<br>f2 = dnorm<br>f3 = function(x) x^3<br>listaFs = list(f1, f2, f3)<br>results = do.call(cbind, lapply(listaFs, function(myf, myarg) myf(myarg), x0))<br>matplot(x0, results,
type='l')<br>_______________________________________________<br>R-br mailing list<br><a ymailto="mailto:R-br@listas.c3sl.ufpr.br" 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" 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" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br><br><br> </div> </div> </div></body></html>