search for: importfrom

Displaying 20 results from an estimated 161 matches for "importfrom".

2013 Mar 20
0
How to avoid using gridextra via Depends instead of Imports in a package ?
...=qb_theme_nopadding(), scales=list(draw=FALSE), cex=0.6,...) gr <- grob(p=pltoverview, ..., cl="lattice") grid.draw(gr) # <----------------------------------------------- problematic call } NAMESPACE ------------------ export(panelinplot2) export(plot_fdr) importFrom(grid,gpar) importFrom(grid,grid.draw) importFrom(grid,grid.rect) importFrom(grid,grid.text) importFrom(grid,grob) importFrom(grid,popViewport) importFrom(grid,pushViewport) importFrom(grid,unit) importFrom(grid,viewport) importFrom(gridExtra,drawDetails.lattice) importFrom(lattice,ltext) importFrom...
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 loadNamespa...
2005 Apr 28
1
strange behaviour of importFrom directive in name space
...rada name space. When I attach RColorBrewer, the example runs fine. For several other function from different packages the import works without problems. I'm quite puzzled how this import can work with R CMD check but not when attaching the package in a "regular" R session. And if the importFrom directive was corrupted, shouldn't there be an error message? This is not realy a problem, since I can load RColorBrewer by putting it into the dependent field in my DESCRIPTION file as I did before, but none the less I wanted to mention this strange behaviour. Could it be a bug? Regards, Fl...
2005 Apr 28
1
strange behaviour of importFrom directive in name space
...rada name space. When I attach RColorBrewer, the example runs fine. For several other function from different packages the import works without problems. I'm quite puzzled how this import can work with R CMD check but not when attaching the package in a "regular" R session. And if the importFrom directive was corrupted, shouldn't there be an error message? This is not realy a problem, since I can load RColorBrewer by putting it into the dependent field in my DESCRIPTION file as I did before, but none the less I wanted to mention this strange behaviour. Could it be a bug? Regards, Fl...
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 C...
2018 Mar 13
2
importing namespaces from base packages
...ort(s|From) \ > ............................ <==> DESCRIPTION -> 'Imports:' > 2) .. using "::" in R code / > > > If you really found that you did not have to import from say > 'utils', I think this was a *un*lucky coincidence. Of course, the importFrom() is mandatory in NAMESPACE otherwise the package does not pass the checks. The question was related to the relation between the packages mentioned in the NAMESPACE and the packages mentioned in the Imports: field from DESCRIPTION. For instance, the current version 3.1 of package QCA on CRAN menti...
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 called from a package function) or after Suggests: (packages that are called eg from the doucmentation examples), works well. In this case...
2018 Mar 09
2
importing namespaces from base packages
...erything 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 NAMESPACE file. For instance, it is not required to specify utils in the Imports: field from DESCRIPTION, when using importFrom("utils", "packageDescription") in NAMESPACE. The opposite happens for importFrom("methods", "is"), which ends up in the...
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' fro...
2018 Jul 22
2
R History: Why is there no importFrom() function?
...s from non-core packages. This differs markedly from most languages*, which usually offer some way to selectively import symbols. For example, in Python you'd see "from random import randint", and so on. Within R packages, the NAMESPACE file provides this exact functionality with the importFrom() directive, but the R language itself does not expose this as a function for regular users. I know that R did not have namespaces for some of its early existence, but I'm curious as to why the language never acquired an import() or importFrom() replacement for library() when it did get them....
2004 Oct 17
2
Errors while compiling packages with namespace?
...9;t it? However, when I source the code in R, everything is fine. Also, this package compiled without errors before I introduced NAMESPACE. The only changes I did in the code (beside adding NAMESPACE), is to eliminate all "require(....)" and to replace them by "import" and "importFrom" statements in NAMESPACE. So, I suppose this should be due to a wrong or missing "import", or "importFrom" directive. Does anybody has another suggestion? My question is: how do I know where is the error in my code, given this message: "syntax error in line 21" w...
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 doesn't cause a build failure, but I...
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()...
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 "c('glm', 'lm')" Calls: assocTestRegression ... append ->...
2004 Sep 17
1
R-2.0.0 Install problem for package bundle with inter-dependent n amespaces
...egmisc 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) gmodels/NAMESPACE:importFrom(MASS, ginv) gplots/NAMESPACE:importFrom(gtools, invalid) gplots/NAMESPACE:importFrom(gtools, odd) gplots/NAMESPACE:importFrom(gdata, nobs) Under R-1.9.1, this package bundle passes R CMD check and installs happily. However, under ye...
2013 Oct 29
1
Imports, importFrom slow (for Matrix)
...tion.) # Empty session: ~$ time Rscript -e 'ls()' > /dev/null real 0m0.251s user 0m0.196s sys 0m0.049s # Without importing from Matrix: ~$ time Rscript -e 'library(igraph); ls()' > /dev/null Loading required package: methods real 0m0.419s user 0m0.363s sys 0m0.049s # Adding importFrom(Matrix, sparseMatrix) to NAMESPACE: ~$ time Rscript -e 'library(igraph); ls()' > /dev/null Loading required package: methods real 0m2.963s user 0m2.844s sys 0m0.115s This solution was fine with me, especially because other packages depending on igraph and using Matrix through igraph wor...
2009 Jun 03
0
Problems with conditional importFrom in NAMESPACE
...nly 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 should be possible to solve by having a conditional importFrom in NAMESPACE of pkg2: if ("pkg1" %in% rownames(utils:::installed.packages()) { importFrom(pkg1,fun1,fun2,fun3) S3method(fun1,class2) S3method(fun2,class2) S3method(fun3,class2) } What causes trouble for me is that the dependency of pkg1 seems to be defined at the time of buildi...
2018 Mar 13
0
importing namespaces from base packages
...lt;==> DESCRIPTION -> 'Imports:' >> 2) .. using "::" in R code / >> >> >> If you really found that you did not have to import from say >> 'utils', I think this was a *un*lucky coincidence. > Of course, the importFrom() is mandatory in NAMESPACE otherwise the package > does not pass the checks. > The question was related to the relation between the packages mentioned in > the NAMESPACE and the packages mentioned in the Imports: field from > DESCRIPTION. > For instance, the cur...
2015 Oct 04
0
Conditional importFrom (roxygen?)
...: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 to submit to CRAN). >>> >> >> Yes, you can put conditionals into the NAMESPACE file. Apparently >> roxygen2 doesn't support this feature, so you'll have to do it by hand. >> >>...
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 NAMESPACE file. Apparently > roxygen2 doesn't support this feature, so you'll have to do it by hand. > > Duncan Murdoch > &...