There is simple data:
> substr(dataa[35,3:ncol(dataa)],1,7)
[1] "6.66126" "6.97984" "7.00880" "8.68860" "8.22520" "9.81811" "8.51482" "8.42794" "8.51482" "9.41265"
[11] "9.58642" "9.55746" "0.11613" "0.11584" "0.11555" "0.11353" "0.11150" "0.10947" "0.10860" "0.11526"
[21] "0.11729" "0.12019" "0.11787" "148.395" "150.141" "154.262" "166.020" "155.908" "159.170" "154.377"
[31] "151.901" "158.591" "163.794" "159.351" "166.338" "164.039" "159.787" "160.590" "158.628" "155.936"
[41] "154.261" "154.504" "155.410" "161.253" "163.455" "176.077" "172.55" "171.85" "174.676" "169.847"
[51] "172.633" "171.59" "174.924" "174.293" "167.376" "164.261" "162.985" "161.955" "165.702" "165.4"
[61] "166.8" "169.6" "167.651" "171.631" "169.339" "171.013" "168.543" "164.988" "161.75" "165.812"
[71] "164.686" "682.230" "692.712" "698.037" "716.197" "735.422"
> as.character(test[[35]])
[1] "682.231" "692.713" "698.037" "716.197" "735.422"
I want to get the result in which place are the test values.
What I did and what happened:
d <- as.character(test[[35]])
which(substr(dataa[35,3:ncol(dataa)],1,7) == d, arr.ind=TRUE)
integer(0)
Warning message:
In substr(dataa[35, 3:ncol(dataa)], 1, 7) == d :
longer object length is not a multiple of shorter object length
But if I try just one character from d, it works fine:
> which(substr(dataa[35,3:ncol(dataa)],1,7) == "735.422")
[1] 76