Manipulating Strings: Paste FunctionSeptember 27, 2016Strings are sets of character data. You may find the need to manipulate strings in one way or another. Here we cover the paste() function. The paste() function takes a set of character arguments and puts them together into one. (Don’t forget you can also always enter help(paste) to find more information in the R help files.)
Here we see only two arguments, but you can have as many as you would like. Also note how there are no spaces in the arguments, but there is in the output. This is because the paste function has a sep argument that determines what to put in between entries, so lets try entering in a seperator.
Note: The seperator can be whatever you would like to define it as. Paste also has the functionality of using lists to pair elements of the lists together:
0 Comments
Leave a Reply. |
Spatial Ecology @ MSUClick on "Category" below to search for R code compiled by the Zarnetske Spatial & Community Ecology Lab and students in MSU's Spatial Ecology graduate course (FOR870/FW870) Category
All
Archive
October 2016
|