similar to: Speed improvement to evalList

Displaying 20 results from an estimated 200 matches similar to: "Speed improvement to evalList"

2002 Jan 07
1
Mishandling missing "..." (PR#1247)
R> myfun <- function(x, ...) {x[...] <- 0; x} R> myfun(3) Error in myfun(3) : SubAssignArgs: invalid number of arguments It fails because no ... was passed. The workaround (and desired behavior) is: R> myfun <- function(x, ...) {if (missing(...)) x[] <- 0 else x[...] <- 0; x} R> myfun(3) [1] 0 Deja vu? This is the one piece of my PR#1110 (Oct 3, 2001) that I
2016 Feb 14
4
Implementation of substring search in omegascript
Hi, I'm Ayush an undergraduate Computer Science student from Thapar university, India. I was fiddling with xapian since the morning and trying to understand the code and internals of Xapian. I tried implementing the bite sized project idea posted here: https://trac.xapian.org/wiki/ProjectIdeas#AddnewOmegaScriptcommandtodoasubstringsearch but could not understand what needs to be returned when
2003 Jun 06
1
Problerm building R-1.7.0 on OpenBSD3.2/sparc64
Hi all, I try to build R-1.7.0 + patches. when problem arise. I start with appling the patches and second configure and make. Any ideas whats wrong (wrong compiler wrong make version or missing an essential library...) /Ulf D heres the log: **** cut************ making method_meta_data.d from method_meta_data.c making slot.d from slot.c making class_support.d from class_support.c making tests.d
2010 Aug 23
1
Speed improvement to PROTECT, UNPROTECT, etc.
As I mentioned in my previous message about speeding up evalList, I've been looking at ways to speed up the R interpreter. One sees in the code many, many calls of PROTECT, UNPROTECT, and related functions, so that seems like an obvious target for optimization. Indeed, I've found that one can speed up the interpreter by about 10% by just changing these. The functions are actually macros
2020 May 22
0
round() and signif() do not check argument names when a single argument is given
Hi, I was told to send this to the -devel list instead of posting to bugzilla. When round our signif are called with a single named argument, R does not check the name and runs the function with that named argument directly as the first argument, using 0.0 or 6.0 (6 in the case of signif) for the second argument. Not checking the argument name is at odds with how all other primitive functions
2020 Jun 23
1
mget(missingArgument)?
Currently, when mget() is used to get the value of a function's argument with no default value and no value in the call it returns the empty name (R_MissingArg). Is that the right thing to do or should it return 'ifnotfound' or give an error? E.g., > a <- (function(x) { y <- "y from function's environment"; mget(c("x","y","z"),
2002 May 01
1
compiling R-1.5.0, package methods, on Solaris 5.7
Compiling package methods, R-1.5.0, on Solaris 5.7 failed (output below) for me with - gcc-2.95.3, perl-5.005_03 and also - gcc-3.0.4, perl-5.6.1 Any ideas a) what the problem is or even better b) how to solve it? Uwe Ligges =================================== [...] building package 'methods' ../../../library/methods/man/methods.Rd is unchanged making do_substitute_direct.d from
2014 Mar 06
1
Create dataframe in C from table and return to R
Hi , I am trying to create a dataframe in C and sebd it back to R. Can anyone point me to the part of the source code where it is doing , let me explain the problem I am having . -------------------------------------------------------------------- My simple implementation is like this SEXP formDF() { SEXP dfm ,df , dfint , dfStr,lsnm; char *ab[3] =
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 <-
2002 Jan 02
1
Building R-1.4 on Tru64
Hello everyone, I've just attempted to build R-1.4 on Compaq Tru64 (I'll enclose the text from bug.report() from R-1.3.1 at the end.) The relevant part of the log is below. Any ideas? gcc -shared -o methods.so do_substitute_direct.o methods_list_dispatch.o method_meta_data.o slot.o -L/usr/local/lib /usr/ucb/ld: Warning: Unresolved: TYPEOF Rf_error Rf_protect Rf_substitute
2020 Sep 11
4
Garbage collection of seemingly PROTECTed pairlist
I want to write an R function using R's C interface that takes a 2-column matrix of increasing, non-overlapping integer intervals and returns a list with those intervals plus some added intervals, such that there are no gaps. For example, it should take the matrix rbind(c(5L, 6L), c(7L, 10L), c(20L, 30L)) and return list(c(5L, 6L), c(7L, 10L), c(11L, 19L), c(20L, 30L)). Because the output is
2017 May 15
3
stopifnot() does not stop at first non-TRUE argument
Le 15/05/2017 ? 15:37, Martin Maechler a ?crit : >>>>>> Serguei Sokol <sokol at insa-toulouse.fr> >>>>>> on Mon, 15 May 2017 13:14:34 +0200 writes: > > I see in the archives that the attachment cannot pass. > > So, here is the code: > > [....... MM: I needed to reformat etc to match closely to > the current
2023 Nov 11
1
New syntax for positional-only function parameters?
6 ?????? 2023 ?. 22:54:24 GMT+03:00, mikkmart via R-devel <r-devel at r-project.org> ?????: >The pattern of functions accepting other functions as inputs and >passing additional ... arguments to them is prevalent throughout >the R ecosystem. Currently, however, all such functions must one >way or another tackle the problem of inadvertently passing arguments >meant to go to
2010 Sep 03
1
Fourteen patches to speed up R
I've continued to work on speeding up R, and now have a collection of fourteen patches, some of which speed up particular functions, and some of which reduce general interpretive overhead. The total speed improvement from these patches is substantial. It varies a lot from one R program to the next, of course, and probably from one machine to the next, but speedups of 25% can be expected in
2017 May 15
4
stopifnot() does not stop at first non-TRUE argument
This is getting pretty convoluted. The current behavior is consistent with the description at the top of the help page -- it does not promise to stop evaluation once the first non-TRUE is found. That seems OK to me -- if you want sequencing you can use stopifnot(A) stopifnot(B) or stopifnot(A && B) I could see an argument for a change that in the multiple argumetn case reports _all_
2009 Sep 29
3
How do I access class slots from C?
Hi I'm trying to implement something similar to the following R snippet using C. I seem to have hit the wall on accessing class slots using C. library(fPortfolio) lppData <- 100 * LPP2005.RET[, 1:6] ewSpec <- portfolioSpec() nAssets <- ncol(lppData) setWeights(ewSpec) <- rep(1/nAssets, times = nAssets) ewPortfolio <- feasiblePortfolio( data = lppData, spec = ewSpec,
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
2017 Jan 04
4
seq.int/seq.default
On 1/4/17 1:26 AM, Martin Maechler wrote: >>>>>> Mick Jordan <mick.jordan at oracle.com> >>>>>> on Tue, 3 Jan 2017 07:57:15 -0800 writes: > > This is a message for someone familiar with the implementation. > > Superficially the R code for seq.default and the C code for seq.int > > appear to be semantically very
2017 May 16
2
stopifnot() does not stop at first non-TRUE argument
>>>>> Herv? Pag?s <hpages at fredhutch.org> >>>>> on Mon, 15 May 2017 16:54:46 -0700 writes: > Hi, > On 05/15/2017 10:41 AM, luke-tierney at uiowa.edu wrote: >> This is getting pretty convoluted. >> >> The current behavior is consistent with the description at the top of >> the help page -- it does not
2008 Oct 24
1
changed behaviour of 'get' in 2.8.0: request for unchange
There is an unannounced and non-backwards-compatible change to the behaviour of 'get' in R2.8.0. 'get'ting a missing value now causes an error, whereas hitherto it's just returned a "missing" object. For example, in R2.8.0 this happens: test> getto <- function( x) get( 'x', sys.frame(1)) test> getto() Error in get("x", sys.frame(1)) :