Re: [R] Problems plotting a function defined as a product

2006-07-13 Thread Jacques VESLOT
plot(t, sapply(t,g)) --- Jacques VESLOT CNRS UMR 8090 I.B.L (2ème étage) 1 rue du Professeur Calmette B.P. 245 59019 Lille Cedex Tel : 33 (0)3.20.87.10.44 Fax : 33 (0)3.20.87.10.31 http://www-good.ibl.fr

[R] Problems plotting a function defined as a product

2006-07-13 Thread Alessandro Antonucci
In order to define a function f as: > f <- function(x) (x+1)*(x+2) I want to use the notation: > v = c(1,2) > g <- function(x) prod((v+x)) That apparently works and, for instance, the loop: >for (i in 1:100) { print(f(i)-g(i)) } Produces a sequence of zeros. Nevertheless, if I try to plot t