I am trying to speed my code by using lapply instead of for loop to provide functions variables in the lapply function I provide all functions variables in lapply function. but it gives me this error, what is the problem in here ?
Error in functionE(A[[i]],A,weight) :
argument "weight" is missing, with no default
code structure :
weight<-weight
A<-functionB() #A is a list
C<-lapply(1:length(A),function(i,A,weight){
if(functionE(A[[i]],A,weight)==TRUE)
#some other functions
return(A)
})
EDIT :actually A
is list of graphs (for the simplicity , I lay out like that)
for (i in 1:vcount(A[[1]])
{
#some function and if condition that needs((weight and, A))
#there is a function which return j
V(A[[1]])[i]$attribute2<-V(A[[1]])[j]$attribute1
}
so I want to access A
which changes in the for.