similar to: R-alpha: (minor?) S-R inconsistency: NULL =~= list() -- useful is.ALL function

Displaying 20 results from an estimated 10000 matches similar to: "R-alpha: (minor?) S-R inconsistency: NULL =~= list() -- useful is.ALL function"

1997 Aug 20
1
R-alpha: R-0.50-a3(+) Method despatching bug ?
It is very wierd... Can some of you confirm the following behavior ? It is a new bug (feature ?) which was not yet in 0.49 ... noquote <- function(obj) { ## constructor for a useful "minor" class if(!inherits(obj,"noquote")) class(obj) <- c(class(obj),"noquote") obj } "[.noquote" <- function (x, subs) structure(unclass(x)[subs], class =
2010 May 16
1
problems with generation of quantiles under For ()
Dear, I want to make an application to calculate quantile within a For() I tried the following without success: ej. date p_val <- matrix(sample(10, 1000, replace=TRUE), 200,5) test 1 rr <- paste("p_val$",names(p_val[1]), sep="") quant <- quantile(rr, probs = c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100)/100, na.rm=FALSE, type=1) test 2 rr <-
1997 Aug 27
0
R-alpha: (minor?) S/R inconsistency: mode(unclass(terms(...)))
I just stumbled over the following : mode(utf <- unclass(tf <- terms( ~ (x + y + z)^2))) ## R: "call" ## S: "expression" Don't know if/when this could be important. It made a big difference for me, but this was in low-level experimentation... -- Martin =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list --
2008 Jun 15
1
c.noquote() weirdness
I haven't been able to get anywhere tracking this down. It seems that c.noquote() does something strange with its third (and subsequent) parameters: R-2.7.0 under NetBSD, R-2.6.0 under Solaris, and R-2.8.0 (unstable) (2008-06-10 r45893) under WinXP, I get: > c(noquote('z'), 'y', 'x', '*') [1] z y x * x * > or: > c(noquote('z'),
1997 Dec 02
1
R-alpha: NextMethod in 0.50-a4
I am encountering difficulty with NextMethod in 0.50-a4. We created a class of groupedData objects which are data.frames with additional attributes. The most important attribute is a formula describing roles of some of the variables in the experimental design. The class of such objects ends in "groupedData", "data.frame". The print method for the groupedData class simply
2016 Sep 10
1
table(exclude = NULL) always includes NA
Looking at the code of function 'table' in R devel r71227, I see that the part "remove NA level if it was added only for excluded in factor(a, exclude=.)" is not quite right. In is.na(a) <- match(a0, c(exclude,NA), nomatch=0L) , I think that what is intended is a[a0 %in% c(exclude,NA)] <- NA . So, it should be is.na(a) <- match(a0, c(exclude,NA),
2020 Aug 14
0
Bug in stats:::`[.formula`: (~ NULL)[2] gives Error ... missing value where TRUE/FALSE needed
Hi, it looks like: > stats:::`[.formula` function (x, i) { ans <- NextMethod("[") if (length(ans) == 0L || as.character(ans[[1L]])[1L] == "~") { class(ans) <- "formula" environment(ans) <- environment(x) } ans } <bytecode: 0x556688d87cc0> <environment: namespace:stats> doesn't like to extract NULL
2016 Oct 10
0
Bug/Inconsistency in merge() with all.x when first nonmatching column in y is matrix
I've noticed inconsistent behavior with merge() when using all.x=TRUE. After some digging I found the following test cases: 1) The snippet below doesn't work as expected, as the non-matching columns of rows in a but not b take the value from the first matching row instead of being NA: --- Snip >>> NUM<-25; a <- data.frame(id=factor(letters[1:NUM]), qq=rep(NA, NUM),
2019 May 21
0
anyNA() performance on vectors of POSIXct
>>>>> Harvey Smith >>>>> on Wed, 1 May 2019 03:20:55 -0400 writes: > Inside of the anyNA() function, it will use the legacy any(is.na()) code if > x is an OBJECT(). If x is a vector of POSIXct, it will be an OBJECT(), but > it is also TYPEOF(x) == REALSXP. Therefore, it will skip the faster > ITERATE_BY_REGION, which is typically 5x
2013 Mar 25
1
From Java to R OOP
Hi, I'm new to OOP in R so please forgive the naiveness of some of the questions. Here are a couple of them. It would be great if you can contrast to OOP in Java. 1. R's S4 appears to centered around a dispatch mechanism which in my understanding is just a way to implement polymorphism. Now, here's the snag, I thought polymorphism was an aspect of OOP not by itself the definition of
1997 Aug 25
0
R-alpha: ts problems
This message is in MIME format --_=XFMail.1.1.p0.Linux:970825095458:252=_ Content-Type: text/plain; charset=us-ascii Here is a patch which fixes some problems with time series functions. Some examples of what goes wrong... > x <- ts(rnorm(100),start=1,deltat=2) > start(x) Error in ts[1] : object is not subsettable > end(x) Error in ts[2] : object is not subsettable > y <-
2019 May 01
3
anyNA() performance on vectors of POSIXct
Inside of the anyNA() function, it will use the legacy any(is.na()) code if x is an OBJECT(). If x is a vector of POSIXct, it will be an OBJECT(), but it is also TYPEOF(x) == REALSXP. Therefore, it will skip the faster ITERATE_BY_REGION, which is typically 5x faster in my testing. Is the OBJECT() condition really necessary, or could it be moved after the switch() for the individual TYPEOF(x)
2020 Nov 05
1
Named class vector
The source to the noquote() function looks like this: noquote <- function(obj, right = FALSE) { ## constructor for a useful "minor" class if(!inherits(obj,"noquote")) class(obj) <- c(attr(obj, "class"), if(right) c(right = "noquote") else "noquote") obj } Notice what happens with right =
2011 Jan 24
2
normality and equal variance testing
I currently have a program that automates 2-way ANOVA on a series of endpoints, but before the ANOVA is carried out I want the code to test the assumptions of normality and equal variance and report along with each anova result in the output file.  How can I do this? I have pasted below the code that I currently use.   library(car) numFiles = x #
2010 Sep 03
1
Weird erratic error and illogical error message, could someone explain this?
Hello, It's several days I try to track this bug, and even cannot cook a reproducible example. Yet, it occurs consistently in a long-running task after a variable period of time. Here is an example: ... my long-running code [as I said, cannot give something simple that produces this bug in a reproducible manner] Error in match(x, table, nomatch = 0L) : formal argument
2005 Oct 31
0
Minor typos with UseMethod docs (PR#8269)
Full_Name: Mike Kay Version: R-patched OS: Linux Submission from: (NULL) (137.75.70.37) Hi, The following patch cleans up some grammar in the docs for UseMethod (library/base/help/UseMethod) -mike --- UseMethod 2005-09-28 20:06:39.000000000 +0000 +++ /tmp/UseMethod 2005-10-31 21:21:05.534708720 +0000 @@ -5,7 +5,7 @@ Description: R possesses a simple generic function mechanism
2011 Apr 04
0
Inconsistency: sort(NULL)/sort.int(NULL) does not throw an error, cf. order(NULL), sort.int(NULL, index.return=TRUE), ...
Hi, while backtracking why sort(NULL) gives a warning, and acknowledging that NULL is not the same as an empty vector and sort(NULL) is bad coding, I discovered the following inconsistency of sort.int(): > x <- NULL > sort(x) Warning in is.na(x) : is.na() applied to non-(list or vector) of type 'NULL' NULL > sort.int(x) Warning in is.na(x) : is.na() applied to non-(list
2009 Aug 11
1
Passing a list object to lapply
Hello, I'm having difficulty passing an object name to a lapply function. Can somebody tell me the trick to make this work? #Works T13702 <- TRACKDATA[["13702.xls"]][["data"]] min(unlist(lapply(list(T13702), function(x) mdy.date(x[1, 2], x[1, 1], x[1, 3])))) 16553 #Works d<-2 assign(paste("T",substr(names(TRACKDATA)[d],1,(nchar(names(TRACKDATA)[d]
2019 Aug 15
2
Feature request: non-dropping regmatches/strextract
I do think keeping the default behavior is desirable for backwards compatibility; my suggestion is not to change default behavior but to add an optional argument that allows a different behavior. Although this can be implemented in a user-defined function, retaining empty matches facilitates programmatic use, and seems to be something that should be available in base R. It is available, for
2008 Mar 06
1
Argument "nomatch" matched by multiple actual arguments ... %in% -> match?!?
When I run R CMD check R.oo on R v2.7.0 devel (2008-03-04 r44677) on WinXP I get the following error while testing examples: Error in match(x, table, nomatch = 0) : formal argument "nomatch" matched by multiple actual arguments Calls: setMethodS3 -> setMethodS3.default -> %in% -> match Execution halted How is that even possible with: > get("%in%") function (x,