Loading the data into R

You need to load your prepared data file into R so that it can “see” it. By way of example we will use sampledata.txt, but your filename will probably be different.

First thing, the data file needs to be in a directory where R is looking. Go to the “File” menu, and select the “Change dir...” option. You can use this dialog box to change the working directory, which is the directory in which R looks for files. Or, you could note the directory that R looks in by default, and put your data file in that directory.

At the R prompt, type the following command:

data <- read.table("sampledata.txt",h=T);

Nothing about this command needs to be changed aside from the filename.

Scaling the data

Most likely all of your vowels will have slightly different lengths. You may want to align or scale the time dimension of the data for better comparisons.

This command will stretch the time so that all of the vowels have the same length (between 0 and 1 units).

data<-align(data,'justified');

This command will line up all of the vowels at their left edge.

data<-align(data,'left');

This command will line up all of the vowels at their right edge.

data<-align(data,'right');

This command will line up all of the vowels at their center.

data<-align(data,'center');

If you perform one of the alignment commands but then change your mind, you need to reload the data again, as discussed above.

All contents © 2024 Adam Baker, except where otherwise noted.