similar to: sum() (and similar methods) should work for zero row data.frames

Displaying 20 results from an estimated 10000 matches similar to: "sum() (and similar methods) should work for zero row data.frames"

2020 Oct 18
2
sum() (and similar methods) should work for zero row data.frames
Peter et al, I had the same thought, in particular for any() and all(), which in as much as they should work on data.frames in the first place (which to be perfectly honest i do find quite debatable myself), should certainly work on "logical" data.frames if they are going to work on "numeric" ones. I can volunteer to prepare a patch if Martin (the reporter) did not want to
2020 Oct 20
1
sum() (and similar methods) should work for zero row data.frames
>>>>> mb706 >>>>> on Sun, 18 Oct 2020 22:14:55 +0200 writes: >> From my side: it would be great if you (or R core) could prepare a patch, it would probably take me quite a bit longer than you since I don't have experience creating patches for R. > Best, Martin Basically, just 1. svn co https://svn.r-project.org/R/trunk R-devel 2.
2020 Oct 18
0
sum() (and similar methods) should work for zero row data.frames
Hmm, yes, this is probably wrong. E.g., we are likely to get inconsistencies out of boundary cases like this > a <- na.omit(airquality) > sum(a) [1] 37495.3 > sum(a[FALSE,]) Error in FUN(X[[i]], ...) : only defined on a data frame with all numeric variables Or, closer to an actual use case: > sum(subset(a, Ozone>100)) [1] 3330.5 > sum(subset(a, Ozone>200)) Error in
2020 Oct 18
0
sum() (and similar methods) should work for zero row data.frames
>From my side: it would be great if you (or R core) could prepare a patch, it would probably take me quite a bit longer than you since I don't have experience creating patches for R. Best, Martin On Sun, Oct 18, 2020, at 21:49, Gabriel Becker wrote: > Peter et al, > > I had the same thought, in particular for any() and all(), which in as > much as they should work on
2020 Aug 25
1
sum() vs cumsum() implicit type coercion
>>>>> Tomas Kalibera >>>>> on Tue, 25 Aug 2020 09:29:05 +0200 writes: > On 8/23/20 5:02 PM, Rory Winston wrote: >> Hi >> >> I noticed a small inconsistency when using sum() vs cumsum() >> >> I have a char-based series >> >> > tryjpy$long >> >> [1]
2020 Aug 23
2
sum() vs cumsum() implicit type coercion
Hi I noticed a small inconsistency when using sum() vs cumsum() I have a char-based series > tryjpy$long [1] "0.0022" "-0.0002" "-0.0149" "-0.0023" "-0.0342" "-0.0245" "-0.0022" [8] "0.0003" "-0.0001" "-0.0004" "-0.0036" "-0.001" "-0.0011"
2001 Feb 09
1
tabular data (was RE: [R] Removing "row.names")
Hi, I agree that replacing data.frames for modeling functions would be too painful. Also I agree with Thomas that new class(es) for tabular data should not inherit from data.frame, and that data.frames should conceptually inherit from some other base tabular data class. At this point I'm not suggesting anything in concrete --- I haven't sorted it out in my own mind --- but I want
2011 May 31
1
Coercing in R and in C (R-Extensions)
Hello, in "Writing R Extensions" I found the following stuff: "Note that these coercion functions are not the same as calling as.numeric (and so on) in R code, as they do not dispatch on the class of the object. Thus it is normally preferable to do the coercion in the calling R code." ( Writing R Extensions, 2011-04-13, page 100 ) What is meant by
2013 Jan 05
2
lapply (and friends) with data.frames are slow
Hey guys, I noticed something curious in the lapply call. I'll copy+paste the function call here because it's short enough: lapply <- function (X, FUN, ...) { FUN <- match.fun(FUN) if (!is.vector(X) || is.object(X)) X <- as.list(X) .Internal(lapply(X, FUN)) } Notice that lapply coerces X to a list if the !is.vector || is.object(X) check passes. Curiously,
2020 Oct 07
2
Coercion function does not work for the ALTREP object
Hi all, The coercion function defined for the ALTREP object will not be called by R when an assignment operation implicitly introduces coercion for a large ALTREP object. For example, If I create a vector of length 10, the ALTREP coercion function seems to work fine. ``` > x <- 1:10 > y <- wrap_altrep(x) > .Internal(inspect(y)) @0x000000001f9271c0 13 INTSXP g0c0 [REF(2)] I am
1999 Jun 23
1
coercing factors to matrix() --> num/char ? -- inconsistencies|?
The old factor() wars...... {{maybe don't just report that factor()s are broken by design..}} If ff is a factor, e.g., ff <- as.factor(rep(1:2,3)) f2 <- ff; levels(f2) <- c("Lo","Hi") 1) we don't allow {in R as in S-plus 3.x} arithmetic on factors, i.e. 1 + ff gives an error, and I think most of us believe this is as desired. {{if one
2015 Apr 17
1
behavior of as.integer("5000000000")
>>>>> Martin Maechler <maechler at lynne.stat.math.ethz.ch> >>>>> on Fri, 17 Apr 2015 15:49:35 +0200 writes: >>>>> Herv? Pag?s <hpages at fredhutch.org> >>>>> on Mon, 13 Apr 2015 23:36:14 -0700 writes: >> On 04/13/2015 11:32 PM, Martin Maechler wrote: >>> >>>> Hi,
2015 Apr 14
3
behavior of as.integer("5000000000")
On 04/13/2015 11:32 PM, Martin Maechler wrote: > >> Hi, >> > as.integer("5000000000") >> [1] 2147483647 >> Warning message: >> inaccurate integer conversion in coercion > >> > as.integer("-5000000000") >> [1] NA >> Warning message: >> inaccurate integer conversion in coercion >
2020 Oct 08
1
Coercion function does not work for the ALTREP object
Hi Gabriel, here is a simple package for reproducing the problem. https://github.com/Jiefei-Wang/testPkg Best, Jiefei On Thu, Oct 8, 2020 at 5:04 AM Gabriel Becker <gabembecker at gmail.com> wrote: > Jiefei, > > Where does the code for your altrep class live? > > Thanks, > ~G > > On Wed, Oct 7, 2020 at 4:25 AM Jiefei Wang <szwjf08 at gmail.com> wrote: >
2015 Apr 14
3
behavior of as.integer("5000000000")
Hi, > as.integer("5000000000") [1] 2147483647 Warning message: inaccurate integer conversion in coercion > as.integer("-5000000000") [1] NA Warning message: inaccurate integer conversion in coercion Is this a bug or a feature? The man page suggests it's the latter: ?as.integer? attempts to coerce its argument to be of integer type.
2018 Aug 06
3
vctrs: a type system for the tidyverse
> First off, you are using the word "type" throughout this email; You seem to > mean class (judging by your Date and factor examples, and the fact you > mention S3 dispatch) as opposed to type in the sense of what is returned by > R's typeof() function. I think it would be clearer if you called it class > throughout unless that isn't actually what you mean (in
2007 Oct 26
1
Use of all/any
all/any coerce their arguments to logical (if possible). I've added a warning in R-devel if coercion is from something other than integer. This arose because it is easy to make a slip and write all(X) > 0 rather than all(X > 0): thanks to Bill Dunlap for bringing that to my attention. However, it has been useful in detecting quite a few other things: - indices which had been made
2008 May 09
1
Data frame row manipulation
Greetings, Q #1 ------ How does one combine data frames by row ... no cleverness a la merge(), just add rows. For example, given A with 20 rows and B with 30 rows, I want C = combine( A, B) having 50 rows. Columns having matching names should be filled from both (all) sources with suitable coercion, unmatched would get NA in rows whose source does not have that column. Q #2 ------ Given
2001 Feb 07
1
RE: [R] Removing "row.names"
> Date: Wed, 7 Feb 2001 09:33:12 -0800 (PST) > From: Thomas Lumley <tlumley@u.washington.edu> > To: Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> > cc: Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk>, R-devel@r-project.org > Subject: Re: [Rd] RE: [R] Removing "row.names" > MIME-Version: 1.0 > > On Wed, 7 Feb 2001, Kurt Hornik wrote: > > >
2012 Apr 29
1
Error in if (nuhat < 2) stop("The degrees of freedom must be greater than or equal to 2") : missing value where TRUE/FALSE needed
Hi, i am trying to run an ANCOVA and a bootstrapped ANCOVA analysis on a specific data set. I am using the ancova and ancboot functions as in the following code: setwd("C:/Users/User/Desktop/Rdatabilingualstudy2012") bilingualismdata<-read.spss("bilingualdataforconferences2012.sav", use.value.labels = TRUE, to.data.frame = TRUE)