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 r
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 th
r OpenBLAS 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 wrote:
Please pardon my ignorance, but doesn't OpenB
On Jan 9, 2018, at 11:01 PM, Benjamin Tyner 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 others do n
condition?
On 01/11/2018 07:56 AM, Ista Zahn wrote:
On Jan 10, 2018 8:24 PM, "Benjamin Tyner" <mailto:bty...@gmail.com>> wrote:
Thanks Keith. We checked, and indeed libopenblas is not linked
against libomp nor libgomp. We suspect this is because we used
con
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.
---
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 partic
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 <-
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
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
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 lib.lo
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
__
n Murdoch
wrote:
On 15/08/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 i
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
Rep
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'); pri
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
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", value
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 />>
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 ge
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
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 rnor
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
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() "i
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 rwil
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 cas
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 tha
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 w
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 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 <- .GlobalEnv$
Martin,
Outstanding! This is a most welcome enhancement.
Regards
Ben
On 02/07/2017 09:59 AM, Martin Maechler wrote:
Henric Winell
on Tue, 7 Feb 2017 13:37:42 +0100 writes:
> Hi, On 2017-02-07 13:12, Benjamin Tyner wrote:
>> Hello
>>
>> When l
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); force(x);
E
$ value : NULL
> 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 accomplish?
Bill Dunlap
TIBCO Software
wdunlap tibco.com
:
$ evaled: logi FALSE
$ value : NULL
> 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
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",
signature
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 `/home/btyner/R-3.1.1/src/libr
I figured out what I did wrong. The end of my $LDFLAGS contained
"-Wl,-rpath,/path/to/an/old/R/installation/lib64/R/lib" (which predated
anyNA) and I was also using --enable-R-shlib, so possibly related to
PR#15790 (I say possibly, because I was not using "make install-libR").
Actually, it depends on the number of cores:
> fun1 <- function(c){function(i){c*i}}
> fun2 <- function(f) f(2)
> sapply(mclapply(1:4, fun1, mc.cores=1L), fun2)
[1] 8 8 8 8
> sapply(mclapply(1:4, fun1, mc.cores=2L), fun2)
[1] 6 8 6 8
> sapply(mclapply(1:4, fun1, mc.core
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:
http://tolstoy.newcastle.edu.au/R/e2/devel/07/09/4496.h
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 :
/>/
/>/ http://stackoverflo
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 anyo
version 4.4.0, and now the
timings are back to what they were under g77.
As for BLAS, was using the one that ships with R, as wanted to keep
things simple for benchmarking purposes.
Thanks again.
> On 05/03/2013 01:45, Benjamin Tyner wrote:
> >/ Hi
> />/
> />/ I've got
Hi.
It seems that if I put a browser() in my Rprofile.site, I get a
segfault. This happens on several machines, several versions of R.
Here it the valgrind output when using revision 62797:
==31314== Memcheck, a memory error detector
==31314== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Se
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 i
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
;,0),
> > sep=",")
>
> Hope this helps,
>
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> [EMAIL PROTECTED]
> (801) 408-8111
>
>
>
> > -Original Message-
> > From: [EMAIL PROTECTED]
&g
Andy,
If you could provide an example of the R code with which you call
loess(), I can post R code which will duplicate what predict.loess
does without having to call the C/Fortran. There are a lot of
implementation details that are easy to overlook, but without knowing
the arguments to your call
?"[<-" 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
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
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 (nline
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(N
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
ian Ripley 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
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
>
>
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
Extensions
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: e
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 <- .C("fo
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 <-
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
I'm trying to figure out why the presence of a Fortran call affects the
result of a floating-point operation. I have C functions
void test1(int *n, double *f){
int outC;
double c0;
c0 = (double) *n * *f;
outC = floor(c0);
printf("when f computed by R, C says %d by itself\n",outC);
}
Thanks; I'm on 32-bit linux, but it's good to know the behavior on
Windows. Do you know a way to force "floor" to use this reduced precision?
Ben
Duncan Murdoch wrote:
> On Windows, it's fairly common for runtime libraries to switch the
> precision from 80 bit to 64 bit. R on Windows tries to
Thanks! It seems the 'volatile' declaration is exactly what was needed.
Ben
Prof Brian Ripley wrote:
> In C, declaring a value as 'volatile' should force it to be stored in
> a 64-bit memory location. There is no known way to do this in Fortran:
> compilers and numeric software have been playin
Greetings,
As of r80088, at the top of doc/NEWS.3 file it says:
LATER NEWS:
• News for R 4.x.y can be found in HTML format at doc/html/NEWS.html,
and in text format in file NEWS in the doc directory.
However as far as I can tell, neither NEWS nor NEWS.html exists in the R
source. Should
63 matches
Mail list logo