similar to: xyTable(x,y) versus table(x,y) with NAs

Displaying 20 results from an estimated 3000 matches similar to: "xyTable(x,y) versus table(x,y) with NAs"

2023 Apr 25
1
xyTable(x,y) versus table(x,y) with NAs
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.ethz.ch/pipermail/r-devel/2017-December/075224.html),
2023 Apr 25
1
xyTable(x,y) versus table(x,y) with NAs
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 to correct me. I now stumbled again across this issue. > > x <- c(1, 1, 2, 2, 2,
2023 Apr 25
1
xyTable(x,y) versus table(x,y) with NAs
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 we don't know and make the count NA. I suspect this is not the intended logic, but a
2017 Dec 12
0
xyTable(x,y) versus table(x,y) with NAs
Hi All, It seems to me that xyTable() gets thrown off by NAs: x <- c(1, 1, 2, 2, 2, 3) y <- c(1, 2, 1, 3, NA, 3) table(x, y, useNA="always") xyTable(x, y) Is this intended behavior? Best, Wolfgang
2017 Jan 19
2
xtabs(), factors and NAs
Hi all, I know this issue has been discussed a few times in the past already, but Martin Maechler suggested in a bug report [1] that I raise it here. Basically, there is no (easy) way of printing NAs for all variables when calling xtabs() on factors. Passing 'exclude=NULL, na.action=na.pass' works for character vectors, but not for factors. > test <-
2011 Sep 14
1
svytable including NAs
Dear all I'm creating two way tables based on weighted survey data using svytable and want to include NAs as a level in the table. For unweighted data I use table(..., useNA="ifany"). Is there any equivalent for svytable? If not, is there a solution using a different function? Thanks Tim -- Tim Elwell-Sutton The University of Hong Kong Office: 3906 2053 Mob: 6084 5654
2007 Aug 14
2
Using sunflowerplot to add points in a xyplot panel
Hi, I use panel.points to add points to a xyplot graphic. But I like to use the sunflowerplot to plot my points because this is very superimposed. It is possible to use this? I try but it dont work directly. It may be need to put this function inside a panel.??? Thanks Ronaldo -- Where there's a will, there's a relative. -- > Prof. Ronaldo Reis J?nior | .''`.
2016 Aug 11
2
table(exclude = NULL) always includes NA
I stand corrected. The part "If set to 'NULL', it implies 'useNA="always"'." is even in the documentation in R 2.8.0. It was my fault not to check carefully. I wonder, why "always" was chosen for 'useNA' for exclude = NULL. Why exclude = NULL is so special? What about another 'exclude' of length zero, like character(0) (not c(),
2010 Jan 07
2
table() and setting useNA to be there by default?
Good morning, Is there a way to get table() to default to including NAs - as in... table(..., useNA='ifany') or table(..., useNA='always') or table(..., exclude=NULL) ? I can't see a way under table() or options() or searching the archives (probably using the wrong keyword?). > t1 <- c(1,2,3,3,3,2,NA,NA,NA,NA) > table(t1) t1 1 2 3 1 2 3 I keep forgetting to
2016 Aug 07
2
table(exclude = NULL) always includes NA
This is an example from https://stat.ethz.ch/pipermail/r-help/2007-May/132573.html . With R 2.7.2: > a <- c(1, 1, 2, 2, NA, 3); b <- c(2, 1, 1, 1, 1, 1) > table(a, b, exclude = NULL) b a 1 2 1 1 1 2 2 0 3 1 0 <NA> 1 0 With R 3.3.1: > a <- c(1, 1, 2, 2, NA, 3); b <- c(2, 1, 1, 1, 1, 1) > table(a, b, exclude = NULL) b a 1 2
2016 Aug 17
1
table(exclude = NULL) always includes NA
The quirk as in table(1:3, exclude = 1, useNA = "ifany") is actually somewhat documented, and still in R devel r71104. In R help on 'table', in "Details" section: It is best to supply factors rather than rely on coercion. In particular, ?exclude? will be used in coercion to a factor, and so values (not levels) which appear in ?exclude? before coercion will be mapped to
2016 Aug 15
1
table(exclude = NULL) always includes NA
>>>>> Martin Maechler <maechler at stat.math.ethz.ch> >>>>> on Mon, 15 Aug 2016 11:07:43 +0200 writes: >>>>> Suharto Anggono Suharto Anggono <suharto_anggono at yahoo.com> >>>>> on Sun, 14 Aug 2016 03:42:08 +0000 writes: >> useNA <- if (missing(useNA) && !missing(exclude) && !(NA %in%
2016 Aug 14
2
table(exclude = NULL) always includes NA
useNA <- if (missing(useNA) && !missing(exclude) && !(NA %in% exclude)) "ifany" An example where it change 'table' result for non-factor input, from https://stat.ethz.ch/pipermail/r-help/2005-April/069053.html : x <- c(1,2,3,3,NA) table(as.integer(x), exclude=NaN) I bring the example up, in case that the change in result is not intended.
2013 Aug 09
1
a fast table() for the 1D case
Hi, table1D() below can be up to 60x faster than base::table() for the 1D case. Here are the detailed speedups compared to base::table(). o With a logical vector of length 5M: 11x faster (or more if 'useNA="always"') o With factor/integer/numeric/character of length 1M and 9 levels (or 9 distinct values for non-factors):
2012 Mar 19
1
Problem with table
R version 2.14.0, started with --vanilla > table(c(1,2,3,4,NA), exclude=2, useNA='ifany') 1 3 4 <NA> 1 1 1 2 This came from a local user who wanted to remove one particular response from some tables, but also wants to have NA always reported for data checking purposes. I don't think the above is what anyone would want. PS. This is on a
2016 Apr 28
4
Interdependencies of variable types, logical expressions and NA
Hi All, my script tries to do the following on factors: > ## Check for case 3: Umsatz = 0 & Kunde = 1 > for (year in 2011:2015) { + Umsatz <- paste0("Umsatz_", year) + Kunde <- paste0("Kunde01_", year) + Check <- paste0("Check_U_0__Kd_1_", year) + + cat('Creating', Check, 'from', Umsatz, "and", Kunde,
2009 Mar 19
0
sunflowerplot error
A sunflowerplot crossing two categorial variables with NAs fails: ### sample: start ### set.seed(20) a <- c(letters[1:4]) z <- c(letters[23:26]) fa <- factor(sample(rep.int(a, 1000), 100, replace=T), levels=a, ordered=T) fz <- factor(sample(rep.int(z, 1000), 100, replace=T), levels=z, ordered=T) sunflowerplot(fa, fz) # okay, but: r <- xyTable(fa, fz) length(r$x)==length(r$y)
2015 Feb 09
3
xtabs and NA
Hi I haven't found a way to produce a tabulation from factor data with NA values using xtabs. Please find a minimal example below, it's also on R-pubs [1]. Tested with R 3.1.2 and R-devel r67720. It doesn't seem to be documented explicitly that it's not supported. From reading the code [2] it looks like the relevant call to table() doesn't set the "useNA"
2020 Apr 30
2
Use of MathJax (or something similar) in .Rd files
Thanks Gabor and Duncan! It works. For those interested, I added this to the beginning of the \details{} section: \if{html}{\out{ <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax at 3/es5/tex-mml-chtml.js"> </script> }} And then I can use: \if{html}{\out{\(B_{x(a,b)} = \int_0^x t^{a-1} (1-t)^{b-1} dt\)}} or
2010 May 10
6
AEC - Echo is cancelled however.....
1) Everytime a participant speaks there is a echo for a short duration (maybe a word or two) but as the participant continues to speak without a any break the echo is 95% cancelled (i.e there is a feeble echo still present if observed very carefully). 2) The moment the participant stops / pauses speaking and start talking again, scenario 1 is repeated as if the echo state has been re-initialized