I have a array (ar) and want to delete several rows according to the result of a function.
Data
structure(c(0, 11, 17, 15, 22, 67, 73, 68, 31, 31, 28, 33, 34, 32, 11, 0, 9, 12, 21, 67, 73, 67, 35, 30, 34, 67, 60, 36, 17, 9, 0, 6, 19, 70, 74, 68, 36, 36, 36, 64, 66, 39, 15, 12, 6, 0, 13, 64, 69, 66, 34, 37, 39, 77, 65, 45, 22, 21, 19, 13, 0, 59, 60, 66, 38, 39, 39, 40, 43, 43, 67, 67, 70, 64, 59, 0, 10, 18, 77, 75, 78, 93, 93, 85, 73, 73, 74, 69, 60, 10, 0, 15, 76, 74, 80, 103, 101, 95, 68, 67, 68, 66, 66, 18, 15, 0, 59, 65, 73, 90, 87, 82, 31, 35, 36, 34, 38, 77, 76, 59, 0, 8, 19, 24, 28, 32, 31, 30, 36, 37, 39, 75, 74, 65, 8, 0, 12, 20, 22, 23, 28, 34, 36, 39, 39, 78, 80, 73, 19, 12, 0, 6, 14, 18, 33, 67, 64, 77, 40, 93, 103, 90, 24, 20, 6, 0, 2, 8, 34, 60, 66, 65, 43, 93, 101, 87, 28, 22, 14, 2, 0, 6, 32, 36, 39, 45, 43, 85, 95, 82, 32, 23, 18, 8, 6, 0), .Dim = c(14L, 14L))
After counting the values of each vector smaller than 25, the vector (the first) with more values smaller than 25 is selected.
a<-colSums(ar<25)
b<-which.max(a)
After this operations I obtain b = 10, indicating that [,10] is the vector with more values smaller than 25. Now I want to use the obtained vector to perform the following operation: to subset the array.
c<-subset(df,b<"25")
And from this operation I expect to exclude from the array the rows where [,10] has values smaller than 25. I have use the reference b in the last function but it does not work.
How can I refer to the resultant vector from a function?