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
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
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
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"
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
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