Error in R – invalid (do_set) left-hand side to assignment (2 Examples)

In this R tutorial you’ll learn how to avoid the “Error in X : invalid (do_set) left-hand side to assignment”.

Example 1: How to Reproduce the Error in X : invalid (do_set) left-hand side to assignment

3 <- 3                     # Assignment leads to error message
# Error in 3 <- 3 : invalid (do_set) left-hand side to assignment

Example 2: How to Avoid the Error in X : invalid (do_set) left-hand side to assignment

x <- 3                     # Assignment works fine
x                          # Display data object
# [1] 3

Related Articles & Further Resources

Furthermore, you might want to have a look at the other tutorials on my website.

Leave a Reply

Your email address will not be published. Required fields are marked *

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