Re: [R] apply ? function doesnt create object

2007-03-03 Thread Charilaos Skiadas
On Mar 3, 2007, at 4:28 PM, bunny , lautloscrew.com wrote: Please use <- for assignments instead of = : > getans = function(x=qids,bnr=1,type="block") > { > #generate name of matrix > matnam=paste("ans",type,as.character(bnr),sep="") > > #display result matrix > show(assign(matnam,matrix(as

[R] apply ? function doesnt create object

2007-03-03 Thread bunny , lautloscrew.com
hello, i have written a function to extract certain lines from a matrix. the result is a matrix with 6 cols, named dynamically according to the functions arguments. the problem is now, that i'm not able to return the resultmatrix for further use. the object is not being created. example fro

Re: [R] apply function

2004-10-20 Thread Peter Dalgaard
Eric Pellegrini <[EMAIL PROTECTED]> writes: > 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 co

RE: [R] apply function

2004-10-20 Thread Liaw, Andy
Try apply(mat, 1, tabulate, nbins=4). HTH, Andy > From: Eric Pellegrini > > 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"

R: [R] apply function

2004-10-20 Thread Guazzetti Stefano
you seem to need apply(mat, 1, tabulate, nbins=4) isnt it? Stefano -Messaggio originale- Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] conto di Eric Pellegrini Inviato: mercoledì 20 ottobre 2004 18.54 A: [EMAIL PROTECTED] Oggetto: [R] apply function Hi all, I have a question about

[R] apply function

2004-10-20 Thread Eric Pellegrini
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 on