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

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

Related Tutorials

In addition, I can recommend to have a look at the related tutorials on my website:

Leave a Reply

Your email address will not be published.

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu
Top