String

A string variable can be used to store text.

Input:

source_code/appendix_b_r/example04_string.r
first_name = "Satoshi"
last_name = "Nakamoto"
#String concatenation is performed with the command paste.
full_name = paste(first_name, last_name, sep = " ", collapse = NULL) 
cat("The invertor of Bitcoin is", full_name, ".
")

Output:

$ Rscript example04_string.r 
The invertor of Bitcoin is Satoshi-Nakamoto .
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset