[Rd] Problem with accessing internal variable in package.

2007-05-25 Thread Vladimir Eremeev
I am writing a package, which contains several functions and variables. The variables are for internal use by functions. Functions are ment to be callable by a user. However, the function cannot access these variables. The package contains only R code, and was created using package.skeleton pa

Re: [Rd] Problem with accessing internal variable in package.

2007-05-25 Thread Vladimir Eremeev
This is my first package, and clearly, I'm missing something. After reading again manuals about name spaces and hooks, I have defined the function .onLoad, which implicitly assigns all internal variables with <<- Then I have deleted previous package directory and changed the call to package.skele

[Rd] C code for qbeta

2007-05-25 Thread Gatsu
Can somebody help me? I need the C/C++ code for the R's qbeta function. Can you send it to me a [EMAIL PROTECTED] ? PS: I'm italian, i can't speak english very well... ___ __ R-devel@r-project.org mailing list h

Re: [Rd] C code for qbeta

2007-05-25 Thread Sean Davis
On Friday 25 May 2007 05:02, Gatsu wrote: > Can somebody help me? > > I need the C/C++ code for the R's qbeta function. R is open-source, so you can simply download the source and look at whatever parts you like. Sean __ R-devel@r-project.org mailing

[Rd] private variables in package.

2007-05-25 Thread Vladimir Eremeev
I am sorry, my previous questions about hiding variables from users in a package were obscure and vague, and would like to clarify them. This should be a basic question. I am writing my first package. It has several functions, which should be callable by users. These functions use several variabl

Re: [Rd] private variables in package.

2007-05-25 Thread Vladimir Eremeev
Thank you for the answer. Here is everything. ac9wl<-c(412,440,488,510,532,555,650,676,715) ac9nw<-length(ac9wl) AB2C <-function(a,b,model.type="S") { nza<-dim(a)[1] nwa<-dim(a)[2] nzb<-dim(b)[1] nwb<-dim(b)[2] if(nza!=nzb || nwa!=ac9nw || nwb!=ac9nw) { warning('AB2C: Dimension

Re: [Rd] private variables in package.

2007-05-25 Thread Duncan Murdoch
On 5/25/2007 7:27 AM, Vladimir Eremeev wrote: > Thank you for the answer. > > Here is everything. > > ac9wl<-c(412,440,488,510,532,555,650,676,715) > ac9nw<-length(ac9wl) > > AB2C <-function(a,b,model.type="S") { > nza<-dim(a)[1] > nwa<-dim(a)[2] > nzb<-dim(b)[1] > nwb<-dim(b)[2] > >

Re: [Rd] private variables in package.

2007-05-25 Thread Vladimir Eremeev
I do use this function. Here is the example session, run from the newly created directory, without .Rdata and .Rhistory files. === begin R version 2.5.0 Patched (2007-05-13 r41549) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with

[Rd] solved.

2007-05-25 Thread Vladimir Eremeev
By removing the data directory (which package.skeleton has created, and where it has put all my variables in files with .rda extension) and adding one more file to the R directory, containing the variable assignments. Vladimir Eremeev wrote: > > I do use this function. > Here is the example ses

Re: [Rd] private variables in package.

2007-05-25 Thread Prof Brian Ripley
R has debugging features: see 'Writing R Extensions'. Please make use of them, e.g. options(error=recover) will enable you to explore the environments that are visible. We can only guess at this, not having function AB2C. On Fri, 25 May 2007, Vladimir Eremeev wrote: > > I am sorry, my previou

[Rd] documented/undocumented behavior of as.double(formatC(x, digits=17))

2007-05-25 Thread Petr Savicky
Some days ago, there was a discussion about the command formatC(exp(1),digits=100,width=-1) Converting a double value to a string, from which the double may be reconstructed exactly, may be useful. So, I did some experimentation with it in my linux installation of R-2.5.0. I generated a vector

[Rd] Recent changes in R related to CHARSXPs

2007-05-25 Thread Seth Falcon
Hello all, I want to highlight a recent change in R-devel to the larger developeR community. As of r41495, R maintains a global cache of CHARSXPs such that each unique string is stored only once in memory. For many common use cases, such as dimnames of matrices and keys in environments, the resu

Re: [Rd] C code for qbeta

2007-05-25 Thread Thomas Lumley
On Fri, 25 May 2007, Sean Davis wrote: > On Friday 25 May 2007 05:02, Gatsu wrote: >> Can somebody help me? >> >> I need the C/C++ code for the R's qbeta function. > > R is open-source, so you can simply download the source and look at whatever > parts you like. > Finding the qbeta function may t

[Rd] R scripts slowing down after repeated called to compiled code

2007-05-25 Thread Michael Braun
Thanks in advance to anyone that might be able to help me with this problem. I have not been able to find a reference to it in the documentation on online sources, so I am turning to this group. I am running R 2.4.1 under Red Hat Enterprise Linux 4, on an x86_64 platform (multi-core Intel Xeon pr

Re: [Rd] R scripts slowing down after repeated called to compiled code

2007-05-25 Thread Vladimir Dergachev
On Friday 25 May 2007 7:12 pm, Michael Braun wrote: > Thanks in advance to anyone that might be able to help me with this > > Also, it is not just the compiled call that slows down. EVERYTHING > slows down, even those that consist only of standard R functions. The > time for each of these functio

Re: [Rd] R scripts slowing down after repeated called to compiled code

2007-05-25 Thread Michael Braun
Vladimir: Thanks for your response. I have done as you requested (with a smaller dataset--the patterns are still there). Here is the gc()-laden output. I don;t fully understand the meaning of all parts of these reports. But it does look like the number of objects grows (and it grows faster on

Re: [Rd] R scripts slowing down after repeated called to compiled code

2007-05-25 Thread Dirk Eddelbuettel
On 25 May 2007 at 19:12, Michael Braun wrote: | So I'm stuck. Can anyone help? It sounds like a memory issue. Your memory may just get fragmented. One tool that may help you find leaks is valgrind -- see the 'R Extensions' manual. I can also recommend the visualisers like kcachegrind (part of KD