Package stringr: String SplitSeptember 27, 2016Sometimes it is necessary to take apart a string. The str_split() function in the stringr package allows you to do that.
Let’s use the example dataset Loblolly in r
Here in the first column we have the height of the trees in ft. Lets say that we want to convert this to two columns one for feet and another for inches. (Note: There are quite a few ways to do this, but here we use this method to show off the str_split() function.)
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
|