Displaying 20 results from an estimated 33 matches for "xtfrm".
Did you mean:
xterm
2008 Sep 09
1
'xtfrm' performance (influences 'order' performance) in R devel
Hello everybody,
it looks like the presense of some (do know know which) S4 methods for a
given S4 class degrades the performance of xtfrm (used in 'order' in new
R-devel) by a factor of millions. This is for classes that ARE derived
from numeric directly and thus should be quite trivial to convert to
numeric.
Consider the following example:
setClass("TimeDateBase",
representation("numeric", mode=&qu...
2009 May 30
2
degraded performance with rank()
...that creates an object that is essentially a
classed version of numeric. I updated recently from 2.7.1 to 2.9.0,
and merges involving my class suddenly took a huge performance hit.
I've traced the problem to something near rank(). From NEWS, it seems
rank() etc. changed in 2.8.0. Methods for xtfrm() are supposed to
help, but I've had no success. There was some chatter about this in
the archives back in Sept 08 (though apparently regarding S4), with a
suggestion that it is related to `[.` methods. That has been my
experience. In the toy example below, the problem disappears if
`[.my` i...
2017 Oct 15
2
Function 'factor' issues
In R devel, function 'factor' has been changed, allowing and merging duplicated 'labels'.
Issue 1: Handling of specified 'labels' without duplicates is slower than before.
Example:
x <- rep(1:26, 40000)
system.time(factor(x, levels=1:26, labels=letters))
Function 'factor' is already rather slow because of conversion to character. Please don't add slowdown.
2009 Nov 27
0
Long execution time for quantile() and difftime objects (PR#14092)
...this is not implemented.
There is no claim that it works (let alone works well) for class
"difftime". If you follow the link to 'sort' it says
The default ?sort? method makes use of ?order? for objects with
classes, which in turn makes use of the generic function ?xtfrm?.
and from ?xtfrm
The default method will make use of ?==? and ?>? methods for the
class of ?x[i]? (for integers ?i?), and the ?is.na? method for the
class of ?x?, but might be rather slow when doing so.
So, if you want this to be fast, you need to write an xtfrm method.
Th...
2014 Sep 08
2
Problem with order() and I()
I have found that order() fails in a rather arcane circumstance, as in
this example:
> foo <- I( c('x','\265g') )
> order(foo)
Error in if (xi > xj) 1L else -1L : missing value where TRUE/FALSE needed
> foo <-c('x','\265g')
> order(foo)
[1] 1 2
> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
2009 Nov 27
1
Long execution time for quantile() and difftime objects (PR#14091)
Full_Name: Hong Ooi
Version: 2.10.0
OS: Windows XP
Submission from: (NULL) (203.110.235.1)
While trying to get summary statistics on a duration variable (the difference
between a start and end date), I ran into the following issue. Using summary or
quantile (which summary calls) on a difftime object takes an extremely long time
if the object is even moderately large.
A reproducible example:
2024 Apr 27
1
max on numeric_version with long components
I've noticed something in R devel which seems a little off and not the
behavior I see in 4.4.0 or earlier versions. With numeric_versions that
have long (>8 digit) final components max and min return the first element
and not the max or min:
In devel:
> max(numeric_version(c("1.0.1.100000000", "1.0.3.100000000",
"1.0.2.100000000")))
[1] ?1.0.1.100000000?
2017 Oct 18
0
Function 'factor' issues
...r in factor construction.
> Another thing: Function 'factor' in R devel uses 'order' instead of 'sort.list'.
This has been by a change on purpose --- well documented as new
feature in NEWS --- to allow using *methods* for order(),
i.e. for the workhorse of order, xtfrm() so that factor(OB)
works for more general objects OB.
> The case of as.factor(x) for
> x <- as.data.frame(character(0))
> in tests/isas-tests.Rout.save reveals that 'order' on data frame is strange.
> x <- as.data.frame(character(0))
> y <-...
2017 Oct 21
0
Function 'factor' issues
...r in factor construction.??
? ? > Another thing: Function 'factor' in R devel uses 'order' instead of 'sort.list'.
This has been by a change on purpose --- well documented as new
feature in NEWS --- to allow using *methods* for order(),
i.e. for the workhorse of order, xtfrm()? so that factor(OB)
works for more general objects OB.
? ? > The case of as.factor(x) for
? ? > x <- as.data.frame(character(0))
? ? > in tests/isas-tests.Rout.save reveals that 'order' on data frame is strange.
? ? > x <- as.data.frame(character(0))
? ? > y <-...
2010 Jan 16
1
order() fails on a chr object of class "AsIs" with "\265" in it
Here's an example (session info at the end).
> tmpv <- c('\265g/L','Bq/L')
> order(tmpv)
[1] 2 1
> tmpv <- I(tmpv)
> order(tmpv)
Error in if (xi > xj) 1L else -1L : missing value where TRUE/FALSE needed
> foov <- gsub('\265','',tmpv)
> order(foov)
[1] 2 1
> str(tmpv)
Class 'AsIs' chr [1:2] "\265g/L"
2011 Jan 11
1
sorting question
Hi,
I have a data frame with variables a, b, c (character vars) and t (time var,
could be represented as POSIXct or character, depending on which is most useful.
The format is "yyyy-mm-dd hh:mm:ss CET"). Now, I want to sort the data frame in
ascending order by a, b, c and then in descending order by t.
Here's what I've got, but I'm not sure how to put the
2013 Oct 03
1
version comparison puzzle
...max(pp2 <- package_version(c("1.0.3","1.0.4","1.0.5")))
## [1] ?1.0.5?
I've looked at ?package_version , to no avail.
Since max() goes to .Primitive("max")
I'm having trouble figuring out where it goes from there:
I **think** this is related to ?xtfrm , which goes to
.encode_numeric_version, which is doing something I really
don't understand (it's in base/R/version.R ...)
.encode_numeric_version(pp1)
## [1] 1 1 1
## attr(,"base")
## [1] 99999912
## attr(,"lens")
## [1] 3 3 3
## attr(,".classes")
## [1] &quo...
2010 May 05
1
testInstalledBasic question
...;
[78] "seq.int" "sign" "signif" "sin" "sinh"
"sqrt" "sum"
[85] "tan" "tanh" "trigamma" "trunc" "xtfrm"
"|"
Which confuses me, because the calling code in tests\\primitives.R removes
the first 15 elements, which includes ">=" which the test is failing on.
To check (and because testInstalledBasic is calling out to a separate, new R
process), I repea...
2009 Mar 27
2
Sorting problem
Hi, everyone,
I was trying to sort a data frame by two columns, one increasing, the other
decreasing and got an error.
"Error in FUN(left) : invalid argument to unary operator",
The command is "BA[order(BA[1],-BA[2]),]". BA is the data frame. It was
working if I used increasing on both columns.
Why the decreasing symbol "-" is not working here? Thanks.
--
Jun
2008 Oct 22
1
R 2.8.0 qqnorm produces error with object of class zoo?
...ets[1:10, "DAX"])
daxr <- diff(log(dax))
identical(as.vector(qnorm(daxr)), qnorm(coredata(daxr)))
qqnorm(coredata(daxr))
qqnorm(daxr)
qqnorm() produces an error:
> qqnorm(daxr)
Fehler in if (xi == xj) 0L else if (xi > xj) 1L else -1L :
Argument hat L?nge 0
Calls: qqnorm ... xtfrm.default -> as.vector -> rank -> switch -> .gt
Ausf?hrung angehalten
However, this is not witnessed by running the script through R 2.7.2 (attached are the two output files). Incidentally, the QQ-plot is produced if one uses "qqnorm(coredata(daxr))" under R version 2.8.0. Aft...
2009 May 27
3
Sort matrix by column 1 ascending then by column 2 decending
I've got a matrix with 2 columns and n rows. I need to sort it first
by the values in column 1 ascending. Then for values which are the
same in column 1, sort by column 2 decending. For example:
2 .5
1 .3
1 .5
3 .2
Goes to:
1 .5
1 .3
2 .5
3 .2
This is easy to do in spreadsheet programs but I can't seem to work
out how to do it in R and haven't been able to find a solution
anywhere.
2011 Apr 04
2
General binary search?
Is there a generic binary search routine in a standard library which
a) works for character vectors
b) runs in O(log(N)) time?
I'm aware of findInterval(x,vec), but it is restricted to numeric vectors.
I'm also aware of various hashing solutions (e.g. new.env(hash=TRUE) and
fastmatch), but I need the greatest-lower-bound match in my application.
findInterval is also slow for
2009 May 28
1
custom sort?
Sounds simple but haven't been able to find it in docs: is it possible to
sort a vector using a user-defined comparison function? Seems it must be,
but "sort" doesn't seem to provide that option, nor does "order" sfaics
--
View this message in context: http://www.nabble.com/custom-sort--tp23770565p23770565.html
Sent from the R help mailing list archive at Nabble.com.
2009 May 28
1
custom sort?
Sounds simple but haven't been able to find it in docs: is it possible to
sort a vector using a user-defined comparison function? Seems it must be,
but "sort" doesn't seem to provide that option, nor does "order" sfaics
--
View this message in context: http://www.nabble.com/custom-sort--tp23770565p23770565.html
Sent from the R help mailing list archive at Nabble.com.
2011 Jun 29
0
Error in testInstalledBasic
...;
testing S3 generic 'sin'
testing S3 generic 'sinh'
testing S3 generic 'sqrt'
testing S3 generic 'sum'
testing S3 generic 'tan'
testing S3 generic 'tanh'
testing S3 generic 'trigamma'
testing S3 generic 'trunc'
testing S3 generic 'xtfrm'
>
> ## and that no others are generic
> for(f in ls(.ArgsEnv, all.names=TRUE))
+ {
+ if(f == "browser") next
+ cat("testing non-generic '", f, "'\n", sep="")
+ method <- paste(f, "testit", sep=".")
+...