[Rd] print.data.frame function with option na.print=" " actually prints NA

2012-07-03 Thread Ole Fredslund Christensen
Dear R developers I thought I better report this behavior. Example: > print(matrix(c(1,NA,1,1),2,2), na.print="") [,1] [,2] [1,]11 [2,] 1 > print(as.data.frame(matrix(c(1,NA,1,1),2,2)), na.print="") V1 V2 1 1 1 2 NA 1 The help-file for print.data.frame gives me the im

[Rd] print method for summary adds trailing zero

2012-03-02 Thread Ole Fredslund Christensen
Dear R-devel Thought I better report this. An example is shown below. > vec <- rnorm(100)+10.5 > ss <- summary(vec) > print(ss) Min. 1st Qu. MedianMean 3rd Qu.Max. 8.433 9.886 10.450 10.560 11.300 12.720 > for(kk in 1:length(ss)) print(ss[[kk]]) [1] 8.433 [1] 9.886 [1] 10.45 [

[Rd] crossprod is slower than t(AA)%*BB

2008-03-11 Thread Ole Fredslund Christensen
Dear Rdevelopers The background for this email is that I was helping a PhD student to improve the speed of her R code. I suggested to replace calls like t(AA)%*% BB by crossprod(AA,BB) since I expected this to be faster. The surprising result to me was that this change actually made her code slo