Here are some helpful readings to learn more about text mining and analysis.
Arnold, Taylor, Nicolas Ballier, Paula Lissón, and Lauren Tilton. 2019. “Beyond Lexical Frequencies: Using R for Text Analysis in the Digital Humanities.” Language Resources and Evaluation 53 (4): 707–33.
Sinclair, Stéfan, and Geoffrey Rockwell. 2015. “10. Teaching Computer-Assisted Text Analysis: Approaches to Learning New Methodologies.” In Digital Humanities Pedagogy : Practices, Principles and Politics, edited by Brett D. Hirsch, 241–63. Digital Humanities Series. Cambridge: Open Book Publishers.