Skip to content

Commit

Permalink
Fix for string subsetting example
Browse files Browse the repository at this point in the history
Words in example vector `x <- c("apple", "banana", "pear")` should start with an uppercase letter so the `str_to_lower` example makes sense.
  • Loading branch information
dgromer committed Nov 9, 2015
1 parent 0d84ea2 commit 1d02bda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion strings.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1d02bda

Please sign in to comment.