Rスクリプトの実行に少し問題があります:
sensoren <- read.csv("C:/..../sensors.csv")
messung <- read.table("C:/.../os.log")
s1 <- messung$V2
s2 <- messung$V4
s3 <- messung$V6
s4 <- messung$V8
i <- 1; j <- 1
while (i <= nrow(messung)){
+ while (j <= nrow(sensoren)){
+ if (s2[i] == sensoren[j,1] && s3[i] == sensoren[j,2] && s4[i] == sensoren[j,3]){
+ print(sensoren[j,5][drop=TRUE]); i <- i + 1; j <- 1;} else {j <- j + 1;}}}
スクリプトを実行すると、常にエラー メッセージが表示されます: Error in +while (j <= nrow(sensoren)) { : invalid argument to unary operator
誰かが私を助けてくれることを願っています、ありがとう!!
編集:
コードを変更したところ、次のようになりました。
while (i <= nrow(messung)){
+ while (j <= nrow(sensoren)){
+ if (c(s2[i],s3[i],s4[i]) == c(sensoren[j,1], sensoren[j,2], sensoren[j,3])){
+ print(sensoren[j,5][drop=TRUE]); i <- i + 1; j <- 1;} else {j <- j + 1;}}}
しかし、それでも同じエラーメッセージ...