Re: [R] Using apply() with functions I wrote

2014-07-24 Thread Peter Alspach
: r-help@r-project.org Subject: [R] Using apply() with functions I wrote Hello! Does apply() not work with customized functions? Here is a simple example: AddSeven<-function(n){n+7} AddSeven(3) [1] 10 M<-matrix(nrow=2,ncol=2,data=c(1,2,3,4),byrow=TRUE)

Re: [R] Using apply() with functions I wrote

2014-07-24 Thread Pfeiffer, Steven
Ugghh... Sorry for bothering you all!! (Yes, I analyzed the data for my ecology M.S. project with R, but I wasted countless hours committing silly mistakes like this.) On Thu, Jul 24, 2014 at 4:11 PM, Bert Gunter wrote: > ummm R is case sensitive! "fun" != "FUN" > > (Have you gone throug

Re: [R] Using apply() with functions I wrote

2014-07-24 Thread Bert Gunter
ummm R is case sensitive! "fun" != "FUN" (Have you gone through any R tutorials yet? If not, please do so before posting further). Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly n

[R] Using apply() with functions I wrote

2014-07-24 Thread Pfeiffer, Steven
Hello! Does apply() not work with customized functions? Here is a simple example: AddSeven<-function(n){n+7} AddSeven(3) [1] 10 M<-matrix(nrow=2,ncol=2,data=c(1,2,3,4),byrow=TRUE) M [,1] [,2] [1,]12 [2,]34 apply(x=M,margin