---subscript out of bounds

hi guys... i don't know why... but

asd_sel.dt <- corr.ROIs[c("ROI_1", "ROI_2")]
asd_sel.dt$olymp.mean <-apply(asd_sel.dt, 1, function(row) {
  values <- c()
  for(person in names(asd_sel)) {
     frame <- paste("corr.", person, sep="")
     elem <- frame[ (frame[["ROI_1"]] == row["ROI_1"]) & (frame[["ROI_2"]] == row["ROI_2"]), "pearson.corr"]
     values <- c(values, elem)
  values <- values[values != min(values)]; values <- values[values != max(values)]

frame[ (frame[["ROI_1"]] == row["ROI_1"]) & (frame[["ROI_2"]] == row["ROI_2"]), "pearson.corr"] this is an error... but its more strange anyone can tell me the reason? thanks!

found the solution... put get(paste("corr.", person, sep="")), this will be match the corresponding location in your memory, this maps string with variable name

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.