[Rd] R 'base' returning 0 as sum of NAs

2017-01-11 Thread Alex Ivan Howard
Dear R Team The following line returns 0 (zero) as answer: sum(c(NA_real_, NA_real_, NA_real_, NA_real_), na.rm = TRUE) One would, however, have expected it to return 'NaN', as is the case with function 'mean': > mean(c(NA_real_, NA_real_, NA_real_, NA_real_), na.rm = TRUE) [1] NaN The problem

Re: [Rd] R 'base' returning 0 as sum of NAs

2017-01-11 Thread Duncan Murdoch
On 11/01/2017 5:33 AM, Alex Ivan Howard wrote: Dear R Team The following line returns 0 (zero) as answer: sum(c(NA_real_, NA_real_, NA_real_, NA_real_), na.rm = TRUE) One would, however, have expected it to return 'NaN', as is the case with function 'mean': mean(c(NA_real_, NA_real_, NA_real_

Re: [Rd] accelerating matrix multiply

2017-01-11 Thread Cohn, Robert S
> Do you have R code (including set.seed(.) if relevant) to show on how to > generate > the large square matrices you've mentioned in the beginning? So we get to > some > reproducible benchmarks? Hi Martin, Here is the program I used. I only generate 2 random numbers and reuse them to make t

Re: [Rd] bug with strptime, %OS, and "."

2017-01-11 Thread Upton, Stephen (Steve) (CIV)
Works for me: > strptime("17_35_14.01234.mp3","%H_%M_%OS")$sec [1] 14.01234 > strptime("17_35_14.mp3","%H_%M_%OS")$sec [1] 14 Just leave off the ".mp3" in your time pattern. Relevant section from the help ("Details") for strptime: strptime converts character vectors to class "POSIXlt": its input