[Rd] qpois Help problems (PR#14200)

2010-01-30 Thread Jerry . Lewis
Full_Name: Jerry W. Lewis
Version: 2.10.1
OS: Windows XP Professional
Submission from: (NULL) (198.180.131.21)


In the line 

"The quantile is right continuous: qpois(q, lambda) is the smallest integer x
such that P(X <= x) >= q."

"q" is used as a probability when the Arguments section defines it to be a
quantile.

Also there are some representation problems where the escape character is
printed instead of interpreted, such as "\ldots" and "\lambda" in the preceding
lines.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Stop packages and datasets to be loaded on startup.

2010-01-30 Thread Guillaume Yziquel

Hi.

I would like to know how to start an embedded R session, and avoid 
datasets and the standard library packages to be loaded on startup.


I've been looking at littler's code (so this is partly a question to 
Dirk Eddelbuettel...):



/* We don't require() default packages upon startup; rather, we
 * set up delayedAssign's instead. see autoloads().
 */
if (setenv("R_DEFAULT_PACKAGES","NULL",1) != 0){
perror("ERROR: couldn't set/replace R_DEFAULT_PACKAGES");
exit(1);
}


The code above happens before Rf_initEmbeddedR in littler.

So I gather that just setting R_DEFAULT_PACKAGES to NULL should be OK. 
But then, what is the rather complicated stuff in the autoload() 
function in littler.c for?


And concerning datasets, how do you avoid loading them?

All the best,

--
 Guillaume Yziquel
http://yziquel.homelinux.org/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Stop packages and datasets to be loaded on startup.

2010-01-30 Thread Simon Urbanek

On Jan 30, 2010, at 11:08 AM, Guillaume Yziquel wrote:

> Hi.
> 
> I would like to know how to start an embedded R session, and avoid datasets 
> and the standard library packages to be loaded on startup.
> 
> I've been looking at littler's code (so this is partly a question to Dirk 
> Eddelbuettel...):
> 
>>/* We don't require() default packages upon startup; rather, we
>> * set up delayedAssign's instead. see autoloads().
>> */
>>if (setenv("R_DEFAULT_PACKAGES","NULL",1) != 0){
>>perror("ERROR: couldn't set/replace R_DEFAULT_PACKAGES");
>>exit(1);
>>}
> 
> The code above happens before Rf_initEmbeddedR in littler.
> 
> So I gather that just setting R_DEFAULT_PACKAGES to NULL should be OK. But 
> then, what is the rather complicated stuff in the autoload() function in 
> littler.c for?
> 
> And concerning datasets, how do you avoid loading them?
> 

Setting R_DEFAULT_PACKAGES to NULL makes sure that default packages are not 
loaded. Note that "datasets" are not loaded at all -- you can load the datasets 
package which will make them available, but they are not really "loaded". The 
minimal setup is simply

R_DEFAULT_PACKAGES=NULL R --vanilla

However, it's your responsibility to load any packages that your code needs in 
that case.

Cheers,
Simon

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Stop packages and datasets to be loaded on startup.

2010-01-30 Thread Dirk Eddelbuettel

On 30 January 2010 at 17:08, Guillaume Yziquel wrote:
| Hi.
| 
| I would like to know how to start an embedded R session, and avoid 
| datasets and the standard library packages to be loaded on startup.
| 
| I've been looking at littler's code (so this is partly a question to 
| Dirk Eddelbuettel...):

Credit where credit is due. Littler is a project by Jeff Horner and myself
building on Jeff's work with rapache which is another industry-strength use
of embedding of the R engine.

| > /* We don't require() default packages upon startup; rather, we
| >  * set up delayedAssign's instead. see autoloads().
| >  */
| > if (setenv("R_DEFAULT_PACKAGES","NULL",1) != 0){
| > perror("ERROR: couldn't set/replace R_DEFAULT_PACKAGES");
| > exit(1);
| > }
| 
| The code above happens before Rf_initEmbeddedR in littler.
| 
| So I gather that just setting R_DEFAULT_PACKAGES to NULL should be OK. 

Yes, see Simon's reply.

| But then, what is the rather complicated stuff in the autoload() 
| function in littler.c for?

We load what we need for littler. And nothing more. See autoloads.h which is
autogenerated by make using autoloads.R during the build process.

Doing what we do here the way it is done ensures we start quicker than
Rscript (which wasn't released when we started anyway).  And what is done
here is also done in my RInside project which now builds on Windows. So if we
really wanted, we could port littler to Windows.  But neither Jeff nor I feel
a particular urge for getting into that. 
 
| And concerning datasets, how do you avoid loading them?

Maybe by not loading the datasets package?  But note that packages may fail
their examples.

-- 
Three out of two people have difficulties with fractions.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel