Skip to content

Commit

Permalink
Tidy dependencies and package in general (#151)
Browse files Browse the repository at this point in the history
* In README, fix code highlighting and attach fgeo quietly
* Prune files
* Style
* Tidy imports and remotes
  • Loading branch information
maurolepore authored Jan 24, 2019
1 parent 2505c33 commit 094bcf5
Show file tree
Hide file tree
Showing 47 changed files with 141 additions and 1,965 deletions.
2 changes: 2 additions & 0 deletions .buildignore/fgeo.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
options(fgeo.quiet = TRUE)
```

This article shows some of the key features of __fgeo__ applied to an exploratory data analysis. For a deeper and general approach to exploratory data analysis, see [this book section](http://r4ds.had.co.nz/exploratory-data-analysis.html). A version adapted for ForestGEO is available [here](https://forestgeo.github.io/fgeo/articles/siteonly/eda.html).
Expand Down
779 changes: 0 additions & 779 deletions .buildignore/fgeo.html

This file was deleted.

15 changes: 0 additions & 15 deletions .buildignore/tmp.Rmd

This file was deleted.

15 changes: 0 additions & 15 deletions .buildignore/tmp.knit.md

This file was deleted.

13 changes: 0 additions & 13 deletions .buildignore/tmp.md

This file was deleted.

19 changes: 9 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: fgeo
Title: Analyze Forest Diversity and Dynamics
Version: 1.0.0.9000
Version: 1.0.1
Authors@R:
c(person(given = "Mauro",
family = "Lepore",
Expand Down Expand Up @@ -79,19 +79,18 @@ URL: http://forestgeo.github.io/fgeo,
https://github.com/forestgeo/fgeo
BugReports: https://github.com/forestgeo/fgeo/issues
Imports:
fgeo.x (>= 1.0.1),
fgeo.tool (>= 1.0.1),
fgeo.analyze (>= 1.0.1),
fgeo.plot (>= 1.0.1),
cli,
crayon,
dplyr,
fgeo.analyze,
fgeo.plot,
fgeo.tool,
fgeo.x,
glue,
magrittr,
purrr,
rlang,
rstudioapi,
tibble,
utils
Suggests:
covr,
Expand All @@ -101,10 +100,10 @@ Suggests:
spelling,
testthat
Remotes:
forestgeo/fgeo.analyze,
forestgeo/fgeo.plot,
forestgeo/fgeo.tool,
forestgeo/fgeo.x
forestgeo/fgeo.x@*release,
forestgeo/fgeo.tool@*release,
forestgeo/fgeo.analyze@*release,
forestgeo/fgeo.plot@*release
Encoding: UTF-8
Language: en-US
LazyData: true
Expand Down
9 changes: 7 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# fgeo (development version)

* Prepare the first public release
* Work in progress.

# fgeo 1.0.0 (internal GitHub release)
# fgeo 1.0.1 (GitHub release)

* Style.
* Tidy dependencies.

# fgeo 1.0.0 (GitHub release)

* Internal GitHub release.
3 changes: 2 additions & 1 deletion R/attach.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ core_unloaded <- function() {

fgeo_attach <- function() {
to_load <- core_unloaded()
if (length(to_load) == 0)
if (length(to_load) == 0) {
return(invisible())
}

msg(
cli::rule(
Expand Down
6 changes: 4 additions & 2 deletions R/conflicts.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ confirm_conflict <- function(packages, name) {
is.function
)

if (length(objs) <= 1)
if (length(objs) <= 1) {
return()
}

# Remove identical functions
objs <- objs[!duplicated(objs)]
packages <- packages[!duplicated(packages)]
if (length(objs) == 1)
if (length(objs) == 1) {
return()
}

packages
}
1 change: 0 additions & 1 deletion R/fgeo_browse.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ fgeo_browse <- fgeo_browse_url("index.html")
#' @rdname fgeo_browse
#' @export
fgeo_browse_reference <- fgeo_browse_url("articles/siteonly/reference.html")

7 changes: 3 additions & 4 deletions R/fgeo_help.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@
#' if (interactive()) {
#' fgeo_help()
#' }
#'
#' tibble::as_tibble(fgeo_help()$matches)
#'
#'
#' dplyr::as_tibble(fgeo_help()$matches)
#'
#' if (interactive()) {
#' fgeo_help("stem", package = "fgeo.x")
#' }
#'
#' @family functions to explore fgeo
#' @export
fgeo_help <- function(pattern = "", package = NULL, rebuild = TRUE, ...) {
Expand Down
6 changes: 3 additions & 3 deletions R/fgeo_packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fgeo_packages <- function(include_self = TRUE) {
}

fgeo_to_attach <- function() {
fgeo_packages(include_self = FALSE)
fgeo_packages(include_self = FALSE)
}


Expand All @@ -31,8 +31,8 @@ fgeo_to_attach <- function() {
#' @family functions for developers
#' @noRd
fgeo_dependencies <- function(matches = NULL,
include_self = TRUE,
section = c("Imports", "Suggests")) {
include_self = TRUE,
section = c("Imports", "Suggests")) {
section <- section[[1]]
raw <- utils::packageDescription("fgeo")[[section]]
pulled <- strsplit(raw, ",")[[1]]
Expand Down
2 changes: 0 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ text_col <- function(x) {
theme <- rstudioapi::getThemeInfo()

if (isTRUE(theme$dark)) crayon::white(x) else crayon::black(x)

}

invert <- function(x) {
Expand All @@ -36,4 +35,3 @@ style_grey <- function(level, ...) {
crayon::make_style(grDevices::grey(level), grey = TRUE)
)
}

3 changes: 2 additions & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.onAttach <- function(...) {
if (all_attached(fgeo_to_attach()))
if (all_attached(fgeo_to_attach())) {
return()
}

crayon::num_colors(TRUE)
fgeo_attach()
Expand Down
4 changes: 3 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ knitr::opts_chunk$set(
comment = "#>",
fig.path = "man/figures/README-"
)
options(fgeo.quiet = TRUE)
```

# <img src="https://i.imgur.com/vTLlhbp.png" align="right" height=88 /> Analyze forest diversity and dynamics
Expand Down Expand Up @@ -57,7 +59,7 @@ __Expected R environment__

Install the latest stable version of all **fgeo** packages with:

```
```R
install.packages("devtools")
devtools::install_github("forestgeo/fgeo@*release", upgrade = "never")
```
Expand Down
Loading

0 comments on commit 094bcf5

Please sign in to comment.