Skip to content

Commit

Permalink
Clean and build package for 0.4.0
Browse files Browse the repository at this point in the history
* Re-clean and re-build package for 0.4.0

* Patch badge embedding in README

* Tweak assemble draft and vignette text

* Fix typos and final devtools::release() issues
  • Loading branch information
mikemahoney218 authored Dec 30, 2019
1 parent ef85422 commit 93fe6dd
Show file tree
Hide file tree
Showing 45 changed files with 17,005 additions and 684 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ the GitHub web interface, so long as the changes are made in the _source_ file.
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).
[reprex](https://reprex.tidyverse.org/).

### Pull request process

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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/>.

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>.
Please include a minimal reproducible example (AKA a [reprex](https://reprex.tidyverse.org/))

---

Expand Down
13 changes: 4 additions & 9 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,13 @@ 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.
ten minutes it'll take you to learn what it's all about).

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

* If it's a question: start with 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.
There are more people there to answer questions.
* If it's a bug: you're in the right place, file an issue.

Before opening a new issue, be sure to [search issues and pull requests](https://github.com/mikemahoney218/heddlr/issues) to make sure the
bug hasn't been reported and/or already fixed in the development version. By
Expand Down
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
language: r
r:
- 3.4
- 3.5
- 3.6
- oldrel
- release
- devel
os:
- linux
Expand Down
6 changes: 5 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Package: heddlr
Title: Dynamic R Markdown Document Generation
Version: 0.3.1
Version: 0.4.0
Date: 2019-12-30
Authors@R:
person(given = "Michael",
family = "Mahoney",
Expand All @@ -12,6 +13,9 @@ Description: Helper functions designed to make
simple and tidy way to create report pieces, shape them to your data,
and combine them for exporting into a single R Markdown document.
License: MIT + file LICENSE
URL: https://github.com/mikemahoney218/heddlr,
https://mikemahoney218.github.io/heddlr/
BugReports: https://github.com/mikemahoney218/heddlr/issues
Depends:
R (>= 3.2.5)
Imports:
Expand Down
18 changes: 0 additions & 18 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,9 @@ S3method(heddle,data.frame)
S3method(heddle,default)
S3method(make_template,data.frame)
S3method(make_template,default)
export(":=")
export(.data)
export(as_label)
export(as_name)
export(assemble_draft)
export(create_yaml_header)
export(enquo)
export(enquos)
export(export_template)
export(expr)
export(heddle)
export(import_pattern)
export(make_template)
export(sym)
export(syms)
importFrom(rlang,":=")
importFrom(rlang,.data)
importFrom(rlang,as_label)
importFrom(rlang,as_name)
importFrom(rlang,enquo)
importFrom(rlang,enquos)
importFrom(rlang,expr)
importFrom(rlang,sym)
importFrom(rlang,syms)
45 changes: 32 additions & 13 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
# Version 0.3.1 (2019-12-29)

* New vignettes introducing the concepts behind heddlr
* New hidden docs pages to be linked from vignettes and other docs
* Fixed a few latent bugs in heddle:
* Export methods in order to, well, use the methods
* Fixed a few latent bugs in make_template:
* Export methods in order to, well, use the methods
* Fix vector handling so nested vectors are flattened properly
* Export export_template and fix documentation
* Internal changes (only build on R 3.4 and up, change description to pass
R CMD check)
* Add Suggests for vignettes
# heddlr (development version)

# Version 0.4.0

* This will be the first version released to CRAN
* Functionality changes:
* `assemble_draft()` now wraps an `lapply` call and is much more open to
different naming conventions
* Remove utils-tidy-eval, as it doesn't provide much utility and makes finding
functions in `heddlr::` harder.
* Fixed a few latent bugs in heddle:
* Export methods in order to, well, use the methods
* Fixed a few latent bugs in make_template:
* Export methods in order to, well, use the methods
* Fix vector handling so nested vectors are flattened properly
* Export export_template and fix documentation
* Documentation changes:
* Add documentation page for ?heddlr
* Add URLs to DESCRIPTION
* Add links between vignettes
* Remove README.Rmd until needed
* Remove most README content in favor of vignette
* Change package lifecycle to maturing
* Add CII badge (closes issue #7)
* New vignettes introducing the concepts behind heddlr
* New hidden docs pages to be linked from vignettes and other docs
* Add Suggests section for vignettes
* Add date to DESCRIPTION
* Edit DESCRIPTION to pass R CMD CHECK
* Internal changes:
* Remove most tidyverse links from GitHub customizations
* Add quick "do this before committing" shell script
* Style .R and .Rmd files
* Only test on r-oldrel, r-release, and r-devel (Linux and Windows only)

# Version 0.3.0 (2019-12-28)

Expand Down
16 changes: 5 additions & 11 deletions R/assemble_draft.R
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
#' Assemble multiple patterns into a single draft object
#'
#' When working with multiple patterns that will be woven into a tetmplate,
#' When working with multiple patterns that will be woven into a template,
#' it makes sense to have all patterns stored in a central object. This
#' function creates that object from a named vector of filenames to be used
#' in further generation, importing the files via
#' \code{\link[heddlr]{import_pattern}}.
#'
#' @param ... A named vector of filenames which will be imported as
#' patterns stored in the returned draft, with the names used as indices.
#' Files should be plaintext.
#' Files should be plain text.
#'
#' @return A list ("draft") object containing the imported patterns.
#'
#' @export

assemble_draft <- function(...) {
patterns <- list(...)
if (length(patterns) < 1) stop("No arguments provided to assemble_draft.")
patterns <- unlist(patterns, recursive = FALSE)
if (!is.vector(patterns)) stop("Argument 1 must be a named vector.")
if (any(names(patterns) == "") | length(patterns) != length(names(patterns))) stop("All arguments must be named.")

draft <- vector("list", length = length(patterns))

for (i in seq_along(patterns)) {
names(draft)[i] <- names(patterns)[i]
draft[names(patterns)[i]] <- import_pattern(patterns[[i]])
}
draft <- lapply(patterns, import_pattern)
names(draft) <- names(patterns)
draft
}
2 changes: 1 addition & 1 deletion R/heddle.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ heddle.default <- function(data, pattern, ..., strip.whitespace = F) {

#' @export
heddle.data.frame <- function(data, pattern, ..., strip.whitespace = F) {
dots <- enquos(...)
dots <- rlang::enquos(...)
if (any(names(dots) == "") || any(is.null(names(dots)))) {
stop("All variables passed to '...' must have names matching the keyword they're replacing.")
}
Expand Down
8 changes: 8 additions & 0 deletions R/heddlr-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#' @keywords internal
"_PACKAGE"

# The following block is used by usethis to automatically manage
# roxygen namespace tags. Modify with care!
## usethis namespace: start
## usethis namespace: end
NULL
4 changes: 3 additions & 1 deletion R/import_pattern.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#' @export

import_pattern <- function(filepath) {
if (nchar(readChar(filepath, file.info(filepath)$size)) == 0) warning(paste(filepath, "imported 0 characters."))
if (nchar(readChar(filepath, file.info(filepath)$size)) == 0) {
warning(paste(filepath, "imported 0 characters."))
}
readChar(filepath, file.info(filepath)$size)
}
4 changes: 2 additions & 2 deletions R/make_template.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ make_template.default <- function(data, ...) {

#' @export
make_template.data.frame <- function(data, ...) {
dots <- enquos(...)
if (length(dots) == 0) stop("argument '...' is missing, with no default")
dots <- rlang::enquos(...)
if (length(dots) == 0) stop("No column was specified to make a template from.")
vars <- as.list(rlang::set_names(seq_along(data), names(data)))
output <- vector("list", length(dots))
for (j in 1:length(dots)) {
Expand Down
47 changes: 0 additions & 47 deletions R/utils-tidy-eval.R

This file was deleted.

Loading

0 comments on commit 93fe6dd

Please sign in to comment.