andrie / minicran Goto Github PK
View Code? Open in Web Editor NEWR package to create internally consistent, mini version of CRAN
Home Page: http://andrie.github.io/miniCRAN/
License: GNU General Public License v2.0
R package to create internally consistent, mini version of CRAN
Home Page: http://andrie.github.io/miniCRAN/
License: GNU General Public License v2.0
Need to import is
from methods
otherwise this function doesn't work when called from the commandline (e.g., using Rscript
).
However, travis-ci autobuilds fail when methods::is
is imported:
Namespace dependency not required: ‘methods’
With R CMD check
I get
* checking Rd cross-references ... WARNING
Missing link or links in documentation object 'oldPackages.Rd':
'pkgAvail(repos=path, type=type)'
The repo for source folders should have the structure
/root/src/contrib/pkg_0.0.0
CRAN requires all tests to run in fairly short amount of time.
devtools::skip_on_cran
to test locally, but skip on CRAN.Matrix
rather than raster
in example_checkVersions.R
miniCRAN
can use any CRAN-like repository as a source, including:
Sample code at https://gist.github.com/andrie/f826769f023b87799541
Add helper functions to read DESCRIPTION from any package on github.
This is the logical next step after completing #9
I'm working on a mac now, with Mavericks OS. In the example I'm playing with I had rgdal
as a package to use in the project. However, there is no binary available for my OS http://cran.r-project.org/web/packages/rgdal/index.html
Perhaps pkgDep()
can have a parameter to optionally grab pkg information via available.packages(type="source")
or similar, to then be able to get dependencies.
Or is there already a way to do this?
Right now, this function creates a duplicate and throws a warning
This may leave the repository in an inconsistent state.
Should we remove the duplicate?
On my system, getOption("repos") is just a simple string:
> getOption("repos")
[1] "http://cran.revolutionanalytics.com"
This causes pkgDep to fail:
> miniCRAN:::pkgDep("ggplot2")
Error in if (repos["CRAN"] == "@CRAN@") { :
missing value where TRUE/FALSE needed
This command fixes the problem for me:
options(repos=c(CRAN="http://cran.revolutionanalytics.com"))
Features that would be useful in dependency graph include displaying information about:
Supplements adding packages from CRAN-like repo and GitHub.
Can be used with addOldPackage(..., writePACKAGES=FALSE)
and, after a build of the package binaries on a local machine, should add the local files to the miniCRAN repo.
"local" packages here could mean package files on the local harddrive, a network location, and possibly a non-CRAN-like web location (so this would also work with prebuilt packages from Github or other site).
download=TRUE
specifies whether the package files should be downloaded from a CRAN-like repo.reindex.all=FALSE
specifies whether the entire package index should be rebuilt based on the contents of the miniCRAN repo, or whether the index should simply be modified directly (more efficient).addPackages
, updatePackages
, makeRepo
, etc. currently specify the package type as an argument.
Either:
.tar.gz
, .zip
, .tgz
)type=c("source", "win.binary", ...)
I prefer the second option.
General improvements:
@inheritParams
to simplify documentationSeparate vignettes into:
We need a simple wrapper around tools::write_PACKAGES
It's easier to edit and review roxygen if the documentation runs on a single line.
Most IDEs, and particularly RStudio allows soft line wrapping.
Having a single line makes it much easier to edit documentation, rather than having to continually re-split on edits.
Note: actual code should be split at ~80 chars
The package tools
has a non-exported function tools:::.split_dependencies
.
A copy of this function exists in pkgDepTools.R
If the user simply wants a local library of packages, then makeRepo() is overkill.
Create the ability to download packages into a specified library location without creating the PACKAGES file.
Currently only @family miniCRAN functions
is used for documentation. Since all of the package functions are included in the package help index, it makes more sense to specify more specific function groupings, such as "adding new packages", "dependency checking", etc.
Related: I really like the way the raster
package groups their functions in the package documentation (see ?"raster-package"
).
The package index files should be written in the tips of the directory structure, in the same dir as the packages themselves.
In makeRepo.R
:
#' @section Repo folder structure:
#' The folder structure of a repository
Specifies the structure as
But it should be:
Currently using backslashes to specify paths to examples in inst/examples/
, which Windows is OK with but OSX and Linux are unable to build the package unless forward slashes are used.
However, travis-ci automated builds fail when forward slashes are used.
[pending rename/merge as addPackage
]
This broke the addPackageGithub()
example.
For example,
makeDepGraph("Rcpp")
throws an error
Revolution Analytics keeps historic snapshots of CRAN at the MRAN site:
http://mran.revolutionanalytics.com/snapshot/
We can use this to create unit tests for updating packages. It works as follows:
t
repos
to snapshot date t + x
Remove package names in Roxygen documentation links, to install without warnings.
For example, use
#' \code{\link{write_PACKAGES}}
instead of
#' \code{\link[tools]{write_PACKAGES}}
Hi @andrie Should users have the option of asking for pkgs listed in the Enhances
field of a pkg DESCRIPTION
file? Doesn't seem to work when I do e.g. tools::package_dependencies("PivotalR", pdb, which="Enhances", recursive=TRUE)
This question at StackOverflow provides a hint:
empty warnings that load_all is giving you are actually initiated when loading the package because of function name conflicts
Conflicts exist in @import tools
and we should use @importFrom tools ...
instead.
The documentation can be improved with clear instruction on how to use a local repository, i.e. how to modify .Rprofile or how to set default repo.
Warning message:
replacing previous import by ‘tools::toHTML’ when loading ‘miniCRAN’
Add helper functions to read DESCRIPTION from any local package and use this information to build the graph in makeDepGraph()
The use of the Rversion=...
argument in addPackages()
is inconsistent with use elsewhere in package, particularly makeRepo()
This means that the user can't specify the R version to use. Need to create a version of contrib.url()
that includes user-specified R.version
Given some recent reports of difficulties installing igraph
, is it possible to modify the Imports
to Enhances
or `Suggests?
Great package @andrie !
I have been trying to create a miniCRAN repo for mavericks. When I use makeRepo, however, I get the following error:
Error in match.arg(type) :
'arg' should be one of “source”, “mac.binary”, “win.binary”
From the install.packages help file: Possible values are (currently) "source", "mac.binary", "mac.binary.mavericks" and "win.binary"
mac.binary.mavericks files are collected but the PACKAGES files is not. This is probably an issue in write_PACKAGES but I couldn't see how to fix it.
Having contrib.url as an argument introduces unnecessariy complexity from the user's point of view, since one has to add type=...
in multiple places.
Once addPackage
is updated, addGithub
should be too to perform the corresponding tasks but using a GitHub package instead of CRAN-like repo.
Demonstrate use of:
oldPackages
upatePackages
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.