On the contrary: it is trivial to produce the result.

x <- c(1,2,3,4,5)
y <- c(6,7,8,9)
convolve(x, rev(y), type="open")
# [1]   6  19  40  70 100  94  76  45

Try help("convolve").

Allan


On 04/06/10 19:21, Moohwan Kim wrote:
Dear R-help,

I want to generate the following outcome using the convolution of two sequences.

x<- c(1,2,3,4,5)
y<- c(6,7,8,9)

The resulting convolution vector is
6
19
40
70
100
94
76
45
When using convolve(), it is hard to produce the result above.
Would you help me out to get that?



______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to