Displaying 20 results from an estimated 300 matches similar to: "bindingIsLocked returns illogical logical"
2011 May 31
1
assignInNamespace and new bindings
Hello,
assignInNamespace refuses to assign an object to a name that is not
already used in the namespace.
Something like this would make it possible:
--- src/library/utils/R/objects.R (revision 56024)
+++ src/library/utils/R/objects.R (working copy)
@@ -252,8 +252,9 @@
stop("environment specified is not a package")
ns <- asNamespace(substring(nm, 9L))
2014 Oct 31
3
ScalarLogical and setAttrib
Is it expected that attributes set on a LGLSXP created by
ScalarLogical will apply to all future objects created by
ScalarLogical as well? For example: the 'test1' function below returns
FALSE and 'test2' returns FALSE with an attribute:
library(inline)
test1 <- cfunction(body = 'return ScalarLogical(0);')
test2 <- cfunction(body = '
SEXP success =
2004 May 13
0
using trace() on S4 coerce method
I'm trying to use trace() on an S4 coerce method, but get the error
Error in bindingIsLocked(what, whereM) : no binding for "coerce"
What am I doing wrong? Example code follows.
(I've googled the R mailing lists for "trace coerce" and "trace
bindingisLocked" without finding anything relevant. Perhaps I should
re-define the method in terms of an
2019 Feb 26
8
Intermittent crashes with inset `[<-` command
The following code crashes after about 300 iterations on my?x86_64-w64-mingw32?machine on R 3.5.2 --vanilla.??
Others have duplicated this (see?https://github.com/tidyverse/magrittr/issues/190?if necessary), but I don't know how machine/OS-dependent it may be.??
If it doesn't crash for you, please try increasing the length of the x vector.
Substituting the commented-out line for the one
2019 Feb 27
2
Intermittent crashes with inset `[<-` command
Valgrind (without gctorture) reports memory misuse:
% R --debugger=valgrind --debugger-args="--leak-check=full --num-callers=18"
...
> x <- 1:200000
> y <- rep(letters[1:5], length(x) / 5L)
> for (i in 1:1000) {
+ # x[y == 'a'] <- x[y == 'b']
+ x <- `[<-`(x, y == 'a', x[y == 'b'])
+ cat(i, '')
+ }
1 2 3 4 5 6 7 8 9 10
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
Control statements with condition with greater than one should give error (not just warning) [PATCH]
2017 Mar 03
2
Control statements with condition with greater than one should give error (not just warning) [PATCH]
I'd like to propose that the whenever the length of condition passed
to an if or a while statement differs from one, an error is produced
rather than just a warning as today:
> x <- 1:2
> if (x == 1) message("x == 1")
x == 1
Warning message:
In if (x == 1) message("x == 1") :
the condition has length > 1 and only the first element will be used
There are
2016 May 12
3
Suggestion: mkString(NULL) should be NA
I would like to propose that Rf_mkString(NULL) and Rf_mkChar(NULL)
return NA rather than segfault.
Case: the mkString() and mkChar() functions are convenient to wrap
strings returned by e.g. external C libraries into an R vector.
However sometimes a library returns NULL instead of a string when the
result is unavailable. In some C libraries this can happen
unexpectedly or is even undocumented.
A
2018 Mar 29
2
Possible `substr` bug in UTF-8 Corner Case
I think there is a memory bug in `substr` that is triggered by a UTF-8 corner case: an incomplete UTF-8 byte sequence at the end of a string.? With a valgrind level 2 instrumented build of R-devel I get:
> string <- "abc\xEE"??? # \xEE indicates the start of a 3 byte UTF-8 sequence
> Encoding(string) <- "UTF-8"
> substr(string, 1, 10)
==15375== Invalid read of
2018 Jun 28
1
Null pointer dereference in Rf_isVector()
Hello,
After some fuzz testing I found a problem with Rf_isVector() function in
R 3.5.0.
Platform: Ubuntu 16.04
Compiler: Clang-4.0 (from Ubuntu's repository) + ASAN
Crashing R code:
2019 Jan 21
2
pmax and long vector
I see that base::pmax() does not support long vectors.
Is R-devel interested in reports like this; ie. is there a goal of full
support for long vectors in "basic" functions, something I at least would
greatly appreciate?
MRE:
> pmax(rep(1L, 3*10^9), 0)
Error in pmax(rep(1L, 3 * 10^9), 0) :
long vectors not supported yet:
../../../R-devel-src/src/include/Rinlinedfuns.h:522
Best,
2018 Feb 14
2
long vectors not supported yet
Hi,
I am running R 3.3.3 and getting the following error:
Error in add_edges(res, edges = t(as.matrix(el[, 1:2])), attr = weight) :
long vectors not supported yet: ../../src/include/Rinlinedfuns.h:138
when passing a 13 GB TransitionLayer object to shortestPath from the
package 'gdistance'.
The error, albeit in a different context, is discussed here:
2020 Jun 30
2
Build a R call at C level
Hi All,
I was reading the R extension manual section 5.11 ( Evaluating R expression
from C) and I tried to build a simple call to the sum function. Please see
below.
call_to_sum <- inline::cfunction(
language = "C",
sig = c(x = "SEXP"), body = "
SEXP e = PROTECT(lang2(install(\"sum\"), x));
SEXP ans = PROTECT(eval(e, R_GlobalEnv));
UNPROTECT(2);
return
2020 Oct 19
2
Is there any way to check the class of an ALTREP?
Hi all,
I would like to determine if an ALTREP object is from my package, I see
there is a function `ALTREP_CLASS` defined in RInternal.h but its return
value is neither a `R_altrep_class_t` object nor an STRSXP representing a
class name. I do not know how to correctly use it. Any suggestions?
Thanks,
Jiefei
[[alternative HTML version deleted]]
2017 Oct 06
1
SIGSEGV during startup
Hi,
This problem started as of r73472 ("Merged in the rest of the basic
ALTREP framework."); I tested r73471 and it did not exist.
I'm building R devel on Ubuntu 16.04.3 LTS (64-bit), with the following flags:
CC="gcc -std=gnu99 -fsanitize=address -fno-omit-frame-pointer"
CFLAGS="-fno-omit-frame-pointer -g -O2 -Wall -pedantic -mtune=native"
and using
2020 Jun 30
3
Build a R call at C level
On 6/30/20 1:06 PM, Jan Gorecki wrote:
> It is quite known that R documentation on R C api could be improved...
Please see "5.11 Evaluating R expressions from C" from "Writing R
Extensions"
Best
Tomas
> Still R-package-devel mailing list should be preferred for this kind
> of questions.
> Not sure if that is the best way, but works.
>
> call_to_sum <-
2017 Jan 25
2
parallel::mc*: Is it possible for a child process to know it is a fork?
When using multicore-forking of the parallel package, is it possible
for a child process to know that it is a fork? Something like:
parallel::mclapply(1:10, FUN = function(i) { test_if_running_in_a_fork() })
I'm looking into ways to protect against further parallel processes
(including threads), which not necessarily are created via the
parallel:mc* API, are being spawned off recursively.
2019 Jan 21
2
pmax and long vector
Kasper,
If you're not interested or dont have time to create said patch yourself
let me know and i can do it.
Best,
~G
On Mon, Jan 21, 2019, 11:36 AM Duncan Murdoch <murdoch.duncan at gmail.com
wrote:
> On 21/01/2019 12:35 p.m., Kasper Daniel Hansen wrote:
> > I see that base::pmax() does not support long vectors.
> >
> > Is R-devel interested in reports like this;
2007 Jan 31
1
problem with compilation of R on Solaris 10 in x86
Dear List,
we're trying to install R on Solaris10 on a x86 (amd64).
During the installation we pass successfully the ./configure but we get
an error through the built-in function "_isnan" which we see existing in
/lib
When passing the command "make" we get :
gcc -std=gnu99 -I../../src/extra/zlib -I../../src/extra/bzip2
-I../../src/extra/pcre -I. -I../../src/include
2020 Oct 19
2
Is there any way to check the class of an ALTREP?
Benjamin,
You happened to send a link which points to the OP's own package :) I
think Jiefei would like to know how one can "officially" determine if an
arbitrary ALTERP object belongs to a class that he owns.
Regards,
Denes
On 10/19/20 10:22 AM, Benjamin Christoffersen wrote:
> It seems as if you can you use the ALTREP macro as done in this
> package: