Skip to content

Commit

Permalink
Merge pull request #42 from mcanouil/tidypkg
Browse files Browse the repository at this point in the history
Improve package structure & coding (using tidy style)
  • Loading branch information
briatte committed Jul 22, 2019
2 parents f42b967 + f3224f1 commit b88cd0a
Show file tree
Hide file tree
Showing 41 changed files with 1,509 additions and 1,940 deletions.
14 changes: 14 additions & 0 deletions .Rbuildignore
@@ -0,0 +1,14 @@
^pkgdown$
^_pkgdown\.yml$
^.github$
^inst/pkgdown$
^docs$
^.*\.Rproj$
^\.Rproj\.user$
^README\.Rmd$
^README
^README-.*\.png$
^\.travis\.yml$
^appveyor\.yml$
^codecov\.yml$
^\.github$
25 changes: 25 additions & 0 deletions .github/CODE_OF_CONDUCT.md
@@ -0,0 +1,25 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating documentation,
submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for
everyone, regardless of level of experience, gender, gender identity and expression,
sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.

Examples of unacceptable behavior by participants include the use of sexual language or
imagery, derogatory comments or personal attacks, trolling, public or private harassment,
insults, or other unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments,
commits, code, wiki edits, issues, and other contributions that are not aligned to this
Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed
from the project team.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the Contributor Covenant
(https://www.contributor-covenant.org), version 1.0.0, available at
https://contributor-covenant.org/version/1/0/0/.
48 changes: 48 additions & 0 deletions .github/CONTRIBUTING.md
@@ -0,0 +1,48 @@
# Contributing to ggnetwork

This outlines how to propose a change to ggnetwork. For more detailed
info about contributing to this, and other tidyverse packages, please see the
[**development contributing guide**](https://rstd.io/tidy-contrib).

### Fixing typos

Small typos or grammatical errors in documentation may be edited directly using
the GitHub web interface, so long as the changes are made in the _source_ file.

* YES: you edit a roxygen comment in a `.R` file below `R/`.
* NO: you edit an `.Rd` file below `man/`.

### Prerequisites

Before you make a substantial pull request, you should always file an issue and
make sure someone from the team agrees that it’s a problem. If you’ve found a
bug, create an associated issue and illustrate the bug with a minimal
[reprex](https://www.tidyverse.org/help/#reprex).

### Pull request process

* We recommend that you create a Git branch for each pull request (PR).
* Look at the Travis and AppVeyor build status before and after making changes.
The `README` should contain badges for any continuous integration services used
by the package.
* New code should follow the tidyverse [style guide](http://style.tidyverse.org).
You can use the [styler](https://CRAN.R-project.org/package=styler) package to
apply these styles, but please don't restyle code that has nothing to do with
your PR.
* We use [roxygen2](https://cran.r-project.org/package=roxygen2), with
[Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/markdown.html),
for documentation.
* We use [testthat](https://cran.r-project.org/package=testthat). Contributions
with test cases included are easier to accept.
* For user-facing changes, add a bullet to the top of `NEWS.md` below the
current development version header describing the changes made followed by your
GitHub username, and links to relevant issue(s)/PR(s).

### Code of Conduct

Please note that the ggnetwork project is released with a
[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this
project you agree to abide by its terms.

### See tidyverse [development contributing guide](https://rstd.io/tidy-contrib)
for further details.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -0,0 +1,11 @@
Please briefly describe your problem and what output you expect. If you have a question, please don't use this form. Instead, ask on <https://stackoverflow.com/> or <https://community.rstudio.com/>.

Please include a minimal reproducible example (AKA a reprex). If you've never heard of a [reprex](https://reprex.tidyverse.org/) before, start by reading <https://www.tidyverse.org/help/#reprex>.

---

Brief description of the problem

```r
# insert reprex here
```
35 changes: 35 additions & 0 deletions .github/SUPPORT.md
@@ -0,0 +1,35 @@
# Getting help with ggnetwork

Thanks for using ggnetwork. Before filing an issue, there are a few places
to explore and pieces to put together to make the process as smooth as possible.

Start by making a minimal **repr**oducible **ex**ample using the
[reprex](https://reprex.tidyverse.org/) package. If you haven't heard of or used
reprex before, you're in for a treat! Seriously, reprex will make all of your
R-question-asking endeavors easier (which is a pretty insane ROI for the five to
ten minutes it'll take you to learn what it's all about). For additional reprex
pointers, check out the [Get help!](https://www.tidyverse.org/help/) section of
the tidyverse site.

Armed with your reprex, the next step is to figure out [where to ask](https://www.tidyverse.org/help/#where-to-ask).

* If it's a question: start with [community.rstudio.com](https://community.rstudio.com/),
and/or StackOverflow. There are more people there to answer questions.
* If it's a bug: you're in the right place, file an issue.
* If you're not sure: let the community help you figure it out! If your
problem _is_ a bug or a feature request, you can easily return here and
report it.

Before opening a new issue, be sure to [search issues and pull requests](https://github.com/tidyverse/ggnetwork/issues) to make sure the
bug hasn't been reported and/or already fixed in the development version. By
default, the search will be pre-populated with `is:issue is:open`. You can
[edit the qualifiers](https://help.github.com/articles/searching-issues-and-pull-requests/)
(e.g. `is:pr`, `is:closed`) as needed. For example, you'd simply
remove `is:open` to search _all_ issues in the repo, open or closed.


If you _are_ in the right place, and need to file an issue, please review the
["File issues"](https://www.tidyverse.org/contribute/#issues) paragraph from
the tidyverse contributing guidelines.

Thanks for your help!
7 changes: 2 additions & 5 deletions .gitignore
@@ -1,6 +1,3 @@
**.Rproj.user
.Rproj.user
.Rhistory
.RData
.Ruserdata
.Rbuildignore
ggnetwork.Rproj
docs
44 changes: 43 additions & 1 deletion .travis.yml
@@ -1,2 +1,44 @@
language: r
language: R
cache: packages
sudo: true


env:
global:
- _R_CHECK_FORCE_SUGGESTS_=false
- R_REMOTES_NO_ERRORS_FROM_WARNINGS=true
- _R_CHECK_SYSTEM_CLOCK_=false

before_install:
- sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable --yes
- sudo apt-get --yes --force-yes update -qq
- sudo apt-get install --yes libudunits2-dev libproj-dev libgeos-dev libgdal-dev
- Rscript -e 'update.packages(ask = FALSE)'

r_github_packages:
- r-lib/covr

matrix:
include:
- r: devel
- r: release
after_success: Rscript -e 'covr::coveralls(); covr::codecov()'
before_deploy: Rscript -e 'remotes::install_cran("pkgdown")'
deploy:
provider: script
script: Rscript -e 'pkgdown::deploy_site_github()'
skip_cleanup: true
- r: 3.1
- r: 3.2
- r: 3.3
- r: 3.4
- r: 3.5
- r: 3.6

after_success:
- Rscript -e 'covr::coveralls(); covr::codecov()'

notifications:
email:
on_success: change
on_failure: change
26 changes: 16 additions & 10 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Package: ggnetwork
Type: Package
Title: Geometries to Plot Networks with 'ggplot2'
Version: 0.5.4
Version: 0.5.6.9000
Date: 2016-03-24
Maintainer: François Briatte <f.briatte@gmail.com>
Authors@R: c(
Expand All @@ -14,24 +14,30 @@ Authors@R: c(
)
Description: Geometries to plot network objects with 'ggplot2'.
License: GPL-3
Encoding: UTF-8
URL: https://github.com/briatte/ggnetwork
BugReports: https://github.com/briatte/ggnetwork/issues
LazyData: true
NeedsCompilation: no
RoxygenNote: 6.0.1
VignetteBuilder: knitr
Depends:
ggplot2 (>= 2.0.0),
R (>= 3.1),
ggplot2 (>= 2.0.0)
Imports:
ggrepel (>= 0.5),
network,
igraph,
sna,
utils
Suggests:
igraph,
knitr,
testthat
Enhances:
ggplot2
Collate:
'utilities.R'
'fortify-igraph.R'
'fortify-network.R'
'geom-nodes.R'
'geom-edges.R'
'ggnetwork.R'
VignetteBuilder: knitr
RoxygenNote: 6.1.1
Roxygen: list(markdown = TRUE)
Encoding: UTF-8
LazyData: true
NeedsCompilation: no
14 changes: 2 additions & 12 deletions NAMESPACE
Expand Up @@ -2,6 +2,7 @@

S3method(fortify,igraph)
S3method(fortify,network)
export(fortify)
export(geom_edgelabel)
export(geom_edgelabel_repel)
export(geom_edges)
Expand All @@ -15,17 +16,6 @@ export(geom_nodetext_repel)
export(ggnetwork)
export(theme_blank)
export(theme_facet)
import(sna)
importFrom(ggplot2,GeomCurve)
importFrom(ggplot2,GeomLabel)
importFrom(ggplot2,GeomPoint)
importFrom(ggplot2,GeomSegment)
importFrom(ggplot2,GeomText)
export(unit)
importFrom(ggplot2,fortify)
importFrom(ggplot2,ggproto)
importFrom(ggplot2,layer)
importFrom(ggplot2,position_nudge)
importFrom(ggplot2,unit)
importFrom(ggrepel,GeomLabelRepel)
importFrom(ggrepel,GeomTextRepel)
importFrom(utils,installed.packages)
70 changes: 60 additions & 10 deletions NEWS.md
@@ -1,41 +1,91 @@
ggnetwork 0.5.6
===============

## Repository changes

* Add `README.Rmd` (replace `README.md`),
+ use badges.
+ list all GitHub contributors.
+ add Contributing, Code of Conduct Issue Template and Support markdown file (`usethis`).

* Improve `.travis.yml`,
+ use `pkgdown` for website deployment.
- add `_pkgdown.yml` configuration file.
+ use `covr` for code coverage.
- add default `codecov.yml` configuration file.

* Add `ggnetwork.Rproj`, for ease of use within Rstudio.

## Minor improvements and fixes

* In `DESCRIPTION`,
+ update RoxygenNote version.
+ remove `ggplot2` from `Enhances` field.
+ add `Collate` field to load sequentially the functions.
+ move `igraph` to `Imports` field.

* Remove `inst/doc/` directory, *i.e.*, the vignette is part of the `pkgdown` website.

* Use tidy code style.

* In `R/fortify-igraph.R` and `R/fortify-network.R`,
+ use subsetting functions instead of `with` and `transform` (*i.e.*, intended to be use interactively).
+ fix issue from CRAN check with undefined global variables.
+ remove namespace loading for `sna` package (*i.e.*, `gplot.layout.*` functions).

* In `R/geom-nodes.R` and `R/geom-edges.R`,
+ remove unnecessary "@importFom".
+ add missing function packages prefix.

* In `R/ggnetwork.R`, `switch` and `tryCatch` to make the `igraph` and `network` testing consistent.

* In `R/utilities.R`, reexport `fortify` and `unit` from `ggplot2`.



ggnetwork 0.5.5 (2017-08-XX)
============================


ggnetwork 0.5.4 (2017-07-XX)
----------------------------
============================

Changes
## Minor improvements and fixes

* Added native support for igraph. Thanks to [Jake Fisher](www.src.isr.umich.edu/people/jake-fisher/).


ggnetwork 0.5.3 (2016-06-XX)
----------------------------
============================

## Repository changes

Added Travis CI.
* Added Travis CI.

FIXES
## Minor improvements and fixes

* Export ggplot2::Stat to enable loading ggnetwork first (#14). Thanks to Tyler Rinker.

* Built with the new version of ggproto (#11).

* Safer calls to the sna package (#9). Thanks to Michał Bojanowski.


ggnetwork 0.5.2 (2016-05-01)
----------------------------
============================

FIXES
## Minor improvements and fixes

* Fixed a bug that removed labels from strictly vertical or strictly horizontal edges (#5).

* Fixed a small documentation issue that was corrected in roxygen 5.0.2 (#4).

CHANGES

* Support for segment colors in all geoms using ggrepel 0.5.1 (#3).

* Added some acknowledgements to the README and links to the DESCRIPTION.


ggnetwork 0.5.1 (2016-03-25)
----------------------------
============================

First CRAN release.

0 comments on commit b88cd0a

Please sign in to comment.