R: [R] apply function

Guazzetti Stefano Stefano.Guazzetti at ausl.re.it
Wed Oct 20 19:01:43 CEST 2004

you seem to need

apply(mat, 1, tabulate, nbins=4)

isnt it?


-----Messaggio originale-----
Da: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch]Per conto di Eric Pellegrini
Inviato: mercoledì 20 ottobre 2004 18.54
A: R-help at stat.math.ethz.ch
Oggetto: [R] apply function

Hi all,

I have a question about apply function. Is that possible to pass some 
non-default arguments in the function we want to apply ?

For example:

if "mat" is a matrix and I want to use the "tabulate" function on its row.

The command apply(mat,1,tabulate) works but I have problem with this one 
apply(mat, 1, tabulate(nbins=4)).

Any clue ?



Eric Pellegrini, PhD
University of Erlangen-Nürnberg
Nägelbachstraße, 25
D-91052 Erlangen

R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

More information about the R-help mailing list