tag:blogger.com,1999:blog-4112346421260087829.post6187651634465960892..comments2023-05-09T10:26:09.046-04:00Comments on Maps and Apps: Line Breaks Between Words in Axis Labels in ggplot in RUnknownnoreply@blogger.comBlogger3125tag:blogger.com,1999:blog-4112346421260087829.post-36050851286747620762013-10-22T09:51:08.111-04:002013-10-22T09:51:08.111-04:00Thanks, David! I fixed it.Thanks, David! I fixed it.Molliehttps://www.blogger.com/profile/13166731711590449291noreply@blogger.comtag:blogger.com,1999:blog-4112346421260087829.post-20850311790483608762013-10-22T04:58:40.122-04:002013-10-22T04:58:40.122-04:00This is helpful, thanks Mollie, and to Jason for t...This is helpful, thanks Mollie, and to Jason for the alternative. I'll try them both out. Though Mollie, your first two code fragments are the same are they not? I imagine that the gsub line should not be in your 'messy example'?Anonymoushttps://www.blogger.com/profile/10479125073829528002noreply@blogger.comtag:blogger.com,1999:blog-4112346421260087829.post-38187120817854755942013-10-20T08:51:36.557-04:002013-10-20T08:51:36.557-04:00You could also break using a set character width s...You could also break using a set character width so that a line break is not necessarily added for every space. That is, you want a maximum width of 25 characters:<br /><br />sapply(strwrap(as.character(value), width=25, simplify=FALSE), paste, collapse="\n")<br /><br />You can steal our function in the likert package: https://github.com/jbryer/likert/blob/master/R/label_wrap_mod.rAnonymoushttps://www.blogger.com/profile/05672095297911457234noreply@blogger.com