Re: [Rd] xyTable(x,y) versus table(x,y) with NAs

2023-04-25 Thread Serguei Sokol via R-devel
Le 25/04/2023 à 17:39, Bill Dunlap a écrit : x <- c(1, 1, 2, 2, 2, 3) y <- c(1, 2, 1, 3, NA, 3) str(xyTable(x,y)) List of 3 $ x : num [1:6] 1 1 2 2 NA 3 $ y : num [1:6] 1 2 1 3 NA 3 $ number: int [1:6] 1 1 1 NA NA 1 How many (2,3)s do we have? At least one, the third entry, bu

Re: [Rd] xyTable(x,y) versus table(x,y) with NAs

2023-04-25 Thread Bill Dunlap
x <- c(1, 1, 2, 2, 2, 3) y <- c(1, 2, 1, 3, NA, 3) > str(xyTable(x,y)) List of 3 $ x : num [1:6] 1 1 2 2 NA 3 $ y : num [1:6] 1 2 1 3 NA 3 $ number: int [1:6] 1 1 1 NA NA 1 How many (2,3)s do we have? At least one, the third entry, but the fourth entry, (2,NA), is possibly a (2,3) so

Re: [Rd] xyTable(x,y) versus table(x,y) with NAs

2023-04-25 Thread Viechtbauer, Wolfgang (NP)
Nice! Would this be something to consider as either a permanent fix to xyTable() (to me, the function is right now behaving in a rather unexpected manner, if not to say, buggy) or via an argument (for backwards compatability)? Best, Wolfgang >-Original Message- >From: Serguei Sokol [mai

Re: [Rd] xyTable(x,y) versus table(x,y) with NAs

2023-04-25 Thread Serguei Sokol via R-devel
I correct myself. Obviously, the line first[is.na(first) | isFALSE(first)] <- FALSE should read first[is.na(first)] <- FALSE Serguei. Le 25/04/2023 à 11:30, Serguei Sokol a écrit : Le 25/04/2023 à 10:24, Viechtbauer, Wolfgang (NP) a écrit : Hi all, Posted this many years ago (https://stat

Re: [Rd] xyTable(x,y) versus table(x,y) with NAs

2023-04-25 Thread Serguei Sokol via R-devel
Le 25/04/2023 à 10:24, Viechtbauer, Wolfgang (NP) a écrit : Hi all, Posted this many years ago (https://stat.ethz.ch/pipermail/r-devel/2017-December/075224.html), but either this slipped under the radar or my feeble mind is unable to understand what xyTable() is doing here and nobody bothered

[Rd] xyTable(x,y) versus table(x,y) with NAs

2023-04-25 Thread Viechtbauer, Wolfgang (NP)
Hi all, Posted this many years ago (https://stat.ethz.ch/pipermail/r-devel/2017-December/075224.html), but either this slipped under the radar or my feeble mind is unable to understand what xyTable() is doing here and nobody bothered to correct me. I now stumbled again across this issue. x <-