Skip to content

Commit

Permalink
Address some check() NOTEs
Browse files Browse the repository at this point in the history
  • Loading branch information
seancarmody committed Sep 10, 2022
1 parent 6d9c065 commit af04245
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/ggram.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ggram <- function(phrases, ignore_case = FALSE, code_corpus = FALSE,
aes_string(x = "Year", y = "Frequency",
colour = "Phrase", fill = "Phrase",
label = "Phrase"))
if (!(class(geom) == "character")) geom <- NULL
if (!inherits(geom, "character")) geom <- NULL
if (!is.null(geom)) p <- p + do.call(stat_identity,
c(geom = geom, geom_options))
p <- p + labs(x = NULL)
Expand Down
4 changes: 2 additions & 2 deletions R/ngram.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ ngram_fetch_data <- function(html) {
data <- bind_rows(data)
data <- data |> mutate(ngram = textutils::HTMLdecode(data$ngram), Corpus = corpus) |>
separate(ngram, c("clean", "C"), ":", remove = FALSE, extra = "drop", fill = "right") |>
left_join(select(corpuses, Shorthand, Shorthand.Old), by = c("C" = "Shorthand.Old")) |>
left_join(select(corpuses, .data$Shorthand, .data$Shorthand.Old), by = c("C" = "Shorthand.Old")) |>
mutate(Corpus = if_else(is.na(.data$Shorthand), .data$Corpus, .data$Shorthand)) |>
select(-C, -Shorthand) |>
select(-.data$C, -.data$Shorthand) |>
relocate(.data$Year, .data$ngram, .data$timeseries, .data$Corpus) |>
rename(Phrase = .data$ngram, Frequency = .data$timeseries, Parent = .data$parent)
return(data)
Expand Down
5 changes: 3 additions & 2 deletions man/ngram.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit af04245

Please sign in to comment.