search for: mean_on_el

Displaying 1 result from an estimated 1 matches for "mean_on_el".

2011 Aug 08
2
enclosing with() in a function
Hi All, I want to enclose with() in a function mean_on_element. Obviously, it is not working. The problem is how to specify the element name with a function body. Does anybody have any suggestion? Thanks! > data=list(x=1:10) > with(data, mean(x)) [1] 5.5 > > mean_on_element=function(data, elem_name) { + with(data, mean(elem_name)) + } >...