Practical Example - Qualitative Analysis with textAnnotatoR
Chao Liu
2025-04-07
Source:vignettes/practical_example.Rmd
practical_example.Rmd
Introduction
This vignette provides a step-by-step practical example of using the textAnnotatoR package for qualitative analysis. We’ll work through a complete example project, from importing text to analyzing coded content. You’ll learn how to:
- Set up a project
- Import text data
- Annotate text
- Analyze patterns within coded data
- Export results
Sample Project: Analyzing Interview Responses
For this example, we’ll be analyzing fictional interview responses about remote work experiences. The example demonstrates how you might use textAnnotatoR in a real qualitative research context.
Step 1: Starting a New Project
First, let’s launch the textAnnotatoR interface and create a new project:
When the interface loads, click “New Project” in the top toolbar:
Step 2: Importing Text Data
For this example, we’ll use the following interview excerpt. You can
copy this text into a file named
remote_work_interview.txt
:
Interviewer: Can you describe your experience transitioning to remote work?
Participant: It was definitely challenging at first. I think the biggest issues were setting up a proper workspace at home and establishing boundaries between work and personal life. It took me about a month to develop a routine that worked. Now, I actually prefer working remotely. I'm more productive without office distractions, and I save two hours daily by not commuting.
Interviewer: What tools or resources have been most helpful?
Participant: Video conferencing has been essential - we use Zoom for all our meetings. We also rely heavily on Slack for quick communications and Asana for project management. My company provided a second monitor and an ergonomic chair, which made a huge difference in my physical comfort. I'd say the technology was easy to adapt to, but the social aspects were harder. It's difficult to replace those impromptu conversations by the coffee machine.
Interviewer: How has remote work affected your work-life balance?
Participant: It's a double-edged sword. I have more flexibility and time with family, but it's also harder to disconnect. Sometimes I find myself checking emails well into the evening, which wasn't a habit before. I've had to be intentional about setting working hours and sticking to them. Taking short walks during the day has become my substitute for the natural breaks that happened in the office.
Go to the “File” tab and: 1. Click “Choose File” to upload your
remote_work_interview.txt
2. Click “Import Text”
Step 3: Annotating the Text
Now let’s start coding our interview text:
- Return to the text display area
- Click the selection tool (cursor icon) in the right margin
- Select text discussing the home workspace setup
- In the “Code and Memo” tab, enter “Home Setup” as the code
- Add a memo: “Initial challenge in transition to remote work”
- Click “Save” to save the code
Continue this process for other notable segments in the text. For example:
- Code Zoom, Slack, and Asana as “Technology”
- Code save two hours daily by not commuting as “Save Time”
- Code discussions of missed impromptu conversations as “Social Isolation”
Your annotated text will begin to look like this, with different colored highlights representing different codes:
If you want to apply an existing code to the text, first highlight the text and click on “Apply Code”, then choose the code you want to apply:
Step 4: Analyzing the Coded Data
Once you’ve coded the entire interview, use the analysis tools to examine patterns:
Code Frequency Analysis
Go to the “Analysis” tab and click “Code Frequency”. This will show which codes were mentioned most often:
In our example, we might see that “Making adjustment” and “Technology” appear most frequently, indicating these are significant aspects of the remote work experience for our participant.
Optional Step: Creating Themes
Sometimes multiple codes may share the same underlying theme and you may want to create a theme that encompasses several codes. Let’s create a logical hierarchy of themes and codes. Go to the “Themes” tab:
-
Click “Add Theme” and create the following themes:
- “Challenges”
- “Benefits”
- “Tools”
- “Work-Life Balance”
-
For each theme, add relevant codes:
For “Challenges”:
- Click “Add Code to Theme”
- Select “Challenges” as the parent theme
- Add codes like “Technical Issues”, “Social Isolation”, “Home Setup”
When finished, your code hierarchy should look something like this:
Continue for other themes with appropriate codes.
Step 5: Exporting Results
Step 6: Project Comparison (Two Coders)
If you’re working with a team where two researchers code the same text, you can use the comparison tools:
- Have each team member code the interview independently
- Save each person’s annotations as CSV files
- Go to the “Comparison” tab
- Upload both CSV files
- Run the comparison to see inter-coder agreement and differences
Getting the Sample Project
To practice with this exact example, you can download a starter project from the textAnnotatoR GitHub repository:
# If you have the remotes package installed
remotes::install_github("chaoliu-cl/textAnnotatoR", build_vignettes = TRUE)
# Or browse to:
# https://github.com/chaoliu-cl/textAnnotatoR/inst/extdata/sample_projects
The sample projects include the interview text file used for this demonstration and a word file that contains Martin Luther King Jr.’s “I have a dream” speech.
Note: Screenshots and example outputs in this vignette are for illustration purposes. Your actual interface may vary slightly depending on your operating system, R version, and package version.