R: Easy R Programming for Beginners, Your Step-By-Step Guide To Learning R Programming (R Programming Series) by Felix Alvaro

R: Easy R Programming for Beginners, Your Step-By-Step Guide To Learning R Programming (R Programming Series) by Felix Alvaro

Author:Felix Alvaro [Alvaro, Felix]
Language: eng
Format: azw3
Published: 2016-05-01T04:00:00+00:00


Construct a character vector by the name sp, and assign it “I love to play hockey”:

> sp <- “I love to play hockey”

> sp

[1] “I love to play hockey”

Now, in order to split the above text at the spaces, you need to utilize strsplit( ) function:

> strsplit(sp, “ ”)

[[1]]

[1] “I” “love” “to” “play” “hockey”

The result shows the string split.

How to concatenate text?

In order to concatenate text, you need to utilize the paste( ) function:

paste(“I”, “love”, “to”, “play”, “hockey”)

[1] “I love to play hockey”



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.