Skip to content

Commit b1d2481

Browse files
authored
RC 0.4.3 (#248)
* Add package anchors, format with air * Redocument * Update README and NEWS * Update GH actions * Don't need to specify vdiffr version anymore * Run revdeps, update CRAN comments * Increment version number to 0.4.3
1 parent e1cb807 commit b1d2481

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1082
-595
lines changed

.github/workflows/R-CMD-check-hard.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
R_KEEP_PKG_SOURCE: yes
3232

3333
steps:
34-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v4
3535

3636
- uses: r-lib/actions/setup-pandoc@v2
3737

.github/workflows/R-CMD-check.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
R_KEEP_PKG_SOURCE: yes
3131

3232
steps:
33-
- uses: actions/checkout@v2
33+
- uses: actions/checkout@v4
3434

3535
- uses: r-lib/actions/setup-pandoc@v2
3636

@@ -43,8 +43,7 @@ jobs:
4343
- uses: r-lib/actions/setup-r-dependencies@v2
4444
with:
4545
extra-packages:
46-
any::rcmdcheck,
47-
46+
any::rcmdcheck
4847
needs: check
4948

5049
- uses: r-lib/actions/check-r-package@v2

.github/workflows/pkgdown.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
env:
2121
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2424

2525
- uses: r-lib/actions/setup-pandoc@v2
2626

.github/workflows/pr-commands.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
env:
1515
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1818

1919
- uses: r-lib/actions/pr-fetch@v2
2020
with:
@@ -51,7 +51,7 @@ jobs:
5151
env:
5252
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
5353
steps:
54-
- uses: actions/checkout@v2
54+
- uses: actions/checkout@v4
5555

5656
- uses: r-lib/actions/pr-fetch@v2
5757
with:

.github/workflows/test-coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919

2020
- uses: r-lib/actions/setup-r@v2
2121
with:

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: tidytext
33
Title: Text Mining using 'dplyr', 'ggplot2', and Other Tidy Tools
4-
Version: 0.4.2.9000
4+
Version: 0.4.3
55
Authors@R: c(
66
person("Gabriela", "De Queiroz", , "[email protected]", role = "ctb"),
77
person("Colin", "Fay", , "[email protected]", role = "ctb",
@@ -74,4 +74,4 @@ Config/testthat/edition: 3
7474
Encoding: UTF-8
7575
LazyData: TRUE
7676
Roxygen: list(markdown = TRUE)
77-
RoxygenNote: 7.3.1
77+
RoxygenNote: 7.3.2

NEWS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# tidytext (development version)
1+
# tidytext 0.4.3
2+
3+
* Updated package anchors in roxygen comments
24

35
# tidytext 0.4.2
46

R/bind_tf_idf.R

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ bind_tf_idf <- function(tbl, term, document, n) {
5454
tbl$idf <- as.numeric(idf[terms])
5555
tbl$tf_idf <- tbl$tf * tbl$idf
5656

57-
if(any(tbl$idf < 0, na.rm = TRUE)) {
58-
rlang::warn(paste("A value for tf_idf is negative:\n",
59-
"Input should have exactly one row per document-term combination."))
57+
if (any(tbl$idf < 0, na.rm = TRUE)) {
58+
rlang::warn(
59+
paste(
60+
"A value for tf_idf is negative:\n",
61+
"Input should have exactly one row per document-term combination."
62+
)
63+
)
6064
}
6165
tbl
6266
}
63-

R/compat_lazyeval.R

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,25 @@
33
# This file serves as a reference for compatibility functions for lazyeval.
44
# Please find the most recent version in rlang's repository.
55

6-
76
warn_underscored <- function() {
87
return(NULL)
9-
warn(paste(
10-
"The underscored versions are deprecated in favour of",
11-
"tidy evaluation idioms. Please see the documentation",
12-
"for `quo()` in rlang"
13-
))
8+
warn(
9+
paste(
10+
"The underscored versions are deprecated in favour of",
11+
"tidy evaluation idioms. Please see the documentation",
12+
"for `quo()` in rlang"
13+
)
14+
)
1415
}
1516
warn_text_se <- function() {
1617
return(NULL)
1718
warn("Text parsing is deprecated, please supply an expression or formula")
1819
}
1920

2021
compat_lazy <- function(lazy, env = caller_env(), warn = TRUE) {
21-
if (warn) warn_underscored()
22+
if (warn) {
23+
warn_underscored()
24+
}
2225

2326
if (missing(lazy)) {
2427
return(quo())
@@ -30,11 +33,14 @@ compat_lazy <- function(lazy, env = caller_env(), warn = TRUE) {
3033
return(as_quosure(lazy, env))
3134
}
3235

33-
out <- switch(typeof(lazy),
36+
out <- switch(
37+
typeof(lazy),
3438
symbol = ,
3539
language = new_quosure(lazy, env),
3640
character = {
37-
if (warn) warn_text_se()
41+
if (warn) {
42+
warn_text_se()
43+
}
3844
parse_quo(lazy[[1]], env)
3945
},
4046
logical = ,
@@ -46,10 +52,9 @@ compat_lazy <- function(lazy, env = caller_env(), warn = TRUE) {
4652
}
4753
new_quosure(lazy, env)
4854
},
49-
list =
50-
if (inherits(lazy, "lazy")) {
51-
lazy = new_quosure(lazy$expr, lazy$env)
52-
}
55+
list = if (inherits(lazy, "lazy")) {
56+
lazy = new_quosure(lazy$expr, lazy$env)
57+
}
5358
)
5459

5560
if (is_null(out)) {
@@ -78,7 +83,11 @@ compat_lazy_dots <- function(dots, env, ..., .named = FALSE) {
7883

7984
named <- have_name(dots)
8085
if (.named && any(!named)) {
81-
nms <- vapply(dots[!named], function(x) expr_text(get_expr(x)), character(1))
86+
nms <- vapply(
87+
dots[!named],
88+
function(x) expr_text(get_expr(x)),
89+
character(1)
90+
)
8291
names(dots)[!named] <- nms
8392
}
8493

@@ -87,14 +96,16 @@ compat_lazy_dots <- function(dots, env, ..., .named = FALSE) {
8796
}
8897

8998
compat_as_lazy <- function(quo) {
90-
structure(class = "lazy", list(
91-
expr = get_expr(quo),
92-
env = get_env(quo)
93-
))
99+
structure(
100+
class = "lazy",
101+
list(
102+
expr = get_expr(quo),
103+
env = get_env(quo)
104+
)
105+
)
94106
}
95107
compat_as_lazy_dots <- function(...) {
96108
structure(class = "lazy_dots", lapply(quos(...), compat_as_lazy))
97109
}
98110

99-
100111
# nocov end

R/corpus_tidiers.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ tidy.Corpus <- function(x, collapse = "\n", ...) {
5252
# keep as a list column
5353
return(m)
5454
}
55-
m <- purrr::map_at(m, which(lengths == 0), ~ NA)
55+
m <- purrr::map_at(m, which(lengths == 0), ~NA)
5656

5757
ret <- unname(do.call(c, m))
5858
## tbl_df() doesn't support POSIXlt format
@@ -78,7 +78,6 @@ tidy.Corpus <- function(x, collapse = "\n", ...) {
7878
ret
7979
}
8080

81-
8281
#' Tidiers for a corpus object from the quanteda package
8382
#'
8483
#' Tidy a corpus object from the quanteda package. `tidy` returns a
@@ -115,14 +114,15 @@ tidy.Corpus <- function(x, collapse = "\n", ...) {
115114
#'
116115
#' @export
117116
tidy.corpus <- function(x, ...) {
118-
tibble::as_tibble(data.frame(
119-
text = as.character(x),
120-
quanteda::docvars(x),
121-
stringsAsFactors = FALSE
122-
))
117+
tibble::as_tibble(
118+
data.frame(
119+
text = as.character(x),
120+
quanteda::docvars(x),
121+
stringsAsFactors = FALSE
122+
)
123+
)
123124
}
124125

125-
126126
#' @rdname corpus_tidiers
127127
#' @export
128128
glance.corpus <- function(x, ...) {

0 commit comments

Comments
 (0)