Re: [R] aggregate.data.frame - prevent conversion to factors? show statistics for NA values of by variable?

2007-08-02 Thread Thomas Pujol
(myfactor.try1) str(myfactor.try2) Prof Brian Ripley [EMAIL PROTECTED] wrote: The behaviour has been changed in the R-devel version of R, so the 'by' columns are not converted to factors. On Tue, 31 Jul 2007, Thomas Pujol wrote: I have a two question regarding the aggregate.data.frame method

[R] aggregate.data.frame - prevent conversion to factors? show statistics for NA values of by variable?

2007-07-31 Thread Thomas Pujol
I have a two question regarding the aggregate.data.frame method of the aggregate function. My situation: a. My x variable is a data.frame (mydf) with two columns, both columns of type/format numeric. b. My by variable is a data.frame(mybys) with two columns, both columns of type/format

Re: [R] can I run/launch an excel VBA macro from wihin R?

2007-07-18 Thread Thomas Pujol
FYI, Here is a tip that Gabor Grothendieck sent to the r-com help-list. Thought others might find it helpful. http://mailman.csd.univie.ac.at/pipermail/rcom-l/2007-July/001717.html Subject: Re: [Rcom-l] running Excel/Visual Basic macro from within R[input] [input] [input]

[R] sqlSave, ...colnames=F, using odbcConnectExcel .... I still get colnames in top row of exprted sheet

2007-07-18 Thread Thomas Pujol
I am trying to save an R data.frame as an Excel sheet. I do NOT want the column names saved into row 1. I set colnames=F. However, it still seems that the colnames are saved into row 1. Is this a bug? Or am I coding incorrectly and.or misunderstanding this feature? #example code: sheet =

[R] can I run/launch an excel VBA macro from wihin R?

2007-07-16 Thread Thomas Pujol
Is there an easy or good way to run/launch an Excel VBA macro from within R? - Pinpoint customers who are looking for what you sell. [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch

Re: [R] calculating p-values of columns in a dataframe

2007-07-09 Thread Thomas Pujol
) if(fn.count(x)==0) NA else t.test(x)$statistic) } myfn.p.val - function(df) { apply(df,2,function(x) if(fn.count(x)==0) NA else t.test(x)$p.value) } Uwe Ligges [EMAIL PROTECTED] wrote: Thomas Pujol wrote: I have a dataframe (mydf) that contains differences of means. I wish to test whether

[R] calculating p-values of columns in a dataframe

2007-07-07 Thread Thomas Pujol
I have a dataframe (mydf) that contains differences of means. I wish to test whether these differences are significantly different from zero. Below, I calculate the t-statistic for each column. What is a good method to calculate/look-up the p-value for each column?

[R] what is better when combining data frames? merge vs. rbind cbind

2007-06-22 Thread Thomas Pujol
I often need to combine data frames, sometimes vertically and other times horizontally. When it better to use merge? When is it better to use rbind or cbind? Are there clear pros and cons of each approach? - [[alternative HTML version deleted]]

[R] speed issues / pros cons: dataframe vs. matrix

2007-06-22 Thread Thomas Pujol
I've read that certain operations performed on a matrix (e.g. ribind, cbind) are often much faster compared to operations performed on a data frame. Other then the bind functions, what are the main operations that are significantly faster on a a matrix? I know that data frames allow for

[R] shoudl I use apply, sapply, etc instead of a for loop?

2007-06-20 Thread Thomas Pujol
I have been trying to learn the various apply functions but am still learning their appropriate use. I appreciate any help the R community can offer me. Sorry for the length of this post. Background: I have data on my hard drive organized in the following manner: The data pertains to many