I have a problem with the f statement, because it\'s returning to me this error message : \"the condition has length > 1 and only the first element will be used\" I hav
Your comparison is a TRUE/FALSE vector with more than one element, for the if
- else
to work it is usually necessary a length-one logical vector that is not NA
. Maybe what you need is to vectorize the conditions:
ind <- data.summary$Src.Node.Type == "eNodeB"
data.summary$vol.up<- NA
data.summary$vol.down<- NA
#for true
data.summary$vol.up[ind]<- data.summary$Src.Dst.Sig.Vol..Bytes.[ind]
data.summary$vol.down[ind] <- data.summary$Dst.Src.Sig.Vol..Bytes.[ind]
data.summary
# for false
data.summary$vol.up[!ind]<- data.summary$Dst.Src.Sig.Vol..Bytes.[!ind]
data.summary$vol.down[!ind] <- data.summary$Src.Dst.Sig.Vol..Bytes.[!ind]
data.summary