Skip to content
Prev 359910 / 398503 Next

Using a function with apply Error: undefined columns selected

At the point where the error is about to occur during the first column being processed, this is what had been printed:

Column being processed
[1] "newX[, i]"

So it should be no surprise that the actual error was:

Error in `[.data.frame`(data, , zz) : undefined columns selected

It occurred at one of the two points where you tried `data[,zz]`

You need to pass colnames(guppy) to fract2 and work with the character values.

All of the *apply function pass only values so they do not pass the column names for testing. A possible exception might be the colnames of a vector being avaialble when using apply with an index of 1.

--
Snipped