R evaluates each line as a statement or expression. It can include calculations, function calls, or variable assignments.
You can assign values using <- (preferred in R) or =.
x <- 10
y = 20Use # to write single-line comments:
# This is a comment
x <- 42 # Assign 42 to xCode runs top-down in R. You can run scripts from:
Variable names are case-sensitive in R:
value <- 10
Value <- 20
print(value) # 10
print(Value) # 20Use print() or just the variable name to display output:
Ask the AI if you need help understanding or want to dive deeper in any topic