Merge pull request #10 from dgromer/patch-1

Fix for string subsetting example
This commit is contained in:
Hadley Wickham 2015-11-09 12:44:42 -06:00
commit dbbf6f8c90
1 changed files with 1 additions and 1 deletions

View File

@ -126,7 +126,7 @@ str_c(c("x", "y", "z"), collapse = ", ")
You can extract parts of a string using `str_sub()`. As well as the string, `str_sub()` takes `start` and `end` argument which give the (inclusive) position of the substring:
```{r}
x <- c("apple", "banana", "pear")
x <- c("Apple", "Banana", "Pear")
str_sub(x, 1, 3)
# negative numbers count backwards from end
str_sub(x, -3, -1)