I want to apply statistics to iteration column DataFrame:
columns number 1: "A" represents the tags that I want to distinguish:
for (i in names(dataframe)) { i <- as.name(i) group1 <- i[A=="locationX"] group2 <- i[A!="locationX"] p <- wilcox.test(group1,group2,na.action(na.omit))$p.value }
however, as.name() should try to remove the inverted commas from the column names(dataframe) generated by names(dataframe) .
Unfortunately this gives me an error:
Error in I [A == "locationX"]: an object of type "character" is not a subset of
I think as.name() is the wrong way to do this.
Any clues?
source share