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:
Before diving into the sample project, let’s understand how to properly set up textAnnotatoR and navigate its interface.
If you haven’t installed textAnnotatoR yet, you can install it from GitHub:
The first time you run textAnnotatoR, it will ask you to confirm where you want to store your project data:
You’ll see a dialog asking you to choose between: 1) Default Location: A folder managed by R in your user directory 2) Custom Location: A directory of your choice 3) Project-specific Location: A customizable directory unique to each project
When textAnnotatoR launches, you’ll see several tabs:
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.
When you first launch textAnnotatoR, it automatically creates a blank project. However, if you want to start a new project, click “New Project” in the top toolbar
If you have unsaved changes in your current project, you’ll see a confirmation dialog asking if you want to save your current project first:
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.
It’s important to save your project regularly. To do that, click on “Save Project”
Then, a dialog will appear:
The project will be saved as an RDS file, which preserves all your annotations, codes, and project structure.
Now let’s start coding our interview text:
Continue this process for other notable segments in the text. For example:
Your annotated text will begin to look like this, with different colored highlights representing different codes:
Once you’ve created some codes, you can apply them to new text segments:
As your coding progresses, you’ll want to manage your codes efficiently. You can click on the highlighted text to:
In some instances, you might find that some of your codes are conceptually similar or overlapping. textAnnotatoR provides a “Merge Codes” feature to consolidate these:
This feature is particularly useful when:
If you need to continue your work later, you’ll need to load your saved project: Click “Load Project”.
Then a dialog will appear:
All your text, annotations, codes, and memos will be restored exactly as you left them.
Once you’ve coded the entire interview, use the analysis tools to examine patterns:
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.
Click “Code Co-occurrence” to see relationships between different codes:
This visualization might reveal that “Boundary difficulty” and “Family friendly” frequently co-occur, suggesting a relationship between these issues.
The “Analysis” tab also provides basic text statistics:
These statistics can help you track your coding progress and provide context for your analysis.
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:
For each theme, add relevant codes:
For “Challenges”:
When finished, your code hierarchy should look something like this:
To save your annotations for further analysis or sharing:
To save the annotated text with all coding highlights:
If you’re working with a team where two researchers code the same text, you can use the comparison tools:
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_projectsThe 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.