I run a stylometric analysis of poetry in R Studio using the package "stylo". I want to compare two sets of texts via function oppose. I created subdirectories in my working directory for the partitions "male" and "female.
# create folders for the genders
dir.create("female")
dir.create("male")
# copy the poems to the corresponding folders
file.copy(poems_female, "female")
file.copy(poems_male, "male")
# oppose
oppose(gui = TRUE,
primary.corpus = "female",
secondary.corpus = "male")
Then this error occurs:
The object you've specified as your corpus cannot be used. It should be a list containing particular text samples (vectors containing sequencies of words/n-grams or other features). The samples (elements of the list) should have their names. Alternatively, try to build your corpus from text files (default).
really didn't know what to do, because the samples are .txt files with plain text, which should be working just fine