I have a integer that has been assigned to a variable, I want to print that to the console but i get an error. Code and sample below
number <- 64
print("I want to print this number: " + number)
But instead I get the message: "Error: non-numeric argument to binary operator" I want to see something like
[1] "I want to print this number: 64"
Use sprintf
sprintf("I want to print this number: %i", number)
#[1] "I want to print this number: 64"
or paste0
paste0("I want to print this number: ", number)
#[1] "I want to print this number: 64"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With