I'm trying to define all appropriate data frame columns as factors and the creteria that I have includes what's NOT (by a list of ngrams, see below the code snippet) a factor:
data.clean[,names(data.clean)[grep("^[^time]*[^tot]*[^count]*[^score]*[^include]*[^has]*[^__fe]*$",
names(data.clean))]]
<- as.factor(as.character(data.clean[,names(data.clean)[grep("^[^time]*[^tot]*[^count]*[^score]*[^include]*[^has]*[^__fe]*$",
names(data.clean))]]))
but it doesn't seem to do the trick. Any suggestions why? thanks