Skip to content

Commit

Permalink
Fix defunct dfm call (#242)
Browse files Browse the repository at this point in the history
* Fix defunct dfm call

* Fix snapshot

* Update NEWS

* Still using old pipe 馃槙

* Bump CI

* Try CI again

---------

Co-authored-by: Kenneth Benoit <kbenoit@KB-MacBook-Pro-14.local>
Co-authored-by: Julia Silge <julia.silge@gmail.com>
  • Loading branch information
3 people committed Apr 10, 2024
1 parent 87d90fc commit b61a650
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 6 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Expand Up @@ -2,6 +2,8 @@

* Added alt text to figures in vignettes and README (#233)

* Update vignette for quanteda::dfm() v4 (#242)

# tidytext 0.4.1

* Fixed bug for FREX stm tidier (#228)
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/reorder-within/reordered-boxplot.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
137 changes: 137 additions & 0 deletions tests/testthat/reordered-boxplot.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions tests/testthat/test-stm-tidiers.R
Expand Up @@ -86,12 +86,12 @@ test_that("can tidy frex + lift matrix", {

td2 <- tidy(stm_model_cov, matrix = "frex", w = 1)
frex_stm <- stm::calcfrex(logbeta, w = 1, word_counts)
expect_equal(td2, pivot_stm_longer(frex_stm, vocab))
expect_equal(td2, tidytext:::pivot_stm_longer(frex_stm, vocab))

td3 <- tidy(stm_model_cov, matrix = "lift")
expect_equal(colnames(td3), c("topic", "term"))
lift_stm <- stm::calclift(logbeta, word_counts)
expect_equal(td3, pivot_stm_longer(lift_stm, vocab))
expect_equal(td3, tidytext:::pivot_stm_longer(lift_stm, vocab))
})


Expand Down Expand Up @@ -182,3 +182,4 @@ test_that("can tidy estimateEffect object with three topics and an interaction t
"treatment:s(pid_rep)3", "treatment:s(pid_rep)4", "treatment:s(pid_rep)5", "treatment:s(pid_rep)6")
%in% td$term))
})

5 changes: 3 additions & 2 deletions vignettes/tidying_casting.Rmd
Expand Up @@ -4,7 +4,7 @@ author: "Julia Silge and David Robinson"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Converting to and from Document-Term Matrices and Corpus objects}
%\VignetteIndexEntry{Converting to and from Document-Term Matrix and Corpus objects}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down Expand Up @@ -88,7 +88,8 @@ Note that a tidier is also available for the `dfm` class from the quanteda packa
library(methods)
data("data_corpus_inaugural", package = "quanteda")
d <- quanteda::dfm(data_corpus_inaugural, verbose = FALSE)
d <- quanteda::tokens(data_corpus_inaugural) %>%
quanteda::dfm()
d
Expand Down

0 comments on commit b61a650

Please sign in to comment.