Displaying 20 results from an estimated 80 matches for "strwrap".
2005 Nov 29
1
help combining mtext and strwrap?
...pressible alkaline phosphatase, a glycoprotein localized to the
vacuole; regulated by levels of inorganic phosphate and by a system
consisting of Pho4p, Pho9p, Pho80p, Pho81p and Pho85p; dephosphorylates
phosphotyrosyl peptides")
par(mar=c(10,3,10,3))
image(as.matrix(c(1,2,3,4,5)))
mtext(strwrap(notes, width=60), line=5, side=3)
..as you can see, the long text plots over itself and doesn't wrap. Does
anyone know how to include a paragraph in the margins?
Thanks in advance!
--Jake
2005 Sep 01
0
strwrap
The maximum length of a character string returned by strwrap,
i.e. max(nchar(strwrap(x,width))), never in my experience exceeds
width-2 (unless x contains a word that is longer than this).
This is not exactly a bug -- width is described only as a "target
column for wrapping lines" -- but seems odd.
Though I don't understand everything that the...
2001 Oct 26
3
warnings --- wish/bug (PR#1148)
When R prints warnings, they often go "out of the line", it would be
better if they where wrapped with
writeLines(strwrap ...
I tried to do that , changing the function warnings, but it has only
effect when called explicitely, not when R prints the warnings unasked.
Anyhow, here is the changed warnings:
warnings <-
function (...)
{
if (!(n <- length(last.warning)))
return()
names <- names...
2012 Mar 15
1
how to assign "writeLines" function
hi,
what I want to do is assigning following code to any object.
k<-paste("thank")
writeLines(strwrap(k, width = 80,indent = 7,exdent = 6))
To assign the "writeLines" code,
I try this
a<-writeLines(strwrap(k, width = 80,indent = 7,exdent = 6))
or
assign(a,writeLines(strwrap(k, width = 80,indent = 7,exdent = 6)))
but it doesn't work.
is there any way to solve the problem?...
2011 Aug 16
3
Text wrap
Hi everyone.
I have a long label that I would like to split. I found that I could use
"strwrap" for simple text. However, this is not working with this label:
str = expression(paste("< 20 ?m phytoplankton ","(cells ? ",mL^-1,")"))
plot(...., ylab = strwrap(str,20),...)
I suspect this is because I'm using "expression" for form my label....
2005 Apr 14
3
Wrapping long labels in barplot(2)
...some cases rather long, so that I would like to wrap/split them at a
space once they exceed, say, 20 characters. What I'm doing now is
specifying names.arg manually with '\n' where I want the breaks, but I
would like to automate the process.
I've looked for a solution using 'strwrap', but am not sure how to apply
it in this situation.
Jan Smit
Consultant
Economic and Social Commission for Asia and the Pacific
2005 Apr 15
2
abbreviate or wrap dimname labels
...ual Lower manual
Farm
"Upprnnmn" "Lwrnnmnl" "Uppermnl" "Lowermnl"
"Farm"
In a related thread, Marc Schwartz proposed a solution for wrapping
labels, based on
>short.labels <- sapply(labels, function(x) paste(strwrap(x,
10), collapse = "\n"), USE.NAMES = FALSE)
But, my attempt to use strwrap in my context gives a single string
for each set of dimension names:
> stack.lab <-function(x) { paste(strwrap(x,10), collapse = "\n") }
> lapply(lab, stack.lab)
$O...
2018 Sep 18
2
Suggested Patch: Adding commas to list of packages after R CMD check
...'
for details.
```
svn diff:
Index: src/library/tools/R/QC.R
===================================================================
--- src/library/tools/R/QC.R (revision 75322)
+++ src/library/tools/R/QC.R (working copy)
@@ -8536,13 +8536,13 @@
.pretty_format <-
function(x)
{
- strwrap(paste(sQuote(x), collapse = " "),
+ strwrap(paste(sQuote(x), collapse = ", "),
indent = 2L, exdent = 2L)
}
.pretty_format2 <-
function(msg, x)
{
- xx <- strwrap(paste(sQuote(x), collapse = " "), exdent = 2L)
+ xx <- strwrap(paste(sQuo...
2012 Nov 28
0
str(..., strict.width="wrap") changes alignment of colons
Hi,
This was surprising to me and does not appear to be documented in
?str. After reading ?strwrap, I see that the problem is that
"Whitespace ... in the input is destroyed". However, I thought I'd
mention it because I'm not sure it is intended behavior for str().
I have a list, and the names of the list have a variable number of characters.
> x <- list(A=1:10, ABCDEF=...
2009 Oct 19
1
How do I wrap a long mixed text/math expression in an axis label?
I would like to wrap a y-axis label onto two lines. My label is an expression
containing both text and math symbols. I have looked at plotmath,
strsplit(), strwrap(), deparse(), do.call(), substitute() and bquote().
Based on previous posts, I can get plain text to wrap. However, when I try
these methods on my label, the exact string is returned, rather than
evaluating the math symbols.
My starting point:
x<-c(1:10)
y<-seq(5,50,5)
par(mar=c(6,6,6,1),ce...
2003 Dec 09
1
documentation fixes (cvs) (PR#5632)
....
+ therefore in \R \code{.Random.seed[-1]} can be negative, due to
+ the coercion of an unsigned integer into a signed integer.
\code{RNGkind} returns a two-element character vector of the RNG and
normal kinds in use \emph{before} the call, invisibly if either
Index: src/library/base/man/strwrap.Rd
===================================================================
RCS file: /cvs/R/src/library/base/man/strwrap.Rd,v
retrieving revision 1.2
diff -u -r1.2 strwrap.Rd
--- src/library/base/man/strwrap.Rd 2003/07/08 00:20:19 1.2
+++ src/library/base/man/strwrap.Rd 2003/12/09 14:37:14
@@ -30,8 +30...
2018 Sep 18
0
Suggested Patch: Adding commas to list of packages after R CMD check
...src/library/tools/R/QC.R
> ===================================================================
> --- src/library/tools/R/QC.R (revision 75322)
> +++ src/library/tools/R/QC.R (working copy)
> @@ -8536,13 +8536,13 @@
> .pretty_format <-
> function(x)
> {
> - strwrap(paste(sQuote(x), collapse = " "),
> + strwrap(paste(sQuote(x), collapse = ", "),
> indent = 2L, exdent = 2L)
> }
> .pretty_format2 <-
> function(msg, x)
> {
> - xx <- strwrap(paste(sQuote(x), collapse = " "), exden...
2008 Oct 24
1
Automatically adjust text size in plot
...t;"),S1=sample(1:100,5),S2=sample(1:100,5),S3=sample(1:100,5),S4=sample(1:100,5),S5=sample(1:100,5))
Width<-50
Cex<-1.5
par(mfrow=c(nrow(answers)+1,1),mar=c(0,1,1,1))
plot.new()
plot.window(xlim=c(0,1),ylim=c(0,1))
barnames.plot<-do.call("c",lapply(barnames,function(x)paste(strwrap(x,Width),collapse="\n")))
text(barnames.plot,x= (seq.int(0, 1, length.out =
length(barnames)+1)-0.5/length(barnames))[-1],y=0.5,cex=Cex)
for(i in 1:nrow(answers)){
barheight<-rep(0,length(barnames))
barheight[as.numeric(names(subQ.tables[[i]]))]<-subQ.tables[[i]]
barplot(barheight,s...
2012 Apr 27
1
Wrap names.arg text in barplot
Hello!
Does anyone know of a handy way to wrap the names.arg text in a barplot?
I'm creating a bar plot with rather long labels; I can adjust the margins,
but I'd also like to have the text wrap to about 4cm. Thanks!
Kyle H. Ambert
Doctoral Candidate, Bioinformatics
Oregon Health & Science University
ambertk@gmail.com
[[alternative HTML version deleted]]
2005 May 31
2
Barplot2 Title
Hello,
I would like to know if it's possible to modify the name of groups of bar because on my barplot2, I have 5 groups of bars and one of them is called "User Contributes" and when I save the plot "User contributes" is to big so I don't have it on my plot! Is it pssible to put the name vertically!
Thanks!
Sabine
---------------------------------
ils, photos
2009 Aug 20
0
Sweave truncation
...ping and other goodies but I when I
started to investigate it a while ago I somehow came up with a
non-compilable tex file.
I needed help from someone with more latex experience to progress
Duncan
At 10:12 20/08/2009, you wrote:
>Ken
>
>Thanks for your inspiration: This combination of strwrap and writeLines
>seems to "work" in one sense of the word:
>
>
>
># Intro stuff:
>wid <- 50
>option(width=wid)
>hide <- capture.output(example(glm))
>
># The business end:
>writeLines( strwrap( capture.output(summary(glm.D93)), wid))
>
>
>
&...
2005 Jul 26
3
text on some lines
Hi,
I would like to write text on 2 lines for example.
For example, if you have a long sentence and you want to cut it at the 45 caracter and put the continuation underneath!
Is it possible?
Thanks
Sabine
---------------------------------
[[alternative HTML version deleted]]
2012 Aug 07
2
label_wrap_gen question
Hi, all
I am trying to use the label_wrap_gen function in this website.
https://github.com/hadley/ggplot2/wiki/labeller
I tried to make a long name like this
Light and heavy good vehicles (diesel) -\nGVX
f2 = facet_grid(vehicle ~ ., labeller=label_wrap_gen(width=15))
eventually, I got something like this in my label...
*Light and heavy
good vehicles
(diesel) - GVX*
I suppose the
2010 Jul 13
2
Wrap column headers caption
Hi:
Using this dataframe with quite long column headers, how can I wrap the
text so that the columns are narrower. I was trying to use strwrap without
success. Thanks
reportDF <- structure(list(IDDate = c("3/12/2010", "3/13/2010", "3/14/2010",
"3/15/2010"), FirstRunoftheYear = c("33 (119 ? 119)", "n (0 ? 0)", "893 (110 ?
146)",
"140 (111 ? 150)"), Second...
2004 Dec 03
1
How to wrap or split labels on plot
Dear R gurus,
I want to wrap labels that are too long for a plot. I have looked at
strsplit(), substr(), nchar(), and strwrap(). I think it's some
combination but I'm having difficulty trying to figure out the right
combo. I think I need to create some new matrix containing the labels
already split, though I'm not sure if maybe there is a quick and dirty
way to address this without my wandering around the...