Running examples in ‘stylo-Ex.R’ failed
The error most likely occurred in:

> ### Name: crossv
> ### Title: Function to Perform Cross-Validation
> ### Aliases: crossv
> 
> ### ** Examples
> 
> ## Not run: 
> ##D ## standard usage:
> ##D crossv(training.set, test.set)
> ## End(Not run)
> 
> ## text categorization
> 
> # specify a table with frequencies
> data(lee)
> # perform a leave-one-out classification using kNN
> results = crossv(lee, classification.method = "knn")

cross-validation...

> # inspect final results
> performance.measures(results)
$precision
   Capote  Faulkner   Glasgow HarperLee McCullers   OConnor    Styron     Welty 
0.8000000 1.0000000 0.7500000 0.6666667 1.0000000 0.6000000 0.7500000 0.5000000 

$recall
   Capote  Faulkner   Glasgow HarperLee McCullers   OConnor    Styron     Welty 
0.8000000 0.8000000 1.0000000 1.0000000 0.3333333 1.0000000 0.7500000 0.3333333 

$f
   Capote  Faulkner   Glasgow HarperLee McCullers   OConnor    Styron     Welty 
0.8000000 0.8888889 0.8571429 0.8000000 0.5000000 0.7500000 0.7500000 0.4000000 

$accuracy
[1] 0.75

$avg.precision
[1] 0.7583333

$avg.recall
[1] 0.7520833

$avg.f
[1] 0.718254

> 
> 
> 
> ## stratified cross-validation
> 
> # specity a table with frequencies
> data(galbraith)
> freqs = galbraith
> # specify class labels:
> training.texts = c("coben_breaker", "coben_dropshot", "lewis_battle", 
+                    "lewis_caspian", "rowling_casual", "rowling_chamber", 
+                    "tolkien_lord1", "tolkien_lord2")
> train.classes = match(training.texts,rownames(freqs))
> 
> # select the training samples:
> training.set = freqs[train.classes,]
> # select remaining rows as test samples:
> test.set = freqs[-train.classes,]
> 
> crossv(training.set, test.set, cv.mode = "stratified")

cross-validation...


Function call:
crossv(training.set = training.set, test.set = test.set, cv.mode = "stratified")

Depending on your chosen options, some results should have been written
into a few files; you should be able to find them in your current
(working) directory. Usually, these include a list of words/features
used to build a table of frequencies, the table itself, a file containing
recent configuration, etc.

Advanced users: you can pipe the results to a variable, e.g.:
	 it.deserves.a.nobel.prize = crossv()
this will create a class "it.deserves.a.nobel.prize" containing some presumably
interesting stuff. The class created, you can type, e.g.:
	 summary(it.deserves.a.nobel.prize)
to see which variables are stored there and how to use them.


for suggestions how to cite this software, type: citation("stylo")


> 
> 
> 
> # classifying the standard 'iris' dataset:
> data(iris)
> x = subset(iris, select = -Species)
> train = rbind(x[1:25,], x[51:75,], x[101:125,])
> test = rbind(x[26:50,], x[76:100,], x[126:150,])
> train.classes = c(rep("s",25), rep("c",25), rep("v",25))
> test.classes = c(rep("s",25), rep("c",25), rep("v",25))
> 
> crossv(train, test, cv.mode = "stratified", cv.folds = 10, 
+        train.classes, test.classes)

cross-validation...

Error in `.rowNamesDF<-`(x, value = value) : invalid 'row.names' length
Calls: crossv ... row.names<- -> row.names<-.data.frame -> .rowNamesDF<-
Execution halted