Displaying 20 results from an estimated 2000 matches similar to: "import question"
2015 Mar 02
1
clarification on import/depends for a method
User of the coxme library (mixed effects Cox models) are instructed to use ranef(),
fixed(), VarCorr(), etc to retrieve bits out of a fitted model; it purposely uses the same
methods as nlme and/or lmer.
The current behavior is to "depend" on nlme. If I defined the methods myself in coxme,
then someone who had both nlme and coxme loaded will suffer from "last loaded wins",
2011 Mar 26
1
another import puzzle
Dear list,
I have another (again possibly boneheaded) puzzle about importing,
again encapsulated in a nearly trivial package. (The package is posted
at <http://www.math.mcmaster.ca/bolker/misc/coefsumtest_0.001.tar.gz>.)
The package consists (only) of the following S3 method definitions:
coeftab <- function(object, ...) UseMethod("coeftab",object)
coeftab.default <-
2015 Feb 15
2
Imports problem
I'm testing out a new version of coxme and R CMD check fails with "could not find function
ranef" (or random.effects or fixef, or anything from nlme). The NAMESPACE file has the
line below
importFrom(nlme, ranef, random.effects, fixef, fixed.effects, VarCorr)
and nlme is declared in the DESCRIPTION file as an import. I feel that I must be staring
at some obvious (but
2013 Aug 30
2
"False" warning on "replacing previous import" when re-exporting identical object
Hi,
SETUP:
Consider three packages PkgA, PkgB and PkgC.
PkgA defines a generic function foo() and exports it;
export(foo)
PkgB imports PkgA::foo() and re-exports it;
importFrom(PkgA, foo)
export(foo)
PkgC imports everything from PkgA and PkgB:
imports(PkgA, PkgB)
PROBLEM:
Loading or attaching the namespace of PkgC will generate a warning:
replacing previous import by
2006 May 05
2
Including a single function from a package
Hello all.
I'm building a package where I want to include a function from two
different packages. In particular, I want to include mvrnorm and
hyperg_2F1 from MASS and gsl, respectively (but the specific functions
do not matter). With what I've tried after reading the "Specifying
imports and exports" section from the "Writing R Extensions" manual, I
get an error:
2013 Jun 05
1
conflicting imports despite using importFrom in NAMESPACE
Dear all,
It is my understanding that using 'importFrom' in the NAMESPACE of a package allows to avoid conflicts between different packages defining objects with identical names. However, I can still see conflicts while loading the package using 'library'.
Here is a toy example, with a package 'foo' importing 'as.igraph' from the igraph package, and 'nj'
2015 Feb 16
2
Imports problem
On 16/02/2015 8:20 AM, Therneau, Terry M., Ph.D. wrote:
>
>> > I'm testing out a new version of coxme and R CMD check fails with "could not find function
>> > ranef" (or random.effects or fixef, or anything from nlme). The NAMESPACE file has the
>> > line below
>>
>> > importFrom(nlme, ranef, random.effects, fixef,
2010 Mar 22
1
Some more help on S4 mechanism
Hello to the list
Some days ago, I placed a question on this maling-list and received an
answer from Martin
that I tried to follow. Unfortunately, I am still puzzled by the next step.
I spent the whole Week-end in gathering information from the net.
Some of them are almost contridtcory and I lack a good document to help me.
So my first question would beL Is there a convenient document which
2011 Dec 15
1
S4 NAMESPACE method imports and exports do not include (promoted?) generics
In
> R.version.string
[1] "R Under development (unstable) (2011-12-15 r57901)"
section 1.6.6 of 'Writing R Extensions' says
Note that exporting methods on a generic in the namespace will
also export the generic, and exporting a generic in the
namespace will also export its methods.
and
Note that importMethodsFrom will also import any generics defined in
2011 Mar 10
1
Problem with defining new method for residuals()
Dear all,
I'm writing a package and I would like to reuse the residuals() function. When I use a function which calls the redefined residuals (for my custom class) I get an error (see below). It looks like the wrong method is used. The strange this is, that when it execute the code manually it get no error.
Any suggestions?
Best regards,
Thierry
The entire source code is at
2012 Apr 25
1
Strange bug in my package
Dear all,
I get a bug in the examples of my AFLP package on R-forge (https://r-forge.r-project.org/R/?group_id=1027) but only on the Linux version. The windows version compiles. The Mac version skips the examples and compiles. The strange thing is that the packages compiles on my Ubuntu 10.10 machine with R 2.15.0. Therefore I can't reproduce the error.
I have traced the problem at
2011 Oct 06
1
multiple defines of diag
The current coxme code has functions that depend on bdsmatrix and others
that depend on Matrix, both those pacakges define S4 methods for diag.
When loaded, the message appears:
replacing previous import ?diag? when loading ?Matrix?
Questions:
1. Do I need to worry about this? If so, what can I do about it?
I suppose I could add an importFrom directive, but it will be a pain
unless there
2007 May 03
1
Imports/exports of S4 methods
I have a question about what to do in the following situation (please bear with
the setup):
Package A defines an S4 generic 'foo' and as well as S4 methods for 'foo' and has
exportMethods("foo")
in its NAMESPACE file.
Package B defines another method for 'foo' for class "bar" and has
importFrom(A, "foo")
exportMethods("foo")
2015 Feb 16
0
Imports problem
>>>>> Therneau, Terry M , Ph D <therneau at mayo.edu>
>>>>> on Sun, 15 Feb 2015 17:31:00 -0600 writes:
> I'm testing out a new version of coxme and R CMD check fails with "could not find function
> ranef" (or random.effects or fixef, or anything from nlme). The NAMESPACE file has the
> line below
>
2003 Sep 05
1
namespaces and S4 methods/classes
The current version of the methods package now has a namespace. Packages
using S4 methods and classes can have NAMESPACE files. New directives
can be included in NAMESPACE files to import and export classes and
methods.
Namespaces allow cleaner definition of the API for packages, and are
needed for future improvements to R.
NOTE: This is a major revision. In principle, it should be back
2015 May 04
1
Define replacement functions
No. I fixed that, the NAMESPACE file now contains:
S3method("[[<-", mylist)
S3method("$<-", mylist)
It still does not work. I also created a print method (print.mylist) which did work out of the box, regardless of being in the NAMESPACE file or not. Could it be somehow in here (also in my NAMESPACE file):
exportPattern("^[[:alpha:]]+")
Or could it be that
2015 Feb 16
0
Imports problem
> > I'm testing out a new version of coxme and R CMD check fails with "could not find function
> > ranef" (or random.effects or fixef, or anything from nlme). The NAMESPACE file has the
> > line below
>
> > importFrom(nlme, ranef, random.effects, fixef, fixed.effects, VarCorr)
>
> > and nlme is declared in the DESCRIPTION
2010 Mar 05
2
Defining a method in two packages
The coxme package has a ranef() method, as does lme4. I'm having
trouble getting them to play together, as shown below. (The particular
model in the example isn't defensible, but uses a standard data set.)
The problem is that most of the time only one of lme4 or coxme will be
loaded, so each needs to define the basic ranef function as well as a
method for it. But when loaded together
2006 Aug 02
2
lme4 and lmeSplines
I'm trying to use the lmeSplines package together with lme4.
Below is (1) an example of lmeSplines together with nlme (2) an
attempt to use lmeSplines with lme4 (3) then a comparison of the
random effects from the two different methods.
(1)
require(lmeSplines)
data(smSplineEx1)
dat <- smSplineEx1
dat.lo <- loess(y~time, data=dat)
plot(dat.lo)
dat$all <- rep(1,nrow(dat))
times20
2003 May 12
1
plot.ranef.lme (PR#2986)
library(nlme)
data(Phenobarb)
na.include <- function(x)x
phe1 <- nlme(conc~phenoModel(Subject, time, dose, lCl, lV),
data = Phenobarb,
fixed = lCl+lV~1,
random= pdDiag(lCl+lV~1),
start = c(-5,0),
na.action = na.include,
naPattern = ~!is.na(conc))
phe.ranef <- ranef(phe1,augFrame=TRUE)
plot(phe.ranef, form=lCl~Wt+ApgarInd)
[Error in max(length(x0),