Displaying 20 results from an estimated 800 matches similar to: "Modifying R_CheckStack for a speed increase"
2011 Jul 29
3
help with plot.rpart
? data=read.table("http://statcourse.com/research/boston.csv", , sep=",",
header = TRUE)
? library(rpart)
? fit=rpart (MV~ CRIM+ZN+INDUS+CHAS+NOX+RM+AGE+DIS+RAD+TAX+ PT+B+LSTAT)
Please: Show me the tree.
Mark
-------- Original Message --------
Subject: Re: [R] help with rpart
From: "Stephen Milborrow" <[1]milbo at sonic.net>
2019 May 19
4
most robust way to call R API functions from a secondary thread
Hi,
As the subject suggests, I am looking for the most robust way to call an (arbitrary) function from the R API from another but the main POSIX thread in a package's code.
I know that, "[c]alling any of the R API from threaded code is ?for experts only? and strongly discouraged. Many functions in the R API modify internal R data structures and might corrupt these data structures if
2008 Oct 25
1
0 ^ NaN == Inf, why?
In R, 0 ^ NaN yields Inf. I would have expected NaN or perhaps 0. Is this
behaviour intended?
>sessionInfo()
R version 2.8.0 (2008-10-20)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils
2019 May 20
1
most robust way to call R API functions from a secondary thread
Stepan,
Andreas gave a lot more thought into what you question in your reply. His question was how you can avoid what you where proposing and have proper threading under safe conditions. Having dealt with this before, I think Andreas' write up is pretty much the most complete analysis I have seen. I'd wait for Luke to chime in as the ultimate authority if he gets to it.
The
2008 Oct 25
1
R echoes integer literals incorrectly, under certain conditions (PR#13204)
Full_Name: Stephen Milborrow
Version: R 2.8.0
OS: Windows XP
Submission from: (NULL) (81.159.65.46)
Under certain conditions, R 2.8.0 incorrectly echoes integer literals without
the "L" suffix. R 2.7.2 is ok.
To reproduce, create two files as follows:
a.R containing: source("b.R", echo=TRUE)
b.R containing: x <- 1L
Now execute: Rterm --vanilla --silent <a.R
This
2015 Jun 26
1
[R-pkg-devel] Guidelines for S3 regression models
Stephen,
thanks for your effort. The more appropriate list for this discussion is
probably R-devel (as far as I understand it) so I've moved the discussion
there.
Related topics have already been discussed in the past. Specifically, I
remember contributions by Paul Johnson ("rockchalk" package) and John Fox
("effects" and "car" package) as their packages
2007 Jun 01
3
Question on the R's C stack limit
Dear r-devel members,
I encountered a C stack limit issue, when I tried to embed R 2.5 into my
application. In the R-exts document, it says:"Note that R's own front ends
use a stack size of 10Mb". I desire to know: is it possible to decrease this
stack size
by modifying R's source code? If it's possible, which part of the source
code is responsible for the issue?
Thank
2019 May 20
0
[External] most robust way to call R API functions from a secondary thread
Your analysis looks pretty complete to me and your solutions seems
plausible. That said, I don't know that I would have the level of
confidence yet that we haven't missed an important point that I would
want before going down this route.
Losing stack checking is risky; it might be eventually possible to
provide some support for this to be handled via a thread-local
variable. Ensuring
2019 May 20
0
most robust way to call R API functions from a secondary thread
Hi Andreas,
note that with the introduction of ALTREP, as far as I understand, calls
as "simple" as DATAPTR can execute arbitrary code (R or native). Even
without ALTREP, if you execute user-provided R code via Rf_eval and such
on some custom thread, you may end up executing native code of some
package, which may assume it is executed only from the R main thread.
Could you (1)
2007 Jun 28
1
How to set R_CStackLimit
Hi,
I have tried to disable stack checking by set R_CStackLimit to -1. However,
it always crashes my win32 multiple threads program. I am using R-2.5.0. My
code looks like:
#include <Rversion.h>
#if (R_VERSION >= R_Version(2,3,0))
#define R_INTERFACE_PTRS 1
#define CSTACK_DEFNS 1
#include <Rinterface.h>
#endif
and then, add below line to my main function:
R_CStackLimit =
2009 May 21
1
"Error: C stack usage is too close to the limit" (can't understand explanations of how to fix this)
Apparently the way to deal with this error message is to set
R_CStackLimit = (uintptr_t)-1
I tried typing this in the R console, but it says Error: object
"R_CStackLimit" not found.
So where do I type it? In one of the initialization files that R uses when
it starts up?
I can't find the answer anywhere. Please note that I don't understand words
like "DLL" or
2008 Apr 12
4
HOW TO AVOID LOOPS
> Looking for a simple, effective a minimum execution time solution.
>
> For a vector as:
>
> c(0,0,1,0,1,1,1,0,0,1,1,0,1,0,1,1,1,1,1,1)
>
To transform it to the following vector without using any loops:
> (0,0,1,0,1,2,3,0,0,1,2,0,1,0,1,2,3,4,5,6)
>
Appreciate any suggetions.
[[alternative HTML version deleted]]
2011 Apr 14
0
Postscript can be very slow in R 2.13-0
Viewing certain postscript files under R 2.13-0 is very slow, at least using
GSview on my 64 bit Windows 7 system. To see this, compare how long it
takes to display these two files (fast.ps was created by removing the /srgb
stuff in .ps.prolog):
www.milbo.org/postscript/slow.ps
www.milbo.org/postscript/fast.ps
The code to produce the above two files is here:
2007 Jul 06
1
How to disable R's C stack checking
Hi all,
I'm developing an application on Mac OS X Darwin which embeds R.
However, the application always crashes due to the C stack checking.
I know that R_CStackLimit can be set to -1 to disable the stack
checking, but I don't know where to put the code "R_CStackLimit=-1".
Please give some instructions.
Thank you very much!
Here is my compiler infomation:
$g++ -v
Using
2011 Jul 21
1
Error: bad index in plotmo functions for MARS model (package earth)
Hello all useRs,
I am tring make a simple surface plot ( 2 by 2 terms of a MARS model
(with earth package)
but I get the follow error message:
> plotmo( mars )
Error: bad index (missing column in x?)
I don't no how to workround this... :-(
I thanks in advanced by some help!
Thanks.
Cleber
###############
>
> ### example code:
> library( earth )
> data( gasoline,
2013 Nov 08
2
Earth (MARS) package with categorical predictors
It appears to be legitimate to include multi-level categorical and continuous variables in defining the model for earth (e.g. y ~ cat + cont1 + cont2) but is it also then possible use categoricals in the predict method using the earth result? I tried but it returns an error which is not very informative.
Thanks
Chris
2016 Feb 01
1
Wrong config check for __libc_stack_end
>>>>> Simon Urbanek <simon.urbanek at r-project.org>
>>>>> on Mon, 1 Feb 2016 08:36:56 -0500 writes:
> On Feb 1, 2016, at 4:16 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
[..............]
>> Back to R: I'm not familiar with that part of the code, neither
>> the configuration, nor the usage (in
2015 Aug 20
2
Child thread libR.so
So I'm working on a custom front end to R, in one mode of the front
end I dynamically load libR.so into a child worker thread. I'm very
careful to make sure it is loaded by a single thread and loaded only
once, but since it is a child thread it violates assumptions made by
the stack size checking inside of R and I get innumerable errors along
the lines of
Error: C stack usage
2008 Jan 16
0
Just-in-time compiler for R
Greetings R developers!
I have been working on a just-in-time compiler for R arithmetic expressions.
An example:
jit(1) # turn on just-in-time compilation
for(i in 1:na) # example convolution code
for(j in 1:nb)
ab[i + j] <- ab[i + j] + a[i] * b[j]
The loop will run about 30% faster. That's not much of a speedup, but the
code
2008 Oct 25
0
R echoes integer literals incorrectly, under certain conditions (PR#13205)
On 25/10/2008 10:45 AM, milbo at sonic.net wrote:
> Full_Name: Stephen Milborrow
> Version: R 2.8.0
> OS: Windows XP
> Submission from: (NULL) (81.159.65.46)
>
>
> Under certain conditions, R 2.8.0 incorrectly echoes integer literals without
> the "L" suffix. R 2.7.2 is ok.
>
> To reproduce, create two files as follows:
> a.R containing: