R Programming for Beginners: An Introduction to Learn R Programming with Tutorials and Hands-On Examples by Metzler Nathan

R Programming for Beginners: An Introduction to Learn R Programming with Tutorials and Hands-On Examples by Metzler Nathan

Author:Metzler, Nathan [Metzler, Nathan]
Language: eng
Format: epub
Published: 2020-09-12T00:00:00+00:00


14. Strings

A string is a sequence of individual characters. In R, strings belong to the character data type. We have seen plenty of string examples this far. In this chapter, we will revise the concepts that we already know and also learn few more things about strings.

14.1 String Formation

A string can be formed by enclosing the group of characters within single quotes or double quotes like this:

​ String_1 <- ‘Hi, this is a string’

​ ​ #OR

​ String_2 <- “This is also a string”

It is not possible to start a string with a single quote and end with a double quote or vice-versa.

If you want to include a single quote as a part of the string, you need to enclose the string within double quotes and if you want to include a double quote as a part of the string you need to enclose the string within single quotes.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.