Hi, i'm dealing with time-histories included in two different data-frames. Both dataframes contain the same number of time-series (say N columns). I need to select the first column of dataframe1 in order to convolve it with the N-th column of the dataframe2.
So i was hoping to work by using indexes to select the desidered columns in each data-frame .
Here the code i try, obtaining messages as follows
Error in fft(x) non-numeric argument
**1: Unknown or uninitialised column: chd
. *
*2: Unknown or uninitialised column: chr
.
I'm rather new to R, i was using VBA for long time in the past, did i miss some basic rule in R?
# Rename columns
i <- 0
for (i in 0:49){
nome <-paste("ch",i,sep = "")
colnames(dataframe1)[i]=nome
colnames(dataframe2)[i]=nome
}
#Apply convolution to selected columns
d <-1
r <-49
i <-0
for(i in 1:49){
d <- d+1
r <- r-1
i <- i+1
chd <-paste("ch",d,sep= "")
chr <-paste("ch",r,sep= "")
sh1 <-dataframe1$chd
sh2 <-dataframe2$chr
sg(i)=convolve(sh1,sh2,type="circular")
}