Displaying 3 results from an estimated 3 matches for "ab2c".
Did you mean:
ab2
2007 May 25
1
Problem with accessing internal variable in package.
...LP","SP","syn","unk","Y","Nh",
"plot.C","read.AC9.data","EstimC","plot.AC9"),
namespace=TRUE,force=TRUE)
Among others, the package contains the functions EstimC, AB2C, AB2C.S, and
AB2C.HK, and variables ac9nw, ac9wl, ac9aw, ...
Functions use these variables for calculations, and I would like to hide
them from users.
The file NAMESPACE contains the single line:
export(AB2C.HK,AB2C,AB2C.S,EstimC,plot.C,read.AC9.data,plot.AC9)
I am getting the following error:...
2007 May 25
1
private variables in package.
...d 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
I also tried to include in the .onLoad function the code, defining these
variables with <<-
However, this code ha...
2007 May 22
2
Please, remind a function name
..., I'm stuck. :)
I am writing a function, which would fit either one linear model or another
one, depending on its argument model.type.
And I don't want to use several if's, because R allows doing it with much
more beauty.
That is I am looking for prettier alternative to the following
AB2C<-function(a,b,model.type="S") { # or HK, and return NULL if this
argument has any other value
[ do some stuff]
if(model.type=="S") model<-lm( [s.model formula] )
else if (model.type == "HK") model<-lm([hk.model formula])
else model<-NULL
return(mo...