When you create a text string in R, you must enclose it in quotes, like this: sentence <- "Hello, my name is Bas". The quotes tell R that you want to store this literal text, not refer to something already in memory.
If you forget the quotes and type sentence <- Hello, R will produce an error message that says “object ‘Hello’ not found”.
This error occurs because R interprets anything written without quotes as the name of an object that should already exist in memory.
This distinction between quoted and unquoted text is fundamental to how R works. When you type Hello without quotes, you’re asking R to look up the value stored in an object called Hello. When you type “Hello” with quotes, you’re providing the literal text “Hello” itself.
This is why you can do something like greeting <- "Hello" to store the text, and then later type greeting without quotes to retrieve it—the first “Hello” is a value you’re storing, while the second greeting is the name of the object you’re retrieving.