From wl2776 at gmail.com  Fri May 25 13:27:29 2007
From: wl2776 at gmail.com (Vladimir Eremeev)
Date: Fri, 25 May 2007 04:27:29 -0700 (PDT)
Subject: [Rd] private variables in package.
In-Reply-To: <Pine.LNX.4.64.0705251155280.14500@gannet.stats.ox.ac.uk>
References: <10800416.post@talk.nabble.com>
	<Pine.LNX.4.64.0705251155280.14500@gannet.stats.ox.ac.uk>
Message-ID: <10801165.post@talk.nabble.com>


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: Dimensions of the input matrices are invalid')
    return(NULL);
  }

 [ further calculations, they  do not use ac9nw ]  
}



ripley-3 wrote:
> 
> 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 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 variables, and I would like to hide these
>> variables from users.
>> How can I do it?
>>
>> For example, the package has a function AB2C, which uses the variable
>> ac9nw.
>> If I add the file NAMESPACE, exporting only AB2C, then I get the error:
>>
>>   Error in AB2C(a, b, model.type) : object "ac9nw" not found
> 

-- 
View this message in context: http://www.nabble.com/private-variables-in-package.-tf3815306.html#a10801165
Sent from the R devel mailing list archive at Nabble.com.



[Rd] private variables in package.
Vladimir Eremeev