R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.2     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.2     ✔ tibble    3.2.1
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.1     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
## Loading required package: NLP
## 
## 
## Attaching package: 'NLP'
## 
## 
## The following object is masked from 'package:ggplot2':
## 
##     annotate
## 
## 
## Loading required package: Matrix
## 
## 
## Attaching package: 'Matrix'
## 
## 
## The following objects are masked from 'package:tidyr':
## 
##     expand, pack, unpack
## 
## 
## 
## Attaching package: 'textmineR'
## 
## 
## The following object is masked from 'package:Matrix':
## 
##     update
## 
## 
## The following object is masked from 'package:stats':
## 
##     update
## 
## 
## 
## Attaching package: 'scales'
## 
## 
## The following object is masked from 'package:purrr':
## 
##     discard
## 
## 
## The following object is masked from 'package:readr':
## 
##     col_factor
## 
## 
## randomForest 4.7-1.1
## 
## Type rfNews() to see new features/changes/bug fixes.
## 
## 
## Attaching package: 'randomForest'
## 
## 
## The following object is masked from 'package:dplyr':
## 
##     combine
## 
## 
## The following object is masked from 'package:ggplot2':
## 
##     margin
## 
## 
## 
## Attaching package: 'yardstick'
## 
## 
## The following object is masked from 'package:readr':
## 
##     spec
## Rows: 63,702
## Columns: 3
## $ X          <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, …
## $ created_at <chr> "10/20/2022 3:48", "10/13/2022 6:38", "10/18/2022 11:04", "…
## $ text       <chr> "@AmazfitGlobal My next Triumphs is gain weight &amp; join …
## <<VCorpus>>
## Metadata:  corpus specific: 0, document level (indexed): 0
## Content:  documents: 63702
## Loading required package: RColorBrewer

## <<DocumentTermMatrix (documents: 6, terms: 108362)>>
## Non-/sparse entries: 92/650080
## Sparsity           : 100%
## Maximal term length: 205
## Weighting          : term frequency (tf)
## A LDA_VEM topic model with 3 topics.
## # A tibble: 6 × 3
##   topic term               beta
##   <int> <chr>             <dbl>
## 1     1 – cnet      0.00000116 
## 2     2 – cnet      0.00000105 
## 3     3 – cnet      0.000000818
## 4     1 – explained 0.000000581
## 5     2 – explained 0.00000128 
## 6     3 – explained 0.00000118

## # A tibble: 325,086 × 3
##    topic term               beta
##    <int> <chr>             <dbl>
##  1     1 – cnet      0.00000116 
##  2     2 – cnet      0.00000105 
##  3     3 – cnet      0.000000818
##  4     1 – explained 0.000000581
##  5     2 – explained 0.00000128 
##  6     3 – explained 0.00000118 
##  7     1 –made       0.00000230 
##  8     2 –made       0.00000119 
##  9     3 –made       0.00000258 
## 10     1 ——gt        0.00000487 
## # ℹ 325,076 more rows

References: Text Mining with R: A Tidy Approach. https://www.tidytextmining.com/. Learning Social Media Analytics with R, Oreilly - Free e-book (online access available at https: //library.csub.edu/). Course notes, Zhenning Jimmy Xu, https://bookdown.org/utjimmyx/marketing_research/ https://rpubs.com/utjimmyx