Displaying 20 results from an estimated 6000 matches similar to: "R History: Why is there no importFrom() function?"
2012 Jan 14
1
A: ImportFrom(B, ...) -- B: ImportFrom(A, ...)
If I have a package A whose NAMESPACE has
ImportFrom(B, <B-syms>))
and a package B whose NAMESPACE has
ImportFrom(A, <A-syms>)
and we can assume that <A-syms> and <B-syms> are disjoint.
The clue would be that I only import relatively little from
one namespace to the other.
I currently get an error
Error in loadNamespace(imp[[1L]], c(lib.loc, .libPaths())) :
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'
2005 Apr 28
1
strange behaviour of importFrom directive in name space
Dear listers,
After activating the name space for my bioconductor package (prada) I
successfully ran R CMD check. However when loading the package in R and
running the examples the imported function brewer.pal from package
RColorBrewer is not found. I can directly call brewer.pal from the
RColorBrewer name space typing RColorBrewer::brewer.pal, but it is not
imported into my prada name space. When
2005 Apr 28
1
strange behaviour of importFrom directive in name space
Dear listers,
After activating the name space for my bioconductor package (prada) I
successfully ran R CMD check. However when loading the package in R and
running the examples the imported function brewer.pal from package
RColorBrewer is not found. I can directly call brewer.pal from the
RColorBrewer name space typing RColorBrewer::brewer.pal, but it is not
imported into my prada name space. When
2015 Oct 04
2
Conditional importFrom (roxygen?)
Folks:
I am getting a build failure when I:
#' @importFrom utils shortPathName
which roxygenizes it to the NAMESPACE.
I suspect this is because this particular function is Windows-only, but I'm
a bit confused how I should "properly" importFrom a function like this so
it doesn't cause a build failure, but I don't get a note in my R CMD CHECK
if I DON'T have it:
2013 Oct 29
1
Imports, importFrom slow (for Matrix)
Dear All,
before its latest version my package had 'Imports: Matrix' in its
DESCRIPTION file, but it did not import anything in NAMESPACE. Rather,
some functions explicitly loaded Matrix, as they needed. The reason
for this was that importing Matrix is really slow, and only very few
igraph functions need it. (I guess Matrix is slow because of the many
registered names, but that is another
2013 Feb 07
1
How to NAMESPACE OS-specific importFrom?
I'd like to importFrom(parallel, mccollect, mcparallel) but on Windows these are
not exported because this
if(tools:::.OStype() == "unix") {
export(mccollect, mcparallel, mc.reset.stream, mcaffinity)
}
appears at src/library/parallel/NAMESPACE:6 of svn r61857. So should I be doing
if (tools:::.OStype() == "unix") {
importFrom(parallel, mccollect, mcparallel)
}
2012 Jan 10
1
importing S3 methods with importFrom
In my own package, I want to use the default S3 method of the generic
function lrtest() from the lmtest package. Since I need only one
function from lmtest, I tried to use importFrom in my NAMESPACE:
importFrom(lmtest, lrtest)
However, this fails R CMD check in the examples:
Error in UseMethod("lrtest") :
no applicable method for 'lrtest' applied to an object of class
2006 Aug 04
3
Building a random walk vector
I'm studying R in my free time. I want to build a vector where each
element is equal to the element before it in the sequence plus some
random tweak.
In python, I would write:
vec = [100] * 50 # make a 50-element list with each element set to 100
from random import randint
for i, v in enumerate(vec):
if i is not 0: # if we're not on the first element
vec[i] = vec[i-1] +
2015 Oct 04
2
Conditional importFrom (roxygen?)
Duncan Murdoch <murdoch.duncan <at> gmail.com> writes:
>
> On 04/10/2015 10:10 AM, Jonathan Greenberg wrote:
> > Folks:
> >
[snip snip snip]
> >
> > Is there a way to do a conditional importFrom based on the OS? Or can I
> > safely ignore this (I'm trying to submit to CRAN).
> >
>
> Yes, you can put conditionals into the
2018 Mar 13
2
importing namespaces from base packages
On Mon, Mar 12, 2018 at 2:18 PM, Martin Maechler <maechler at stat.math.ethz.ch>
wrote:
> [...]
> Is that so? Not according to my reading of the 'Writing R
> Extensions' manual, nor according to what I have been doing in
> all of my packages for ca. 2 years:
>
> The rule I have in my mind is
>
> 1) NAMESPACE Import(s|From) \
>
2012 Mar 18
1
Namespace dependency not required
Hi,
I am working at adding namespace to my packages, carefully following the
doc "Writing R extensions" and some threads on the web. However I cannot
find clear explanation about how to best deal with the import or
importFrom functions in the name space. To make it short:
To declare dependencies in the description file either after Depends:
(packages including functions that are
2004 Oct 17
2
Errors while compiling packages with namespace?
Hello,
I try to set up namespaces for packages. It is fine for several of them,
except one whose compilation fails (under Windows XP & R 2.0.0):
---------- Making package svViews ------------
adding build stamp to DESCRIPTION
installing NAMESPACE file and metadata
Error in parse(file, n, text, prompt) : syntax error on line 21
Execution halted
make[2]: *** [nmspace] Error 1
make[1]: ***
2018 Mar 09
2
importing namespaces from base packages
Dear All,
I understand the R CMD checks with only the base package attached,
everything else (including the other packages bundled with the base R)
should be imported and most importantly declared in the Imports field from
the DESCRIPTION file.
However, I do use functions from other packages than base (utils,
grDevices, stats, graphics), for which it is sufficient to declare
importFrom() in the
2015 Oct 04
0
Conditional importFrom (roxygen?)
On 04/10/2015 10:10 AM, Jonathan Greenberg wrote:
> Folks:
>
> I am getting a build failure when I:
> #' @importFrom utils shortPathName
>
> which roxygenizes it to the NAMESPACE.
>
> I suspect this is because this particular function is Windows-only, but I'm
> a bit confused how I should "properly" importFrom a function like this so
> it
2004 Sep 17
1
R-2.0.0 Install problem for package bundle with inter-dependent n amespaces
I have a revised version of the gregmisc package, which I've converted into
a package bundle each of which has a namespace: gplots, gmodels, gdata,
gtoools. Of course, there are interdependencies among these namespaces:
gsun374: /tmp [11]> cd gregmisc/
gsun374: gregmisc [12]> grep import */NAMESPACE
gdata/NAMESPACE:importFrom(gtools, odd, invalid, mixedsort)
2009 Jun 03
0
Problems with conditional importFrom in NAMESPACE
Hi,
I am currently involved in the development of two R-packages, pkg1 and
pkg2. They should not be dependent on each other, as most users will
only be interested in one of them. Still, I want pkg2 to provide one
extra S3 method for three functions (fun1-3) in pkg1 for objects of a
class defined in pkg2 (class2), for those users who actually have both
packages installed.
I think this
2015 Jan 22
2
[LLVMdev] access IntegerType::getSignBit from Type *
Hi,
I have a Type * which may come from an IntegerType as shown below:
Type.getIntegerBitWidth() tells me numBits.
But how to extract the IntegerType.getSignBit?
If pType isIntegerType, I need to know if it is signed or unsigned...
How to achieve this?
Thx
Alex
llvm::Type * getRandomValid_IntegerType(llvm::LLVMContext &C)
{
using namespace llvm;
//--- determine num of bits
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
2015 Oct 04
0
Conditional importFrom (roxygen?)
On 04/10/2015 7:34 PM, Ben Bolker wrote:
> Duncan Murdoch <murdoch.duncan <at> gmail.com> writes:
>
>>
>> On 04/10/2015 10:10 AM, Jonathan Greenberg wrote:
>>> Folks:
>>>
>
> [snip snip snip]
>
>>>
>>> Is there a way to do a conditional importFrom based on the OS? Or can I
>>> safely ignore this (I'm trying