Entering edit mode
4.0 years ago
kbaitsi
•
0
I have a tsv file with 61 columns and 18703 lines. I have written the following code:
f<-read.table(file = "GeneExpressionDataset_normalized.tsv", sep="\t", header=TRUE)
m<-as.data.frame(f)
m
for (i in 1:nrow(m)){
wt[i]<-c(sum(m[c(i:i),c(2:11)]))/10
}
wt
for (i in 1:nrow(m)){
TherA[i]<-c(sum(m[c(i:i),c(22:31)]))/10
}
TherA
For some reason the first loop works but the second one produces Error Subject not found. The loops are identical in syntax. What could be wrong?
Why are you using
c(i:i)
?