Comments (4)
@oggioniale : I had a look at chapter 12 of Hadley Wickham's book.
-
We should (must) have all R dependency packages listed in the DESCRIPTION file under Imports:. As it is now. This insures that whoever installs ReLTER will also have all the dependencies installed (>200). Installing all dependencies is done, of course, only once when a new user installs ReLTER.
-
On the other hand, the packages listed in NAMESPACE file are actually loaded (attached) every time you load ReLTER. This takes some time and memory. And probably is not necessary for many cases. When we specify a function, i.e.
worrms::wm_records_names()
with the fullpackage::function()
format then thewm_records_names()
function is found in theworrms
package even if that package is not loaded (attached). And we have been careful from the start to specify all function calls with that full format. So we can remove many (most) of the @import and @importFrom lines from many of the function definitions, and rerundevtools::document()
to rewrite the NAMESPACE file. Then all the rarely used packages will not be loaded from the start. This will make startup faster, avoid namespace collisions, and allow the package to use less memory.
@maelle : Any further comments on this??
Thanks
from relter.
What's the specific question? In any case yes it is better to not import (in the NAMESPACE) a whole package when you use only a few functions of that package.
from relter.
Here's what I see (not sure if this is the correct way to test...)
direct_deps <- remotes::local_package_deps()
length(direct_deps)
[1] 46
all_deps <- renv::dependencies()
Finding R package dependencies ... Done!
length(all_deps$Package)
[1] 401
So we are declaring @import
of 46 packages. And these are pulling along (recursively) another 350. And with all the importFrom()
lines in NAMESPACE we are actually attaching all these right from the start. Is this a problem?
from relter.
Yes it is a problem, especially as there is a hard CRAN limit on direct Imports in DESCRIPTION (20 if I remember correctly).
from relter.
Related Issues (20)
- change the logo of the package
- pkgdown build error HOT 53
- Release ReLTER 1.2.0
- Remove dependency on RCurl and XML
- Normalize DESCRIPTION HOT 1
- Viewing maps HOT 1
- Size of repo - figures...
- get_site_MODIS doesn't seem to use credentials from setenv
- PhenoAppLyon
- taxon_id_pesi
- rm docs folder HOT 4
- remove rgeos from description file HOT 2
- What does Rdpack::reprompt() do? HOT 2
- error when knitting sites_contact.Rmd HOT 4
- No need to load testthat in individual test files HOT 1
- suggestion: use the withr package HOT 4
- Remove dependency on RCurl HOT 3
- A package that might be relevant for ReLTER
- Actions fail for no CRAN package (MODIStsp) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from relter.