R Warning: longer object not multiple of shorter length (2 Examples)
In this article, I’ll explain how to handle the warning message “longer object length is not a multiple of shorter object length” in the R programming language.
Example 1: Reproduce the Warning – longer object length is not a multiple of shorter object length
c("a", "b", "c") == c("b", "d") # Data objects with different length # [1] FALSE FALSE FALSE # Warning message: # In c("a", "b", "c") == c("b", "d") : # longer object length is not a multiple of shorter object length |
c("a", "b", "c") == c("b", "d") # Data objects with different length # [1] FALSE FALSE FALSE # Warning message: # In c("a", "b", "c") == c("b", "d") : # longer object length is not a multiple of shorter object length
Example 2: Solve the Warning – longer object length is not a multiple of shorter object length
c("a", "b", "c") == c("b", "d", "e") # Data objects with same length # [1] FALSE FALSE FALSE |
c("a", "b", "c") == c("b", "d", "e") # Data objects with same length # [1] FALSE FALSE FALSE
Related Tutorials
In addition, I can recommend to have a look at the related tutorials on my website: