Text Analysis/Mining in R

20th November 2026

Module overview

Text analysis, also known as text mining or natural language processing (NLP), involves the examination and extraction of meaningful information from text-based data. This includes various tasks such as sentiment analysis and topic modelling. It is a very useful technique for quantifying qualitative data, which serves as a great asset for mixed-method research projects. This technique also allows researchers to move towards participant-centred research. For example, traditional survey data use forced-choice questions to explore people’s satisfaction with clinical services by asking “to what extent do you agree or disagree” and allowing participants to rate their experience using a five-point Likert scale. The results offer limited insights into the nuances of participants’ experiences and opinions. In contrast, text analysis allows researchers to explore the richness of open-ended responses, uncovering deeper insights and subtleties that fixed-response options cannot capture.

Text analysis is also useful for understanding large volumes of textual data, uncovering hidden patterns, and generating insights that can inform decision-making. Continuing the example of patients’ satisfaction with local clinical support, patients might provide detailed comments about their experiences with wait times, staff behaviour, patient communication skills, and the cleanliness of facilities. Text analysis can help identify common complaints, such as long waiting periods or unresponsive staff, as well as positive feedback, like professional and compassionate care. Sentiment analysis can further quantify the overall tone of patient feedback, distinguishing between positive, negative, and neutral sentiments.

Throughout this module, students will learn the fundamentals of text analysis. Through hands-on exercises and practical examples, participants will gain proficiency in text preprocessing, data visualisation, and advanced text analysis techniques.

Prerequisites

If you are not already familiar with basic R programming, we recommend you take the introductory course to R.

Objectives

  • Understand Text Analysis tasks such as sentiment analysis and topic modelling. Explain the advantages and limitations of using text analysis in different research contexts.
  • Prepare Text Data and Exploratory Data Analysis. Conduct descriptive analyses, including summary statistics and data visualisation. Identify patterns and trends within text data.
  • Apply Text Analysis Techniques using real-world data. Learn to use popular text analysis libraries such as tidytext and textmineR in R.
  • Model Evaluation and Interpretation by using diagnostic tests to evaluate the performance of text analysis models. Address issues such as overfitting and interpret the results of text analysis.
  • Reporting Results effectively, including the use of visualisations and narrative explanations.

Format

The module consists of eight hours over one full day (with a one hour break), combining theoretical instruction with practical, hands-on exercises.

How to Book

Cambridge University postgraduate students and staff can book directly onto this module using the booking link provided. Please check that you are eligible before you make a booking. As soon as you book, you will receive an automated email confirming your place.

External participants and postgraduate students from Anglia Ruskin University should complete the Booking Request Form which you can find on the External Participants page.

Please note, some modules are repeated so you might have a choice of when to take module, in either Michaelmas or Lent Term.

Sessions

DateTimeTeaching FormatInstructor
Fri 20 Nov 202609:00-13:00In person venueYiran Zhao
Fri 20 Nov 202614:00-18:00In person venueYiran Zhao