similar to: multiple issues with is.unsorted()

Displaying 20 results from an estimated 30000 matches similar to: "multiple issues with is.unsorted()"

2012 May 23
2
Expected behaviour of is.unsorted?
Hi, I've read ?is.unsorted and searched. Have found a few items but nothing close, yet. Is the following expected? > is.unsorted(data.frame(1:2)) [1] FALSE > is.unsorted(data.frame(2:1)) [1] FALSE > is.unsorted(data.frame(1:2,3:4)) [1] TRUE > is.unsorted(data.frame(2:1,4:3)) [1] TRUE IIUC, is.unsorted is intended for atomic vectors only (description of x in ?is.unsorted). Indeed
2019 Jan 05
1
unsorted - suggestion for performance improvement and ALTREP support for POSIXct
I believe the performance of isUnsorted() in sort.c could be improved by calling REAL() once (outside of the for loop), rather than calling it twice inside the loop. As an aside, it is implemented in the faster way in doSort() (sort.c line 401). The example below shows the performance improvement for a vectors of double of moving REAL() outside the for loop. # example as implemented in
2008 Apr 17
1
Couldn't (and shouldn't) is.unsorted() be faster?
Hi, Couldn't is.unsorted() bail out immediately here (after comparing the first 2 elements): > x <- 20000000:1 > system.time(is.unsorted(x), gcFirst=TRUE) user system elapsed 0.084 0.040 0.124 > x <- 200000000:1 > system.time(is.unsorted(x), gcFirst=TRUE) user system elapsed 0.772 0.440 1.214 Thanks! H.
2006 May 02
4
"a"+"b"
Hi, Is there a way to define "+" so that "a"+"b" returns "ab" ? > setMethod("+",c("character","character"),paste) Error in setMethod("+", c("character", "character"), paste) : the method for function '+' and signature e1="character", e2="character" is sealed
2012 Nov 15
1
bug with mapply() on an S4 object
Hi, Starting with ordinary vectors, so we know what to expect: > mapply(function(x, y) {x * y}, 101:106, rep(1:3, 2)) [1] 101 204 309 104 210 318 > mapply(function(x, y) {x * y}, 101:106, 1:3) [1] 101 204 309 104 210 318 Now with an S4 object: setClass("A", representation(aa="integer")) a <- new("A", aa=101:106) > length(a)
2010 Jan 03
1
questions on generic functions
Hi all, I'm trying to build a package, but run into problems with generic functions. I have two classes "aa" and "bb", and defined the function "summary.bb". Now I want to make "summary.bb" the default method for both classes "aa" and "bb". That is, if I have two objects "object.aa" and "object.bb" from class
2014 Jan 03
1
wishlist: decreasing argument to is.unsorted
I've just realized that it could be handy to have a 'decreasing' argument in 'is.unsorted'. And I'm cheekily hoping someone else will implement it. It is easy enough to work around (with 'rev'), but would be less hassle with an argument. The case I have in mind uses 'is.unsorted' in 'stopifnot'. Pat -- Patrick Burns pburns at pburns.seanet.com
2006 Oct 17
1
Caching bug with showMethods?
showMethods isn't reporting inherited methods when it is first called. The methods are there and after calling them, showMethods gives the right output. Here is an example (using R-devel r39647): setClass("A", representation(x="numeric"), prototype=list(x=1)) setClass("B", contains="A", prototype=list(x=2))
2010 Dec 11
1
DO NOT REPLY [Bug 7861] New: documentation: files-frombehaves badly on unsorted input
https://bugzilla.samba.org/show_bug.cgi?id=7861 Summary: documentation: files-frombehaves badly on unsorted input Product: rsync Version: 3.0.5 Platform: x64 OS/Version: Linux Status: NEW Severity: minor Priority: P3 Component: core AssignedTo: wayned at samba.org ReportedBy: rlpowell at
2020 Feb 18
2
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
I am trying to create a class union of class unions to facilitate method dispatch. When I execute code in the global environment, everything acts as expected, however when I put the same code in the context of a package, selectMethod can no longer find the correct method. This first block below puts the code in the context of a package: fn <- "codefile.R" writeLines( c(
2006 Sep 15
1
setMethod() woes
Hello everybody R version 2.4.0 alpha (2006-09-15 r39323), MacOSX 10.4.7 Next S4 problem. I have "brob" objects that are large real numbers, and now I want "glub" numbers that are to be a pair of glubs that represent complex numbers. I want to define binary operator "+" so that if either the left or right argument are glubs, it uses .ArithGlub. If either
2013 Jul 29
1
duplicated.data.frame() is broken on data frames containing \r
Hi, The trick used by duplicated.data.frame() is to transform the supplied data.frame into a character vector by pasting together the columns using "\r" as separator. But no precautions are taken to deal with "\r" in the supplied data.frame. As a consequence it's easy to imagine situations where duplicated.data.frame() returns an incorrect answer: > df <-
2008 Mar 30
1
package.skeleton.S4
Hi the devel list. I am adapting the package.skeleton to S4 classes and methods I would have been very proud to post a new working function on this list. Unfortunately, I do not manage to solve all the problems. Mainly - sys.source does not compile a file with setClass - dumpMethod does not exists yet In the following code, thise two problems are notified by a line ################# Still
2005 Jun 29
1
Failed "make check" under Fedora Core 4 (PR#7979)
I downloaded R v2.1.1 earlier this morning to compile under Fedora Core 4. It compiled without incident, but 'make check' failed. Below is the relevant part of its report. Is this a known problem? I used a locally compiled version of GCC v4.0.0 that reports [kent at d89h102 R-2.1.1]$ gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc-4.0.0/configure
2020 Feb 19
2
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
Thanks, I'll look into it. On Tue, Feb 18, 2020 at 8:32 AM Ezra Tucker <ezztucker at gmail.com> wrote: > > Hi Robert, > > This looks like a bug to me (tested in R 3.6.2 on Windows), f(new("a")) > should return "hi!". I'll add that this DOES work properly in 3.6.1 > which leads me to suspect this could be due to the subtle change in the > way
2006 Sep 01
1
setMethod("Logic", ...)
Hi In V&R the "polynomial" class is explicitly specified to have no logical operators: setMethod("Logic", signature(e1="polynomial"), function(e1,e2){stop ("...")}) I too have a class of objects for which I want to specify that Logic operators do not work, but executing setClass("brob", representation = representation
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):
2011 Nov 02
1
overloading + operator for chars
Hello,   I would like to overload the "+" operator so that it can be used to concatenate two strings, e.g "John" + "Doe" = "JohnDoe". How can I 'unseal' the "+" method? > setMethod("+", signature(e1="character", e2="character"), function(e1, e2) paste(e1, e2, sep="") ) Error in
2004 Jul 06
1
questions about setMethod("Arith", ...)
Hi, we have some questions concerning the definition of new arithmetic methods. In our package "distr" (on CRAN) we define some new arithmetic methods for "+", "-", "*", "/". After loading "distr" the corresponding arithmetic methods work. Now, if we define a new class and also a new method for one of the arithmetic methods
2020 Feb 26
1
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
Okay - that makes sense and thanks for looking into this! As an aside, from R-devel's perspective would you say methods are stabilizing again or do you foresee a lot of changes coming in the 4.* series? On Tue, Feb 25, 2020 at 3:39 PM Michael Lawrence via R-devel < r-devel at r-project.org> wrote: > This seems to work as expected (returning "hi!") in R-devel, but there