juliasilge / tidytext
Showing 1 of 2 files from the diff.

@@ -150,10 +150,7 @@
Loading
150 150
151 151
  }
152 152
153 -
  input <- as_name(input)
154 -
  output <- as_name(output)
155 -
156 -
  col <- tbl[[input]]
153 +
  col <- pull(tbl, !!input)
157 154
  output_lst <- tokenfunc(col, ...)
158 155
159 156
  if (!(is.list(output_lst) && length(output_lst) == nrow(tbl))) {
@@ -165,21 +162,25 @@
Loading
165 162
166 163
  tbl_indices <- vec_rep_each(seq_len(nrow(tbl)), lengths(output_lst))
167 164
  ret <- vec_slice(tbl, tbl_indices)
168 -
  ret[[output]] <- flatten_chr(output_lst)
165 +
  ret$out <- flatten_chr(output_lst)
169 166
170 167
  if (to_lower) {
171 168
    if (!is_function(token))
172 169
      if(token == "tweets") {
173 170
        rlang::inform("Using `to_lower = TRUE` with `token = 'tweets'` may not preserve URLs.")
174 171
      }
175 -
    ret[[output]] <- stringr::str_to_lower(ret[[output]])
172 +
    ret$out <- stringr::str_to_lower(ret$out)
176 173
  }
177 174
175 +
  ret <- rename(ret, "{{output}}" := out)
176 +
  eval_input <- eval_tidy(input, data = ret)
177 +
  eval_output <- eval_tidy(output, data = ret)
178 +
178 179
  # For data.tables we want this to hit the result and be after the result
179 180
  # has been assigned, just to make sure that we don't reduce the data.table
180 181
  # to 0 rows before inserting the output.
181 -
  if (drop && input != output) {
182 -
    ret[[input]] <- NULL
182 +
  if (drop && all(eval_input != eval_output, na.rm = TRUE)) {
183 +
    ret <- mutate(ret, "{{input}}" := NULL)
183 184
  }
184 185
185 186
  ret
Files Coverage
R 83.04%
Project Totals (19 files) 83.04%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
    patch:
10
      default:
11
        target: auto
12
        threshold: 1%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading