From 1d02bda86a9fa9989c3177107fb96f62642c3412 Mon Sep 17 00:00:00 2001 From: Daniel Gromer Date: Mon, 9 Nov 2015 19:41:00 +0100 Subject: [PATCH] Fix for string subsetting example Words in example vector `x <- c("apple", "banana", "pear")` should start with an uppercase letter so the `str_to_lower` example makes sense. --- strings.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings.Rmd b/strings.Rmd index 7b53b70..4f7ac82 100644 --- a/strings.Rmd +++ b/strings.Rmd @@ -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)