Permalink
Browse files

Fix path for THANKS

  • Loading branch information...
1 parent d94eddb commit 346e144fecfd11acb2585c9f8dd8b4799a5f0189 @hadley committed Dec 4, 2012
Showing with 6 additions and 2 deletions.
  1. +2 −0 NEWS
  2. +2 −1 R/wrap.r
  3. +2 −1 man/str_wrap.Rd
View
2 NEWS
@@ -1,6 +1,8 @@
stringr 0.6.2
================
+* fixed path in `str_wrap` example so works for more R installations.
+
* remove dependency on plyr
stringr 0.6.1
View
3 R/wrap.r
@@ -13,7 +13,8 @@
#' @return a character vector of reformatted strings.
#' @export
#' @examples
-#' thanks <- str_c(readLines(R.home("doc/THANKS")), collapse = "\n")
+#' thanks_path <- file.path(R.home("doc"), "THANKS")
+#' thanks <- str_c(readLines(thanks_path), collapse = "\n")
#' thanks <- word(thanks, 1, 3, fixed("\n\n"))
#' cat(str_wrap(thanks), "\n")
#' cat(str_wrap(thanks, width = 40), "\n")
View
3 man/str_wrap.Rd
@@ -26,7 +26,8 @@
See \code{\link{strwrap}} for more details.
}
\examples{
-thanks <- str_c(readLines(R.home("doc/THANKS")), collapse = "\\n")
+thanks_path <- file.path(R.home("doc"), "THANKS")
+thanks <- str_c(readLines(thanks_path), collapse = "\\n")
thanks <- word(thanks, 1, 3, fixed("\\n\\n"))
cat(str_wrap(thanks), "\\n")
cat(str_wrap(thanks, width = 40), "\\n")

0 comments on commit 346e144

Please sign in to comment.