Browse Source

Fixes #20 (and actually gets rid of purrr unlike the last commit)

tags/0.8.0
boB Rudis 3 years ago
parent
commit
14b5f9bb46
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
3 changed files with 11 additions and 9 deletions
  1. +1
    -1
      DESCRIPTION
  2. +9
    -8
      R/check.r
  3. +1
    -0
      hrbrthemes.Rproj

+ 1
- 1
DESCRIPTION View File

@ -1,7 +1,7 @@
Package: hrbrthemes
Type: Package
Title: Additional Themes, Theme Components and Utilities for 'ggplot2'
Version: 0.3.0
Version: 0.3.1
Date: 2017-03-01
Authors@R: c(
person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre")),


+ 9
- 8
R/check.r View File

@ -50,14 +50,15 @@ gg_check <- function(gg, dict, ignore) {
tmp <- lapply(names(lbl), function(lab) {
words <- stringi::stri_extract_all_words(lbl[[lab]])
words <- unlist(words)
words <- purrr::discard(hunspell::hunspell(words, "text", dict = dict, ignore = ignore),
~length(.)==0)
if (length(words) > 0) {
message(sprintf("Possible misspelled words in [%s]: (%s)",
lab, paste0(words, collapse=", ")))
if (length(lbl[[lab]]) > 0) {
words <- stringi::stri_extract_all_words(lbl[[lab]])
words <- unlist(words)
w_tmp <- hunspell::hunspell(words, "text", dict = dict, ignore = ignore)
words <- w_tmp[which(sapply(w_tmp, length) > 0)]
if (length(words) > 0) {
message(sprintf("Possible misspelled words in [%s]: (%s)",
lab, paste0(words, collapse=", ")))
}
}
})


+ 1
- 0
hrbrthemes.Rproj View File

@ -3,6 +3,7 @@ Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
QuitChildProcessesOnExit: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes


Loading…
Cancel
Save