Greetings,
I noticed that starting with R version 3.5.0, it is now possible to do,
for example:
setGeneric(name = "foo",
def = function(x, y, ...) standardGeneric("foo"),
valueClass = "fooResult"
)
setMethod(f = "foo",
Not certain this is actually a bug, so posting here.
I'm on Ubuntu 18.04.4 LTS, building R version 4.0.0. The "configure" and
"make" steps are successful, but the "make check" step fails when it
gets to this part of ./tests/reg-tests-1b.R:
> ## methods() gave two wrong warnings in some
Hello,
Using package nlme as an example, where there is a registered routine
fit_gnls:
> library(nlme)
> getDLLRegisteredRoutines("nlme")$.C$fit_gnls
$name
[1] "fit_gnls"
$address
attr(,"class")
[1] "RegisteredNativeSymbol"
$dll
DLL name: nlme
Filename:
On 1/20/20 12:33 PM, Martin Maechler wrote:
It's really something that should be discussed (possibly not
here, .. but then I've started it here ...).
The NEWS for R 3.0.0 contain (in NEW FEATURES) :
* Functions rbinom(), rgeom(), rhyper(), rpois(), rnbinom(),
rsignrank() and
On 1/20/20 4:26 AM, Martin Maechler wrote:
Coming late here -- after enjoying a proper weekend ;-) --
I have been agreeing (with Spencer, IIUC) on this for a long
time (~ 3 yrs, or more?), namely that I've come to see it as a
"design bug" that rpois() {and similar} must return return typeof()
Adler wrote:
Maybe there should be code for 64 bit R to use long long or the like?
On Sun, Jan 19, 2020 at 10:45 AM Spencer Graves
mailto:spencer.gra...@prodsyse.com>> wrote:
On 2020-01-19 09:34, Benjamin Tyner
Hello, All:
Consider:
Browse[2]> set.seed(1)
Browse[2]> rpois(9, 1e10)
NAs produced[1] NA NA NA NA NA NA NA NA NA
Should this happen?
I think that for, say, lambda>1e6, rpois should return
is redirected to /dev/null.
Try
p <- pipe("cat > /dev/null", open = "w")
instead.
Regards,
Andreas
2019-12-06 02:46 GMT+01:00 Benjamin Tyner:
Not sure if this is a bug, so posting here first. If I run:
cnt <- 0L
while (TRUE) {
cnt <- cnt + 1L
Not sure if this is a bug, so posting here first. If I run:
cnt <- 0L
while (TRUE) {
cnt <- cnt + 1L
p <- pipe("echo /dev/stdin > /dev/null", open = "w")
writeLines("foobar", p)
tryCatch(close(p), error = function(e) { print(cnt); stop(e)})
}
then once cnt
For what it's worth, the current behavior seems to have begun starting
with version 3.6.0. If I run in version 3.5.3:
> p1 <- .Primitive('+') ; p2 <- p1 ; attr(p1, "myattr") <- 1 ; p2
function (e1, e2) .Primitive("+")
On 11/18/19 10:45 AM, Martin Maechler wrote:
>>/Tomas Kalibera
It appears this started with R version 3.5.0. Under R 3.4.4 we have:
> setClass("Z", rep=representation(x="character"))
> z <- new("Z", x="orig")
> `@<-`(z, "x", value="newer")
An object of class "Z"
Slot "x":
[1] "newer"
> z
An object of class "Z"
Slot "x":
[1] "newer"
> `slot<-`(z, "x",
Looks fixed as of revision 76417; thanks Brian!
On 4/21/19 9:02 PM, Benjamin Tyner wrote:
Duncan that does indeed look to be the case. Many thanks!
In particular, tests/reg-tests-1d.R optionally loads the Matrix
namespace which allows the test to succeed. Compare:
~/R-rc_2019-04
Duncan that does indeed look to be the case. Many thanks!
In particular, tests/reg-tests-1d.R optionally loads the Matrix
namespace which allows the test to succeed. Compare:
~/R-rc_2019-04-21_r76409/bin/Rscript -e "options(warn=2);
library(Matrix); res <- findMethods('isSymmetric');
Hello,
Most likely I'm doing something wrong, but am at a loss as to what the
issue is. I have a clean checkout of trunk here:
~/svn/r-devel/R$ svn info
Path: .
Working Copy Root Path: /home/btyner/svn/r-devel/R
URL: https://svn.r-project.org/R/trunk
Relative URL: ^/trunk
/2018 7:08 AM, Benjamin Tyner wrote:
Hi
In my R package, imagine I have a C function defined:
void myfunc(int *x) {
// some code
}
but when I call it, I pass it a pointer to a longint instead of a
pointer to an int. Could this practice potentially result in a
segfault?
I don't think
Hi
In my R package, imagine I have a C function defined:
void myfunc(int *x) {
// some code
}
but when I call it, I pass it a pointer to a longint instead of a
pointer to an int. Could this practice potentially result in a segfault?
Regards
Ben
On 07/25/2018 04:28 AM, Uwe Ligges wrote:
Not sure if this is a bug: where is it documented that this works not
as above (which is what I would expect)?
The documentation doesn't say one way or the other. But the fact remains
that base:::.getRequiredPackages2, when provided a non-null
On 07/24/2018 07:50 AM, Martin Maechler wrote:
Benjamin Tyner
on Sat, 21 Jul 2018 13:42:43 -0400 writes:
> Not sure whether it is the same issue as was raised here:
> https://stat.ethz.ch/pipermail/r-devel/2010-October/058729.html
> but in any case perhaps th
BTW --- and this is a diversion --- This is nice mathematically
(and used in other places, also in "base R" I think)
but in principle is a waste: Computing a full
k x k matrix and then throwing away all but the length-k
diagonal ...
In the past I had contemplated but never RFC'ed or really
e package
On 07/21/2018 12:34 PM, Martin Maechler wrote:
Benjamin Tyner
on Fri, 20 Jul 2018 19:42:09 -0400 writes:
> Here's a trick/workaround; if lib.loc is the path to your
> library, then prior to calling library(),
>> environment(.libPaths)$.lib.loc <- lib.
Here's a trick/workaround; if lib.loc is the path to your library, then
prior to calling library(),
> environment(.libPaths)$.lib.loc <- lib.loc
Good day,
If there's a library folder of the latest R packages and a
Hi,
Unless I am mistaken, this enhancement to gc():
r73749 | luke | 2017-11-18 13:26:25 -0500 (Sat, 18 Nov 2017) | 2 lines
Added 'full' argument to gc() with default 'TRUE' for now.
condition?
On 01/11/2018 07:56 AM, Ista Zahn wrote:
On Jan 10, 2018 8:24 PM, "Benjamin Tyner" <bty...@gmail.com
<mailto:bty...@gmail.com>> wrote:
Thanks Keith. We checked, and indeed libopenblas is not linked
against libomp nor libgomp. We suspect this is bec
9, 2018, at 11:01 PM, Benjamin Tyner <bty...@gmail.com> wrote:
I didn't do the compile; is there a way to check whether that was used? If not,
I'll inquire with our sysadmin and report back.
In any case, my suggestion was motivated by the fact that some parts of R use
OpenMP while oth
omelet without breaking the OpenMP eggs, so to speak.
On 01/09/2018 06:41 PM, Keith O'Hara wrote:
Do those issues still arise when OpenBLAS is compiled with USE_OPENMP=1 ?
Keith
On Jan 9, 2018, at 6:03 PM, Benjamin Tyner <bty...@gmail.com> wrote:
Please pardon my ignorance, but doesn't Op
Please pardon my ignorance, but doesn't OpenBLAS still not always play
nicely with multi-threaded OpenMP? (for example, don't race conditions
sometimes crop up)? If so, it might be nice to have the ability to
temporarily disable multi-threaded OpenMP (effectively:
omp_set_num_threads(1)) for
Evan,
The pryr package provides some utilities which may be handy here. In
particular see the function: is_promise.
Also, next time please post in plaintext.
Regards
Ben
Hello R experts,
I plan to develop a tool for dynamic analysis of R programs. I would like to
trace function calls at
; str(f(log(-1), force=TRUE))
List of 4
$ code : language log(-1)
$ env : NULL
$ evaled: logi TRUE
$ value : num NaN
Warning message:
In log(-1) : NaNs produced
Can you give a concrete example of what you are try to accomp
guage log(-1)
$ env : NULL
$ evaled: logi TRUE
$ value : num NaN
Warning message:
In log(-1) : NaNs produced
Can you give a concrete example of what you are try to accomplish?
Bill Dunlap
TIBCO Software
wdunlap tibco.com <http://tibco.com>
On Fri, Jul 28, 2017 at 3:04 PM, Benjamin Tyner
Hi,
I thought I understood the change to lapply semantics resulting from this,
https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16093
However, would someone care to explain why this does not work?
> L <- list(a=1, b=2, c=3)
> str(lapply(L, function(x){ y <- substitute(x);
Martin,
Outstanding! This is a most welcome enhancement.
Regards
Ben
On 02/07/2017 09:59 AM, Martin Maechler wrote:
Henric Winell <nilsson.hen...@gmail.com>
on Tue, 7 Feb 2017 13:37:42 +0100 writes:
> Hi, On 2017-02-07 13:12, Benjamin Tyner wrote:
Hello
When loading a package, I'm wondering if it's frowned upon for the
package to alter the state of the random number generator? I guess not,
since the parallel package does it?
> set.seed(6860)
> old.seed <- .GlobalEnv$.Random.seed
> library(parallel)
> new.seed <-
Perhaps it is not that surprising, given that
> mode(1L)
[1] "numeric"
and
> is.numeric(1L)
[1] TRUE
On the other hand, this is curious, to say the least:
> is.double(as(1L, "double"))
[1] FALSE
Here's the surprising behavior:
x <- 1L
xx <- as(x, "numeric")
Hello,
When building R from source, during the part where the 'tools' package
is built, I get:
make[6]: Entering directory `/home/btyner/R-3.1.1/src/library/tools/src'
make[6]: Leaving directory `/home/btyner/R-3.1.1/src/library/tools/src'
make[5]: Leaving directory
Hi
I've got two builds of R, one using g77 (version 3.4.6) and the other
using gfortran (version 4.1.2). The two builds are otherwise identical
as far as I can tell. The one which used g77 performs crossprod()s
roughly twice as fast as the gfortran one. I'm wondering if this rings a
bell with
Hello,
Is it possible to retrieve the 'named' field within the header (sxpinfo)
of a object, without resorting to a debugger, external code, etc? In
other words is there a built-in equivalent to the getnamed subroutine
described here:
Thanks Matthew and Hadley; that is exactly what I was looking for, and them
some.
Regards,
Ben
/ The goal is to ascertain whether a copy of an object has been made.
//
// Then :
//
// ?tracemem
//
// One demonstration of using both together is here :
//
//
Hello,
Currently, subset.data.frame() does
if (missing(subset))
r - TRUE
else {
perhaps better might be:
if (missing(subset))
r - rep(TRUE, nrow(x))
else {
The rationale being, if 'x' has zero rows and 'subset' is missing, we
don't want to end up
Hi,
I'm aware that the language definition states R objects are often
coerced to different types during computations. Two questions:
1. Is it possible to configure the R environment so that, for example,
coercion from (say) numeric to integer will throw a warning or an error?
I realize that
The MKsetup() in unique.c throws an error if the vector to be hashed is
longer than (2^32)/8:
if(n 0 || n 536870912) /* protect against overflow to -ve */
error(_(length %d is too large for hashing), n);
I occasionally work with vectors longer than this on 64-bit builds. Would it
wrote:
On Thu, 5 Mar 2009, Benjamin Tyner wrote:
Hi
Nice to hear from you Ryan. I also do not have the capability to
debug on windows; however, there is a chance that the behavior you
are seeing is caused by the following bug noted in my thesis
(available on ProQuest; email me if you don't have
Hi
Nice to hear from you Ryan. I also do not have the capability to debug
on windows; however, there is a chance that the behavior you are seeing
is caused by the following bug noted in my thesis (available on
ProQuest; email me if you don't have access):
When lambda = 0 there are no local
When calling read.table() and supplying colClasses and header=FALSE,
it is possible for the resulting data frame to have NA in the names.
(The warning not all columns named in 'colClasses' exist is
returned)
Here is such a data frame:
x - structure(list(a = 1:10,
NA = c(NA,
R-devel,
IMHO, in readtable.R, the scan command
if (nlines 1)
for (i in seq_along(col))
col[i] - length(scan(file, what = , sep = sep,
quote = quote,
nlines = 1, quiet = TRUE, skip = 0,
Correction: the warning would be triggered by
warning(cols = , cols, != length(data) = , length(data), domain = NA)
Ben
On 9/20/07, Benjamin Tyner [EMAIL PROTECTED] wrote:
R-devel,
IMHO, in readtable.R, the scan command
if (nlines 1)
for (i in seq_along(col
Why not
hasNA - function(x) !is.na(match(NA, x))
-Ben
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
?[- says
When replacing (that is using indexing on the lhs of an assignment)
NA does not select any element to be replaced. As there is ambiguity
as to whether an element of the rhs should be used or not, this is
only allowed if the rhs value is of length one (so the two
interpretations would
R-devel,
When I run the following code on the attached file,
tmp - scan(C:/temp.csv,
what=list(character,numeric),
sep=,)
Then tmp[[2]] is a character vector. My impression from the help file
is that it should be a numeric as specified by 'what'
sessionInfo()
R version
Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Benjamin Tyner
Sent: Tuesday, June 26, 2007 9:59 AM
To: r-devel@r-project.org
Subject: [Rd] possible
I apologize if this is just a misunderstanding on my part, but I was
under the impression that the intervals returned by co.intervals should
cover all the observations. Yet
x-1:10
z-co.intervals(x,overlap=0)
In R, z equals
[,1] [,2]
[1,] 0.5 1.5
[2,] 2.5 3.5
[3,] 3.5 4.5
[4,] 5.5
Hin-Tak Tamas,
For example, see what I've done in
http://www.stat.purdue.edu/~btyner/postage_0.1-1.tar.gz
I am by no means a C guru but it works with my compiler. The relevant
lines are
(in postage.c:)
void postage(int *lambda, int *D, int *tau, int r[*tau][*D])
{
(in postage.R:)
r -
Tamas,
You could write convenience functions, but I have used the C99 mechanism
for variable length arrays with no problems calling from R. One thing
you have to keep in mind though is that (as far as I know) the
dimensions must be passed before the array reference. So for example,
r -
In my package's zzz.R, I put
.Last.lib - function(libpath) {
unloadNamespace(mypackage)
}
and I exported .Last.lib in NAMESPACE, with the intent that detaching
the package would also cause the name space to be unloaded. However, the
result of detach(package:mypackage) is then
Error:
I noticed that in
https://svn.r-project.org/R/trunk/src/library/stats/R/loess.R
that we are now calling R_loess_raw, R_lowesw, R_lowesp, etc. I'm
interested to know what is the benefit/reason for the 'R_', as I am
unfamiliar with this prefix and do not see it mentioned in 'Writing R
Sorry, so used to it being bundled that I didn't realize lattice was a
contributed package.
Ben
Deepayan Sarkar wrote:
1. Bugs in packages should be reported to the maintainer, not R-bugs.
2. This already works as it should in R 2.3.0 alpha
-Deepayan
55 matches
Mail list logo