similar to: data.frame, cbind is inconsistent with S on logicals (PR#316)

Displaying 20 results from an estimated 40000 matches similar to: "data.frame, cbind is inconsistent with S on logicals (PR#316)"

2008 May 04
1
S4 / S3 / Sweave problem
I'm not sure if this as a bug or something I am doing wrong. It occurs in both 2.7.0 and 2.6.2. require("methods") setClassUnion("OptionalPOSIXct", c("POSIXct", "NULL")) setClass("TSmetax", representation(serIDs="character", ExtractionDate="OptionalPOSIXct" )) setGeneric("TSmetax", def= function(x,
2013 Apr 08
2
cbind for list of zoo objects
Can someone explain why this happens when one of the list elements is named 'all'? > zz <- list( zoo(1:10,1:10), zoo(101:110,1:10), zoo(201:210,1:10) ) > names(zz)<-c('test','bar','foo') > do.call(cbind,zz) test bar foo 1 1 101 201 2 2 102 202 3 3 103 203 4 4 104 204 5 5 105 205 6 6 106 206 7 7 107 207 8 8 108 208 9
1999 Aug 05
6
cbind is not generic as claimed, omits labels where S has them (PR#239)
(1) ?cbind claims The generic functions `cbind' and `rbind' take a sequence of vector and/or matrix arguments and combine them as the columns or rows, respectively, of a matrix. Note: The method dispatching is not done via `UseMethod(..)', but by C-internal dispatching. Therefore, there's no need for, e.g., `rbind.default'. but my cbind.ts
2010 Jul 09
2
nls error regarding numerics vs logicals
I am trying to perform an nls for a valid negative exponential function: zz=nls(y~constant+a.est*2.7183^(b.est*x),start=list(constant=4.0,a.est=-4,b.est = -.005),trace=T) and am getting a number of different error messages, the most problematic of which is "Error in nls(ring.area ~ constant + a.est * 2.7183^(b.est * ba.beg), start = list(constant = 4, : REAL() can only be applied to a
2009 Sep 04
1
predicting from segmented regression
Hello I'm having trouble figuring out how to use the output of "segmented()" with a new set of predictor values. Using the example of the help file: ??set.seed(12) xx<-1:100 zz<-runif(100) yy<-2+1.5*pmax(xx-35,0)-1.5*pmax(xx-70,0)+15*pmax(zz-.5,0)+rnorm(100,0,2) dati<-data.frame(x=xx,y=yy,z=zz) out.lm<-lm(y~x,data=dati) o<-## S3
2001 Jan 30
1
screen can't go back to log="y" plot (PR#831)
[I have abbreviated the subject as jitterbug has been having probems with long subjects.] The issue here is that one cannot mix log/non-log axes in the calls to screen(), as the appropriate par() parameter is read-only, but the meaning of yaxp depends on it. But beyond that you can't set x/yaxp for log axes. You should be able to do this: you can in the S original. A simpler version: plot
1997 Sep 02
1
R-alpha: R interaction within ESS-4.9-b11: two small issues
1) I installed the latest ESS (Emacs Speaks Statistics) beta release on a machine running Linux. Since there is no S-PLUS product for Linux, I set the ess-site.el file for R, xlisp-stat, and S version 4. I.e., ;; (1.5) Require the needed dialects for your setup. ;;(require 'essd-s+3) (require 'essd-r) (require 'essd-xls) ;;(require 'essd-sas) ;;(require 'essd-s3) ;;
1999 Apr 10
1
R/S compatibility in passing a formula
In S3 if you are passing an evaluated formula to another function that will store it and use it in printing (such as a model-fitting function), you usually want to unclass the formula. Otherwise, the formula that gets stored looks very ugly when printed. A trick to do the unclassing is to pass form = c( myFormula ) In R this has the effect of making form a list rather than a call. It seems
2003 Mar 01
1
RE: [R] File opening error after 1020 files opened
Maybe open.connection() should also check if the connection is already open and given an error or at least a warning if it is. Suggested code update: open.connection <- function(con, open="r", blocking=TRUE, ...) { if (!inherits(con, "connection")) stop("argument is not a connection") if (isOpen(con)) # NEW
2000 Dec 05
1
Inconsistency, possibly a bug? (PR#758)
Seems to be a day for finding peculiar little things. There is an inconsistency in the behavior of lm vis a vis glm: > x <- rnorm(15) > y <- 1 + 10*x + rnorm(15) > z <- as.factor(rep(c("A","B","C"),rep(5,3))) > xyz <- data.frame(x,y,z) > fit.lm <- lm(y ~ x + z, data=xyz, subset=(z != "C")) > fit.glm <- glm(y ~ x +
2002 Aug 06
0
pipe and binary i/o (on Linux)
Thanks very much, Professor Ripley. Reid Huntsinger -----Original Message----- From: ripley at stats.ox.ac.uk [mailto:ripley at stats.ox.ac.uk] Sent: Tuesday, August 06, 2002 3:00 AM To: Huntsinger, Reid Cc: r-help at stat.math.ethz.ch Subject: Re: [R] pipe and binary i/o (on Linux) On Mon, 5 Aug 2002 ripley at stats.ox.ac.uk wrote: > pipe predates readBin, and no one has seen a
2004 Jan 26
5
conditional assignment
Hi all I want to conditionally operate on certain elements of a matrix, let me explain it with a simple vector example > z<- c(1, 2, 3) > zz <- c(0,0,0) > null <- (z > 2) & ( zz <- z) > zz [1] 1 2 3 why zz is not (0, 0, 3) ????? the null <- assignment is to keep the console silent in the other hand, it curious that null has reasonable values > null [1]
2008 Oct 15
1
aggregate(empty data.frame) (PR#13167)
Full_Name: Vilmos Prokaj Version: R-2..7.1 OS: Win XP Submission from: (NULL) (157.181.227.218) The 'aggregate' function on an empty data.frame generate an error, however it should return according to the documentation an empty data.frame. e.g. z<-data.frame(a=integer(0),b=numeric(0)) aggregate(z,by=z[1],FUN=sum) In a more realistic situation 'z' is of the form
1999 Jun 07
1
data.frame
I am not sure if I should call this a bug or just a design imperfection. I have noticed that the data.frame function does not preserve the integrity of multivariate components. Here is a simple illustration: > x <- matrix(1:6,3,2) > y <- 1:3 > z <- data.frame(x=x,y=y) > z$x # NULL > z$y # [1] 1 2 3 One can however get by that by using model.frame: > zz <-
2009 Jun 08
2
help to speed up loops in r
Hi i am using a script which involves the following loop. It attempts to reduce a data frame(zz) of 95000 * 41 down to a data frame (averagedreplicates) of 95000 * 21 by averaging the replicate values as you can see in the script below. This script however is very slow (2days). Any suggestions to speed it up. NB I have also tried using rowMeans rather than adding the 2 values and dividing by 2.
2004 Mar 17
4
why-s of method dispatching
Hi, I am having a problem to understand why as.data.frame method doesn't dispatch properly on my class: > setClass("Foo", "character") [1] "Foo" > as.data.frame(list(foo=new("Foo", .Data="a"))) Error in as.data.frame.default(x[[i]], optional = TRUE) : can't coerce Foo into a data.frame I was expecting that this would call
2009 May 15
2
Help with loops
Hi I am trying to create a loop which averages replicates in my data. The original data has many rows. and consists of 40 column zz[,2:41] plus row headings in zz[,1] I am trying to average each set of values (i.e. zz[1,2:3] averaged and placed in average_value[1,2] and so on. below is my script but it seems to be stuck in an endless loop Any suggestions?? for (i in 1:length(average_value[,1])) {
2009 Nov 04
4
unexpected results in comparison (x == y)
Dear readers of the list, I have a problem a comparison of two data from a vector. The comparison yields FALSE but should be TRUE. I have checked for mode(), length() and attributes(). See the following code (R2.10.0): ----------------------------------------------- # data vector of 66 double data X =
2009 May 15
1
Fw: Help with loops(corrected question)
--- On Fri, 15/5/09, Amit Patel <amitrhelp at yahoo.co.uk> wrote: > From: Amit Patel <amitrhelp at yahoo.co.uk> > Subject: Help with loops > To: r-help at r-project.org > Date: Friday, 15 May, 2009, 12:17 PM > Hi > I am trying to create a loop which averages replicates in > my data. > The original data has many rows. and consists of 40 column > zz[,2:41]
2002 Jun 17
1
logicals in data frames -- as.data.frame() should allow them
Currently, as.data.frame() , i.e., at least its "matrix" method, still coerces logicals to factors. I think this is not desired and not according to the changes to read.table() for R 1.4.0 which allow logicals. Does anybody see a reason against a change which would allow logical matrices to become data.frames with logical variables ? Martin Maechler <maechler@stat.math.ethz.ch>