Displaying 20 results from an estimated 5000 matches similar to: ".Internal"
2006 Dec 28
1
calling optimize/fmin from C code
Hi,
To make a calculation (an innermost loop) that uses optimize faster, I
think I should write things in C. Is it possible to call fmin, which
is called by optimize, from C? It is not listed in Writing R
extensions, but I found
double Brent_fmin(double ax, double bx, double (*f)(double, void *),
void *info, double tol);
in Applic.h. Is this the function I am looking for?
2019 Jun 04
2
undefined symbol errors when compiling package using ALTREP API
Hello,
I'm developing a package (lazyvec) that makes full use of the ALTREP
framework (R >= 3.6.0).
One application of the package is to wrap existing ALTREP vectors in a new
ALTREP vector and pass all calls from R to the contained object. The
purpose of this is to provide a diagnostic framework for working with
ALTREP vectors and show information about internal calls.
The package builds
2019 Jun 04
2
[External] undefined symbol errors when compiling package using ALTREP API
thanks for clearing that up, so these methods are actually not meant to be
exported on Windows and OSX?
Some of the ALTREP methods that now use 'attribute_hidden' would be very
useful to packages that aim to be ALTREP aware, should the currently
(exported) API be considered final?
thanks for your time & best,
Mark
On Tue, Jun 4, 2019 at 6:52 PM Tierney, Luke <luke-tierney at
2010 Nov 02
2
on the usage of do.call
Hello all,
I don't know if it is possible, but I would like to use do.call in C code in
my package. The function do.call is defined as
> do.call
function (what, args, quote = FALSE, envir = parent.frame())
{
if (!is.list(args))
stop("second argument must be a list")
if (quote) {
enquote <- function(x) as.call(list(as.name("quote"),
2023 Feb 11
1
scan(..., skip=1e11): infinite loop; cannot interrupt
On Fri, 10 Feb 2023 23:38:55 -0600
Spencer Graves <spencer.graves at prodsyse.com> wrote:
> I have a 4.54 GB file that I'm trying to read in chunks using
> "scan(..., skip=__)". It works as expected for small values of
> "skip" but goes into an infinite loop for "skip=1e11" and similar
> large values of skip: I cannot even interrupt it; I
2019 Jul 13
2
Mitigating Stalls Caused by Call Deparse on Error
When large calls cause errors R may stall for extended periods.? This
is particularly likely to happen with `do.call`, as in this example
with a 24 second stall:
??? x <- runif(1e7)
??? system.time(do.call(paste0, list(abs, x)))? # intentional error
??? ## Error in (function (..., collapse = NULL)? :
??? ##?? cannot coerce type 'builtin' to vector of type 'character'
??? ##
2010 Aug 21
1
Speed improvement to evalList
I've been inspired to look at the R source code by some strange timing
results that I wrote about on my blog at radfordneal.wordpress.com
(see the posts on "Speeding up parentheses..." and "Two surprising
things...".
I discovered that the strange speed advantage of curly brackets over
parentheses is partially explained by an inefficiency in the evalList
and
2019 Jun 04
2
[External] undefined symbol errors when compiling package using ALTREP API
Hi Gabriel,
thanks for your detailed explanation, that definitely clarifies the design
choices that were made in setting up the ALTREP framework and I can see how
those choices make sure existing code won't break.
My specific use-case for wanting to check whether a vector is an ALTREP is
the following: the fst package wraps an external C++ library (fstlib,
independent from R) that was made
2007 Mar 27
3
Use of 'defineVar' and 'install' in .Call
Dear all,
[system and version information below]
I am trying to modify a C function for finding the root of an
expression. The function is to be called from R as .Call with input
parameters:
f: expression for which we will find the root
guesses: interval for the solution
stol: tolerance
rho: environment
The original functions I use are:
SEXP mkans(double x) {
SEXP ans;
PROTECT(ans =
2007 Mar 27
3
Use of 'defineVar' and 'install' in .Call
Dear all,
[system and version information below]
I am trying to modify a C function for finding the root of an
expression. The function is to be called from R as .Call with input
parameters:
f: expression for which we will find the root
guesses: interval for the solution
stol: tolerance
rho: environment
The original functions I use are:
SEXP mkans(double x) {
SEXP ans;
PROTECT(ans =
2019 Jul 14
2
[External] Mitigating Stalls Caused by Call Deparse on Error
Luke, thanks for considering the issue.? I would like to
try to separate the problem into two parts, as I _think_
your comments address primarily part 2 below:
1. How can we avoid significant and possibly crippling
?? stalls on error with these non-standard calls.
2. What is the best way to view these non-standard calls.
I agree that issue 2. requires further thought and
discussion under a
2020 Jan 20
1
Minor bug in error message in datetime.c
Hi,
I have spotted a minor bug in do_strptime() function. Here is a patch:
?--- a/src/main/datetime.c
+++ b/src/main/datetime.c
@@ -1048,7 +1048,7 @@ SEXP attribute_hidden do_strptime(SEXP call, SEXP op, SEXP args, SEXP env)
if(!isString((x = CAR(args))))
error(_("invalid '%s' argument"), "x");
if(!isString((sformat = CADR(args))) ||
2006 Jan 21
1
A patch for do_sample: check replace arg
A colleague sent me the following:
If you specify probabilities in the 'sample' function and forget
to type 'prob=...', then you get nonsense. E.g.
sample(1:10,1,c(0,0,0,0,1,0,0,0,0,0))
does not filter '5', while
sample(1:10,1,prob=c(0,0,0,0,1,0,0,0,0,0))
does it correctly. I wish this would return an error because the
2019 Jul 16
1
[External] Mitigating Stalls Caused by Call Deparse on Error
We also have a few other suggestions and wishes about backtrace
storage and display on the one hand, and display of constructed calls
on the other hand. Perhaps it would be better to open a different
wishlist item for traceback() to keep the discussions focused?
FWIW I think deparsing backtraces lazily is a great idea. Displaying 1
line per call by default in interactive sessions, while being
2019 Apr 05
2
patch to improve matrix conformability error message
With this patch,
> A <- matrix(1, 2, 2)
> B <- matrix(2, 3, 2)
> A %*% B
Error in A %*% B :
non-conformable arguments of dimension (2, 2) and (3, 2)
>From 205b591d4d14b5ff667325fb233a6deb08314726 Mon Sep 17 00:00:00 2001
From: Joshua Nathaniel Pritikin <jpritikin at pobox.com>
Date: Fri, 5 Apr 2019 12:03:58 -0400
Subject: [PATCH] Improve non-conformable arguments error
2014 Oct 17
1
Making parent.env<- an error for package namespaces and package imports
I'd like to propose a change to the R language so that calling
'parent.env<-' on a package namespace or package imports is a runtime
error.
Currently the documentation warns that it's dangerous behaviour and
might go away:
The replacement function ?parent.env<-? is extremely dangerous as
it can be used to destructively change environments in ways that
violate
2006 Oct 15
1
Feature request: names(someEnv) same as ls(someEnv)
Hi,
I would be nice if names() returned the equivalent of ls() for
environments.
--- a/src/main/attrib.c
+++ b/src/main/attrib.c
@@ -687,6 +687,8 @@ SEXP attribute_hidden do_names(SEXP call
s = CAR(args);
if (isVector(s) || isList(s) || isLanguage(s))
return getAttrib(s, R_NamesSymbol);
+ if (isEnvironment(s))
+ return R_lsInternal(s, 0);
return R_NilValue;
}
2014 Aug 13
5
[LLVMdev] [PATCH][RFC]: Add fmin/fmax intrinsics
Hi,
I’d like to re-propose adding intrinsics for fmin / fmax. These can be used to implement the equivalent libm functions as defined in C99 and OpenCL, which R600 and AArch64 at least have instructions with the same semantics. This is not equivalent to a simple fcmp + select due to its handling of NaNs.
This has been proposed before, but never delivered
2014 Aug 14
2
[LLVMdev] [PATCH][RFC]: Add fmin/fmax intrinsics
… actually, now that I’m able double-check this, I’m quite surprised to find that we didn’t define fmax(+0,–0) in IEEE–754, which says [paraphrased]:
minNum(x,y) is x if x < y, y if y < x, and the number if one is a number and the other is NaN. Otherwise, it is either x or y (this means results might differ among implementations).
So I think your proposed semantics are perfectly
2009 May 23
2
as.numeric(levels(factor(x))) may be a decreasing sequence
Function factor() in the current development version (2009-05-22)
guarantees that levels are different character strings. However, they
may represent the same decimal number. The following example is derived
from a posting by Stavros Macrakis in thread "Match .3 in a sequence"
in March
nums <- 0.3 + 2e-16 * c(-2,-1,1,2)
f <- factor(nums)
levels(f)
# [1]