[Rd] summary() does not count missing characters

2024-06-10 Thread Yifan Liu
as.character(NA) |> rep(times = 10) |> summary() vs. as.numeric(NA) |> rep(times = 10) |> summary() This feels inconsistent, doesn't it? I constantly need to count missing characters in some data.frame columns. It would be helpful if summary() can do that. Thanks. Sincerely, Yifan Liu [

Re: [Rd] head.ts, tail.ts loses time

2024-06-10 Thread Spencer Graves
Hi, Gabor et al.: Thanks for this. I should change my current application to use either zoo or xts, as Gabor suggests. However, I was surprised to learn that "[.ts" does NOT return an object of class "ts". I see that "head.default" and "head.matrix" both call "[", so "head" cannot re

Re: [Rd] changes in R-devel and zero-extent objects in Rcpp

2024-06-10 Thread Mikael Jagan
> Date: Sat, 8 Jun 2024 19:16:22 -0400 > From: Ben Bolker > > The ASAN errors occur *even if the zero-length object is not actually > accessed*/is used in a perfectly correct manner, i.e. it's perfectly > legal in base R to define `m <- numeric(0)` or `m <- matrix(nrow

Re: [Rd] head.ts, tail.ts loses time

2024-06-10 Thread Martin Maechler
> Spencer Graves > on Mon, 10 Jun 2024 07:50:13 -0500 writes: > Hi, Gabor et al.: Thanks for this. I should change my > current application to use either zoo or xts, as Gabor > suggests. > However, I was surprised to learn that "[.ts" does NOT > return an obj

Re: [Rd] head.ts, tail.ts loses time

2024-06-10 Thread Spencer Graves
Hi, Martin et al.: On 6/10/24 9:32 AM, Martin Maechler wrote: Spencer Graves on Mon, 10 Jun 2024 07:50:13 -0500 writes: > Hi, Gabor et al.: Thanks for this. I should change my > current application to use either zoo or xts, as Gabor > suggests. > However, I

Re: [Rd] changes in R-devel and zero-extent objects in Rcpp

2024-06-10 Thread Ben Bolker
Thanks, that's very useful. AFAICT, in the problematic case we are doing some linear algebra with zero-column matrices that are mathematically well-defined (and whose base-R equivalents work correctly). It's maybe not surprising that Eigen/RcppEigen would do some weird stuff in this edge c