Dear list, I have some difficulty in manipulating list elements. More specifically, I am performing svm regression and have a list of lists, called pred.svm. The elements of the second list are 3D arrays. Thus I have pred.svm[[i]][[j]], with 1<=i<=5 and 1<=j<=20. I want to take the sum of the elements a specific array dimension across all j, for one i. Mathematically speaking, I want to calculate *W* as:
*W = pred.svm[[i]][[1]][1,2,5] + pred.svm[[i]][[2]][1,2,5]+ pred.svm[[i]][[3]][1,2,5]+...+ pred.svm[[i]][[20]][1,2,5]* I have tried to apply the *lapply() *function but it seems that its arguments can only be vector elements of a list...Do I need to convert the array data to vector data? Any advice would be very welcome! Thanks a lot, Eleni [[alternative HTML version deleted]] ______________________________________________ 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.