[R-br] Problemas nos scripts

Mauro Sznelwar sznelwar em uol.com.br
Sexta Janeiro 20 22:47:55 BRST 2012


Alguém sabe como corrigir estes dois scrpits para rodar?
primeiro script
f.4 = rnorm(30)*dnorm(1)
x<-seq(-10,10,length= 30))
y<-x
z<-c(x, y, f.4)
persp(z)
Erro em seq.default(0, 1, length.out = ncol(z)) : 
  argument 'length.out' must be of length 1
---------------------------------------------------------------------------------------------------
segundo script
frames = 5
for(i in 1:frames){
 
 x = seq(0, i, 1)
 f.4 = rnorm(30)*dnorm(1)

 if (i <= 5) {name = paste('000',i,'plot.jpeg',sep='')}

 #saves the plot as a .jpeg file in the working directory
 jpeg(name)
 contour(f.4, ylab ='probability',main = paste('Normal density with n = ', i), col = 'red')
 dev.off()
}
Erro em seq.default(0, 1, length.out = ncol(z)) : 
  argument 'length.out' must be of length 1

-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20120120/40d94855/attachment.html>


Mais detalhes sobre a lista de discussão R-br