Code Monkey home page Code Monkey logo

recontools's Introduction

Build Status Build status Coverage Status CRAN_Status_Badge

reconhub

This packages installs and loads all stable RECON packages similiar to the tidyverse package.

Installing the package

To install the current stable, CRAN version of the package, type:

install.packages("reconhub")

To benefit from the latest features and bug fixes, install the development, github version of the package using:

devtools::install_github("reconhub/reconhub")

Note that this requires the package devtools installed.

What does it do?

# attaches all stable recon packages
library(reconhub)
## Attaching package epicontacts

## Attaching package outbreaks

## Attaching package incidence

Also, you can install all development versions of RECON packages:

reconhub::install_dev_versions()

Getting help online

Bug reports and feature requests should be posted on github using the issue system. All other questions should be posted on the RECON forum:
http://www.repidemicsconsortium.org/forum/

Contributions are welcome via pull requests.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

recontools's People

Contributors

dirkschumacher avatar jrcpulliam avatar thibautjombart avatar zkamvar avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

recontools's Issues

Use *reconhub* as default username

So that in the README:

devtools::install_github("<github_username>/projections")

will be by default

devtools::install_github("reconhub/projections")

Feature list for first version

The package should help to get up to speed when developing a package. It should contain helper functions to:

  • create the basic package infrastructure, with a toy example of code including roxygen2 documentation
  • support for continuous integration tools: travis, appveyor, codecov.io
  • create a README.Rmd / README.md containing tags for the above, CRAN release status, and basic package information, along the lines of: https://github.com/reconhub/outbreaker2
  • create a basic vignette template
  • create a website generated by pkgdown
  • create a default lintr file
  • git clone all existing RECON repositories
  • install all existing RECON packages, either from CRAN (stable versions) or github (devel versions)
  • ....

It should also help to adhere to the RECON guidelines http://www.repidemicsconsortium.org/resources/guidelines/


init

I am currently thinking of having a central init function that guides you through configuring a first package template similar to devtools::release(). If the folder is empty, it could simply create template files like readme/vignette without asking πŸ€”

This central function relies on small, public helper functions like configuring travis or creating a README.

The init function could do the following:

  • git initif no git repo (ask?)
  • Create .Rbuildignore and .gitignore
  • Create a DESCRIPTION file (ask for package name and license)
  • Check if the package name is already taken on CRAN
  • Create a testthat folder
  • Create a sample R file with roxygen2 code
  • Create a sample vignette (ask for it)
  • Create a readme.Rmd
  • Create travis.yml (ask for it)
  • Create appveyor file (ask for it)
  • Create a default .lintr file
  • Register coverage in travis (ask for it)
  • Create news file
  • Run devtools::document()
  • ...

check

In addition there could be a checkfunction that performs various checks. Some ideas:

  • R cmd check
  • lintr::lint_package
  • goodpractice::gp
  • Check if travis/appveyor are setup
  • Does the DESCRIPTIONcontain a URL/BugTracker URL?
  • Is there a vignette?
  • Is roxygen2 being used?
  • Any @importFrom / importFrom in NAMESPACE?
  • Is there a docs folder / gh-pages branch? if not, ask the user if he/she has a public documentation page somewhere.
  • Snake case?
  • Is there a code of conduct?
  • Is there a news file?
  • Are there tests? Test coverage?
  • ...

Other functions:

Identify deps in R / Rmd / Rnw files

This would be useful for RECON learn, but more generally for blogdown websites and other projects where a number of packages are required without being formally declared anywhere. This is fairly generic so may exist somewhere, but the idea is:

  1. identify recursively all files containing code, i.e. extensions: R, Rmd, Rnw, Snw etc. (handling different capitalisation)

  2. in each file, identify references to R packages, including: library("foo"), require("foo"), loadNamespace("foo") (with or without quotes), foo::bar, foo:::bar, etc. and extract the library names

  3. output a list of required packages, identifying those available on CRAN

A sister function to this one would be use the output of 3. to install all available packages.

`devtools::install()` fails on created package

I get:

> install()
Installing projections
'/usr/local/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore  \
  --quiet CMD INSTALL '/home/thibaut/dev/recon/projections'  \
  --library='/usr/local/lib/R/site-library' --install-tests 

* installing *source* package β€˜projections’ ...
** R
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (projections)
Error in git_branch(path = x$path) : 
  trying to get slot "name" from an object of a basic class ("NULL") with no slots

Add files to .Rbuildignore

Getting this off a novel package skeleton and running devtools::check():

Non-standard files/directories found at top level:
  β€˜CONDUCT.md’ β€˜README.Rmd’ β€˜appveyor.yml’

init_package no workie

Devtools just updated and messed up everything :(

recontools::init_package("hey")
#> * Initializing git repository
#> * Add default .gitignore
#> * Add sample R file
#> * Add .Rbuildignore
#> * Add DESCRIPTION
#> Warning: 'devtools::use_mit_license' is deprecated.
#> Use 'usethis::use_mit_license()' instead.
#> See help("Deprecated") and help("devtools-deprecated").
#> Warning in warn_unless_current_dir(pkg): `pkg` is not `.`, which is now unsupported.
#>   Please use `usethis::proj_set()` to set the project directory.
#> Error in usethis::use_mit_license(copyright_holder = copyright_holder): unused argument (copyright_holder = copyright_holder)

Created on 2018-10-24 by the reprex package (v0.2.1)

Session info
devtools::session_info()
#> ─ Session info ──────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 3.5.1 (2018-07-02)
#>  os       Ubuntu 18.04.1 LTS          
#>  system   x86_64, linux-gnu           
#>  ui       X11                         
#>  language en_GB:en                    
#>  collate  en_GB.UTF-8                 
#>  ctype    en_GB.UTF-8                 
#>  tz       Europe/London               
#>  date     2018-10-24                  
#> 
#> ─ Packages ──────────────────────────────────────────────────────────────
#>  package     * version    date       lib
#>  assertthat    0.2.0      2017-04-11 [1]
#>  backports     1.1.2      2017-12-13 [1]
#>  base64enc     0.1-3      2015-07-28 [1]
#>  callr         3.0.0      2018-08-24 [1]
#>  cli           1.0.1      2018-09-25 [1]
#>  clisymbols    1.2.0      2017-05-21 [1]
#>  crayon        1.3.4      2017-09-16 [1]
#>  debugme       1.1.0      2017-10-22 [1]
#>  desc          1.2.0      2018-05-01 [1]
#>  devtools      2.0.0      2018-10-19 [1]
#>  digest        0.6.18     2018-10-10 [1]
#>  evaluate      0.12       2018-10-09 [1]
#>  fs            1.2.6      2018-08-23 [1]
#>  git2r         0.23.0     2018-07-17 [1]
#>  glue          1.3.0      2018-07-17 [1]
#>  hms           0.4.2      2018-03-10 [1]
#>  htmltools     0.3.6      2017-04-28 [1]
#>  knitr         1.20       2018-02-20 [1]
#>  magrittr      1.5        2014-11-22 [1]
#>  memoise       1.1.0      2017-04-21 [1]
#>  pillar        1.3.0      2018-07-14 [1]
#>  pkgbuild      1.0.2      2018-10-16 [1]
#>  pkgconfig     2.0.2      2018-08-16 [1]
#>  pkgload       1.0.1      2018-10-11 [1]
#>  prettyunits   1.0.2      2015-07-13 [1]
#>  processx      3.2.0      2018-08-16 [1]
#>  ps            1.2.0      2018-10-16 [1]
#>  R6            2.3.0      2018-10-04 [1]
#>  Rcpp          0.12.19    2018-10-01 [1]
#>  readr         1.1.1      2017-05-16 [1]
#>  recontools    0.0.0.9000 2018-10-24 [1]
#>  remotes       2.0.1      2018-10-19 [1]
#>  rlang         0.3.0      2018-10-22 [1]
#>  rmarkdown     1.10       2018-06-11 [1]
#>  rprojroot     1.3-2      2018-01-03 [1]
#>  sessioninfo   1.1.0      2018-09-25 [1]
#>  stringi       1.2.4      2018-07-20 [1]
#>  stringr       1.3.1      2018-05-10 [1]
#>  testthat      2.0.1      2018-10-13 [1]
#>  tibble        1.4.2      2018-01-22 [1]
#>  usethis       1.4.0.9000 2018-10-02 [1]
#>  withr         2.1.2      2018-03-15 [1]
#>  yaml          2.2.0      2018-07-25 [1]
#>  source                              
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  Github (reconhub/recontools@df25821)
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#>  Github (r-lib/usethis@1e3c6a6)      
#>  CRAN (R 3.5.1)                      
#>  CRAN (R 3.5.1)                      
#> 
#> [1] /home/zkamvar/Documents/RLibrary
#> [2] /usr/local/lib/R/site-library
#> [3] /usr/lib/R/site-library
#> [4] /usr/lib/R/library

Add more license options

It would be cool to have more options and navigate using the arrow keys to select the license.
MIT + file LICENSE
GPL + file LICENSE
...

Use `knitr` by default for compiling `README.Rmd`?

Currently it looks like the template supposes rmarkdown. I personally prefer to use knit(), but I may be missing some reason why rmarkdown should be preferred. If so, I would add README.html to .gitignore as it will be produced when calling rmarkdown.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.