ConversationAlign_Step1_Read

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
# Load SemanticDistance
library(ConversationAlign)

Reading data into R for ConversationAlign

Half the battle with R is getting your data imported and formatted. This is especially true for string data and working with text. ConversationAlign uses a series of sequential functions to import, clean, and format your raw data. You MUST run each of these functions. They append important variable names and automatically reshape your data.

Prepping your data for import

read_dyads()

Here are some exampples of read_dyads() in action. There is only one argument to read_dyads(), and that is my_path. This is for supplying a quoted directory path to the folder where your transcripts live. Remember to treat this folder as a staging area! Once you are finished with a set of transcripts and don't want them read into ConversationAlign move them out of the folder, or specify a new folder. Language data tends to proliferate quickly, and it is easy to forget what you are doing. Be a CAREFUL secretary, and record your steps.

Arguments to read_dyads include:
1. my_path: default is 'my_transcripts', change path to your folder name

#will search for folder 'my_transcripts' in your current directory
MyConvos <- read_dyads()

#will scan custom folder called 'MyStuff' in your current directory, concatenating all files in that folder into a single dataframe
MyConvos2 <- read_dyads(my_path='/MyStuff')

read_1file()

Arguments to read_1file include:
1. my_dat: object already in your R environment containing text and speaker information.

MaryLittleLamb <- read_1file(MaronGross_2013)
#print first ten rows of header
knitr::kable(head(MaronGross_2013, 15), format = "pipe")




Try the ConversationAlign package in your browser

Any scripts or data that you put into this service are public.

ConversationAlign documentation built on Aug. 8, 2025, 7:22 p.m.