Hi,
I have the following code which works successfully

t.test.results<- list()
for (i in 1:6) {
y=read.csv('Sharpe_window1.csv',header = T)
y$Data<-NULL
x1=as.numeric(y[,2])
y1=as.numeric(y[,i])
tempdata= augmented_t.test(x1,y1)$diff
t.test.results[[i]]<- tempdata
}

I want to generate this former code for different csv files and store the results same as what I did before .

I have 4 csv files. I read those files by

for(i in 1:4)
{
oname = paste("Sharpe_window", i, sep="")
assign(oname, read.csv(paste(oname, ".csv", sep="")))
}

Now I am trying to generate for loop for each files and store the results for each files as follow:

total.t.test.results<- list()
for (k in 1:4){
sample.t.test.results<- list()
for (i in 1:6) {
y=read.csv('Sharpe_window[[k]].csv')
y$Data<-NULL
x1=as.numeric(y[,2])
y1=as.numeric(y[,i])
tempdata= augmented_t.test(x1,y1)$diff
sample.t.test.results[[i]]<- tempdata
}
total.t.test.results[[k]]=sample.t.test.results
}

but I am receiving an error . Can you please help me to solve the problem