similar to: R-alpha: R-0.50-a3(+) Method despatching bug ?

Displaying 20 results from an estimated 8000 matches similar to: "R-alpha: R-0.50-a3(+) Method despatching bug ?"

1997 Aug 15
1
R-alpha: (minor?) S-R inconsistency: NULL =~= list() -- useful is.ALL function
In S, NULL and list() are not the same. In R they are (I think). --------------------------------------------------- At least, is.list(NULL) #-> 'F' in S; 'TRUE' in R Yes: I had an instance where this broke correct S code: match(c("xlab","ylab"), names(list(...))) when '...' is empty, gives an error in R, but gives c(NA,NA) in S.
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'),
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]
2006 Sep 22
2
behavior of [<-.foo
Can someone help me understand the following behavior of "[<-" ? If I define a simple class based on a matrix, the [<- operation only inserts into the first column: > x <- matrix(rnorm(10),nrow=5,ncol=2) > class(x) <- "foo" > "[<-.foo" <- function(x, i, j, value) { + if(missing(i)) i <- 1:nrow(x) + if(missing(j)) j <-
1997 Aug 19
2
R-alpha: A few bugs in R-0.50-a3.
A few problems in R-0.50-a3 (which were also in R-0.49): 1) y <- c(10,11,12,13,14,NA,NA) n <- length(y) missed <- (1:n)[is.na(y)] notmissed <- (1:n)[!is.na(y)] blocks <- cut(missed,breaks=c(0,notmissed,n+1)) a <- function(v) { q <- range(v) c(q[1]-1,q[2]+1) } brackets <- tapply(missed,blocks,a) This codes gives the following in S: > brackets $"0+ thru 1":
2004 Aug 19
2
proposed change to [.POSIXct
R developers, The "tzone" attribute is stripped from a POSIXct object when the subscript command is called ("[.POISXct"). This results in dates being printed in the locale specific format after a subscript operation is applied to a POSIXct object which has cause several problems for me in the past. Here is an example of this problem under R 1.9.1: > x <-
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 <-
2017 Oct 13
1
Quotation marks hinder for loop
Dear mailing list members, My question is maybe very basic, but I could not find the solution. I would like to do the following things 1) colnames(V1)[2] <- par$V2[1] colnames(V2)[2] <- par$V2[2] colnames(V3)[2] <- par$V2[3] ... colnames(V37)[2] <- par$V2[37] 2) V1 <- V1[,-1] V2 <- V2[,-1] V3 <- V3[,-1] ... V37 <- V37[,-1] 3) ms <- merge(V1,V2) ms <- merge(ms,V3)
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 20
1
R-alpha: R-0.50-a3: [logical, drop = FALSE] -- bug in R (and S-plus)
This is a bug both in R and S-plus (in R it's "worse"), I think. Look at this : ma <- cbind(1,1:8); logi <- rep(c(T,F),4) ma[logi,] ##> [,1] [,2] ##> [1,] 1 1 ##> [2,] 1 3 ##> [3,] 1 5 ##> [4,] 1 7 ##-- now the same with [ , drop = FALSE] ## R (-0.50-a3) : ma[logi, drop = F] ##>> Error: invalid subscript type ##
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
1997 Aug 11
1
R-alpha: R 0.50.a3: adj?
Not sure if I already reported this ... it seems that as of 0.50.a2, the adj graphics parameter is completely ignored. Try e.g. plot(1:10) title(main = "This is a title", adj = 0) title(main = "This is a title", adj = 1) No difference ... -k =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list -- Read
1997 Aug 11
1
R-alpha: R 0.50.a3 family.lm()
The following patch adds a trivial family method for linear models. -k --- src/library/base/funs/lm.orig Tue May 27 02:53:58 1997 +++ src/library/base/funs/lm Sun Aug 10 22:00:46 1997 @@ -412,3 +412,5 @@ } formula.lm<-function(x)formula(x$terms) + +family.lm <- function(x) { gaussian() } =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list
1997 Aug 11
1
R-alpha: R 0.50.a3 problem with `make tests'
Not really important, but ... `make tests' fails if a user's .Rprofile asks for libraries which are not found by the binary in the compilation tree (yes I know, we're here perhaps the only ones who use private libraries ...). Perhaps we should have options --no-site-file --no-init-file which inhibit the loading of a global and a user's init file? -k
2011 Aug 07
1
all.equal doesn't work for POSIXlt objects
Hi all, following sample code illustrates the problem : Date1 <- Date2 <- as.POSIXlt(seq.Date(as.Date("2010-04-01"),as.Date("2011-04-01"),by='day')) identical(Date1,Date2) all.equal(Date1,Date2) identical() gives the correct answer. As there is no all.equal method for POSIXlt objects, all.equal.list is used instead. Subsetting using [[]] doesn't work
2011 Mar 30
1
Class noquote to matrix
Hi, I apologize if the solution is right in front of me, but I can't find anything on how to convert a class of 'noquote' to 'matrix'. I've tried as.matrix and I've tried coercing it by 'class(x)<-matrix', but of course that didn't work. I've been using the function 'symnum' which returns an object of class 'noquote'. Here is an
2005 May 08
3
Light-weight data.frame class: was: how to add method to .Primitive function
Hi, Encouraged by a tip from Simon Urbanek I tried to use the S3 machinery to write a faster version of the data.frame class. This quickly hits a snag: the "[.default"(x, i) for some reason cares about the dimensionality of x. In the end there is a full transcript of my R session. It includes the motivation for writing the class and the problems I have encountered. As a result I see
2009 Nov 16
0
(Date + difftime) and (POSIXt + difftime) does not use date/time arithmetics (PR#14067)
Full_Name: Suharto Anggono Version: 2.8.1 OS: Windows Submission from: (NULL) (125.165.81.48) There is already PR#13369. But, the problem is not just the warning. C:\Program Files\R\R-2.8.1\bin>R --vanilla R version 2.8.1 (2008-12-22) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome
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 =
2006 Feb 27
0
method dispatch and in-place modification? - unclass, RemoveClass, getDataPart, method dispatch
I have a little problem about method dispatch and "unnessary" copying. Basically what I would like to do is: `[.myclass` <- function(x, i,j, extraopt=TRUE/FALSE, drop=TRUE) { ...do stuff depending on extraopt... value <- Nextmethod("[", x, i,j, drop=TRUE) ... do more stuff depending on extraopt... } I have two general problems: (1) NextMethod() really