Skip to content
Prev 327219 / 398502 Next

HELP R

Hi

You rather shall stop using HTML mail, it gets scrambled when posting to R help.
Then I believe you will profit from reading an Introduction to R, you seem to not knowing what you really do.

result <- vector("list",ncol(datos))

initializes result before a loop. If you have some extra columns the size of resulting list is not correct. The same apply to following loop.

for( i in 2:ncol(datos) {
result [i-1] <- bartlett.test(datos[,i]~datos$Provincia))
}
Error en `[.data.frame`(DATOS, , i) : undefined columns selected

Well, there probably shall be

result [[i-1]] <- bartlett.test(datos[,i]~datos$Provincia))

to get rid of the error.

Without data I did not test my code and therefore did not use correct assignment. Sorry.

Regards 
Petr