You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
str_wrap sometimes inserts newlines at unwanted positions. The underlying function stringi::stri_wrap provides an option whitespace_only to force it to wrap only at whitespace. Exposing this option in the interface to str_wrap would provide an easy way to avoid this in many cases.
The whitespace_only parameter is just what I was looking for with a recent project - thanks!
The option is documented on the official stringr reference site - which made me think I could use it already. But I am just on the CRAN version of stringr (1.4.0), so it's not yet available. Aside: I think features that are only available in the development version should be flagged as such in the docs. (Or: how do you switch between the docs for the latest release and the docs for the dev version on the tidyverse site?)
I think I will wait for this option to reach CRAN, rather than switching to the dev version. I've used chris's stringi solution for now.
Description
str_wrap
sometimes inserts newlines at unwanted positions. The underlying functionstringi::stri_wrap
provides an optionwhitespace_only
to force it to wrap only at whitespace. Exposing this option in the interface tostr_wrap
would provide an easy way to avoid this in many cases.Reprex
Created on 2020-04-10 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: