Displaying 20 results from an estimated 10000 matches similar to: "Possible bug in termplot function (stats package) ?"
2017 May 31
1
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
> On 31 May 2017, at 16:40 , Joris Meys <jorismeys at gmail.com> wrote:
>
> And with "equally spaced" I obviously meant "of equal size". It's getting
> too hot in the office here...
We have a fair amount of cool westerly wind up here that I could transfer to you via WWTP (Wind and Weather Transport Protocol). If you open up a sufficiently large pipe,
2010 Dec 21
2
Warning message when items of Hmisc are masked by loading a package.
I've noticed that I get a warning message every time a package masks
some functions from Hmisc. The warning message says :
Warning message:
In identical(get(., i), get(., lib.pos)) : ignoring non-pairlist attributes
This happens with eg:
library(plyr)
library(xtable)
I think I've seen this passing by before, but I'm not sure any more.
Just thought I'd mention it.
Cheers
Joris
2014 Apr 19
1
lag() not returning a time series object
Dear all,
Before I file this as a bug, I wanted to check if I didn't miss something.
The help page of lag() says that the function returns a time series object.
It actually does return something that looks like a ts object (the
attribute tsp is set). But when using a vector, the class "ts" is not added
to the result:
> avec <- 1:10
> lag(avec)
[1] 1 2 3 4 5 6 7 8
2017 Mar 28
2
`[` not recognized as a primitive in certain cases.
?typeof? is your friend here:
> typeof(`[`)
[1] "special"
> typeof(mc[[1]])
[1] "symbol"
> typeof(mc2[[1]])
[1] "special"
so mc[[1]] is a symbol, and thus not a primitive.
- Lukas
> On 28 Mar 2017, at 14:46, Michael Lawrence <lawrence.michael at gene.com> wrote:
>
> There is a difference between the symbol and the function (primitive
>
2017 May 31
4
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
Seriously, if a method gives a wrong result, it's wrong. line() does NOT
implement the algorithm of Tukey, even not after the patch. We're not
discussing Excel here, are we?
The method of Tukey is rather clear, and it is NOT using the default
quantile definition from the quantile function. Actually, it doesn't even
use quantiles to define the groups. It just says that the groups
2016 Sep 06
2
The use of match.fun
Dear gurus,
I was utterly surprised to learn that one of my examples illustrating the
need of match.fun() doesn't give me the expected result.
center <- function(x,FUN) FUN(x)
center(1:10, mean)
mean <- 4
center(1:10, mean)
Used to give me the error message "could not find function FUN". Now it
just works, even though I didn't expect it to. I believe this is at least
2011 Feb 04
2
terribly annoying bug with POSIXlt : one o'clock is midnight?
Apparently, as.POSIXlt takes one o'clock as the start of the day :
> as.POSIXlt(0,origin="1970-01-01")
[1] "1970-01-01 01:00:00 CET"
> as.POSIXlt(0,origin="1970-01-01 00:00:00")
[1] "1970-01-01 01:00:00 CET"
> as.POSIXlt(0,origin="1970-01-01 23:59:59")
[1] "1970-01-02 00:59:59 CET"
Cheers
--
Joris Meys
Statistical
2015 Apr 01
1
evaluation in transform versus within
On 01/04/2015 2:33 PM, Joris Meys wrote:
> Thank you for the insights. I understood as much from the code, but I
> can't really see how this can cause a problem when using with() or
> within() within a package or a function. The environments behave like
> I would expect, as does the evaluation of the arguments. The second
> argument is supposed to be an expression, so I
2010 Mar 30
2
weighted.median function from package R.basic
Dear all,
I want to apply a weighted median on a huge dataset, and I remember a
function from the package R.basic that could do this using an internal
sorting algorithm qsort. This speeded things up quite a bit. Alas, I can't
find that package anywhere anymore. There is a weighted.median function in
the package limma too, but I didn't use that before.
Anybody who knows what happened to
2014 Oct 03
2
How I() works in a formula
Dear all,
I'm updating a package regarding a new type of models, and I'm looking to
extend the formula interface with two functions (L() and R() ) for
construction of these models. I want to use as much of the formula
interface as possible, and hoped to do something similarly to I().
I know the I() function does nothing more than add the class "AsIs". I've
been browsing the
2010 Jul 28
1
strange error : isS4(x) in gamm function (mgcv package). Variable in data-frame not recognized???
Dear all,
I run a gamm with following call :
result <- try(gamm(values~ s( VM )+s( RH )+s( TT )+s( PP
)+RF+weekend+s(day)+s(julday) ,correlation=corCAR1(form=~ day|month
),data=tmp) )"
with mgcv version 1.6.2
No stress about the data, the error is not data-related. I get :
Error in isS4(x) : object 'VM' not found
What so? I did define the dataframe to be used, and the
2014 Aug 25
3
dubious behaviour of match.arg() with nested functions.
Dear all,
I initially ran into this problem while rebuilding a package dependent on
nleqslv. I got the following error:
Error in match.arg(global) : 'arg' must be of length 1
This didn't occur in previous versions of nleqslv, but did in the current
one (2.4). I think I pinned the problem down to the following example:
Take two functions:
test <-
2017 May 18
2
[R] R-3.4.0 fails test
> On 18 May 2017, at 13:47 , Joris Meys <jorismeys at gmail.com> wrote:
>
> Correction: Also dlt uses the default timezone, but POSIXlt is not recalculated whereas POSIXct is. Reason for that is the different way values are stored (hours, minutes, seconds as opposed to minutes from origin, as explained in my previous mail)
>
I would suspect that there is something more subtle
2017 Mar 28
2
`[` not recognized as a primitive in certain cases.
Dear,
I have noticed this problem while looking at the following question on
Stackoverflow :
http://stackoverflow.com/questions/42894213/s4-class-subset-inheritance-with-additional-arguments
While going through callNextMethod, I've noticed the following odd
behaviour:
mc <- call("[",iris,2,"Species")
mc[[1]]
## `[`
is.primitive(`[`)
## [1] TRUE
2017 Jun 27
2
texi2pdf doesn't find the correct MikTex installation due to erroneous Sys.which()
I checked after this question popped up on Stackoverflow:
https://stackoverflow.com/questions/44785961/compile-pdf-in-rstudio-works-but-knit2pdf-does-not-work-in-r-or-rstudio
On Windows, texi2pdf looks for the texify.exe of Miktex, but looks in a
very wrong place:
> Sys.which("texify")
texify
2017 May 31
2
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
OTOH,
> sapply(1:9, function(i){
+ sum(dfr$time <= quantile(dfr$time, 1./3., type = i))
+ })
[1] 8 8 6 6 6 6 8 6 6
Only the default (type = 7) and the first two types give the result lines()
gives now. I think there is plenty of reasons to give why any of the other
6 types might be better suited in Tukey's method.
So to my mind, chaning the definition of line() to give sensible
2011 Feb 15
1
Using rasterImage on a CairoWin device prevents adding further elements to device?
I was pointed to the Cairo package for plotting PNG images on a
device. I've been playing around with it, but found that after I use
the rasterImage function, I can't add anything any more to the device,
eg :
img <- readPNG(system.file("img", "Rlogo.png", package="png"))
r = as.raster(img[,,1:3])
r[img[,,4] == 0] = "white"
CairoWin()
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
2017 Sep 28
5
Duncan's retirement: who's taking over Rtools?
Dear dev team,
I was sorry to see the announcement of Duncan about his retirement from
maintaining the R Windows build and Rtools. Duncan, thank you incredibly
much for your 15 years of devotion and your impressive contribution to the
R community as a whole.
Thinking about the future, I wondered whether there were plans for the
succession of Duncan. Is it the intention to continue providing
2010 Apr 02
2
compare multiple values with vector and return vector
Dear all,
I have a vector, and for each element I want to check whether it is equal to
any element from another vector. I want a vector of logical values with the
length of the first one as return. In R this would be :
> x <- 1:10
> sapply(x,function(y){any(y==c("2","3","4"))})
[1] FALSE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
It works pretty