I'm new to programming and R. I'm trying to use the wordfish function in the Austin package. I created a term document matrix from a corpus but cannot successfully use the wordfish command:
library(tm)
library(austin)
text.corpus.format<-VCorpus(DirSource("MyDirectory"))
#create Word Frequency Matrix
wordfreqmatrix<-TermDocumentMatrix(text.corpus.format)
wcdata<-as.matrix(wordfreqmatrix) # CONVERT WORD COUNT MATRIX FOR USE WITH WORDFISH
wcdata<-t(wcdata) # TRANSPOSE TERM DOC MATRIX
as.matrix(as.data.frame(wcdata)) # ASSIGN DOC TITLES TO MATRIX
rownames(wcdata)<-lapply(text.corpus.format,Author)
#problematic command results:
wordfish(input=wcdata,dir=c(221,223))
Error in wordfish(input = wcdata, dir = c(221, 223)) :
unused argument (input = wcdata)
The correct usage for the wordfish function is wordfish(wfm,dir=c(1,10)). I thought I defined wcdata as a word frequency matrix, but I must have done something wrong. Any insight is greatly appreciated!