r - Apply function over list of vectors -


i have list of vectors:

[[1]] [1] 4 2 2  5 6 5  [[2]] [1] 30 9 320 2 ... [[99]] 

i apply function on of vectors in list.

sapply(1:99, function(x) listofvectors[[x]], max) 

i error:

error in fun(1:99[[1l]], ...) : unused argument (.primitive("max")) 

i same error mean() or other function. doing wrong?

change code to:

sapply(1:99, function(x) max(listofvectors[[x]])) 

or directly use

sapply(listofvectors, max) 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -