similar to: variable values in plotmath expressions

Displaying 20 results from an estimated 20000 matches similar to: "variable values in plotmath expressions"

2007 Nov 15
2
Using plotmath expressions in lattice key text
Folks: delta <- 1:5 I would like to put 5 separate lines of text of the form "10 %+-% delta[i]" into a lattice key legend, where ""%+-%" is the plotmath plus/minus symbol and delta[i] is the ith value of delta. The construct: lapply(delta,function(d)bquote(10%+-%.(d))) appears to produce a list of expressions of the correct form, and, indeed, if I assign the above
2012 Nov 14
2
vectorized plotmath expressions via substitute()
hi all - i've seen versions of this question before, but none seem to get directly at my solving my (probably very simple) issue: i simply want to annotate the tick marks on an axis with (superscripted) 10^x notation, and tried this: axis(1, at = axTicks(1), as.expression(substitute(10^foo, list(foo = axTicks(1)))) thinking the as.expression/substitute would create the appropriate
2004 Apr 14
1
ltext, plotmath, and substitute
I am interested to use plotmath functions within a panel function but am having some problems getting the code right. Within each panel I am plotting the data, fitting a regression line, and would like to print the regression equation. Here is a trivial example of what I'd like to do: # generate simple data tmp.df <- data.frame(id = rep(1:4, each=4), time = rep(1:4, 4), das =
2010 Jun 09
2
combining expressions in mathplot
Is there a cleaner way of combining two expressions. This example works and gives what I want plot(1:10) aa <- expression(alpha==.05) bb <- expression(beta ==.80) aabb <- expression(alpha==.05 ~ ", " ~ beta ==.80) text(5, 10, aa) text(5, 9, bb) text(5, 8, aabb) text(5,1, parse(text=paste(deparse(aa[[1]]), deparse(bb[[1]]), sep="~"))) text(5,2,
2011 Jun 02
2
lattice + plotmath: how to get a variable in bold face?
Dear all, How can I get a bold "1000" in the title? I would like to use a variable (as opposed to putting in "1000" directly). library(lattice) N <- 1000 xyplot(0~0, xlab.top=list(label=as.expression(bquote(bold("foo" ~ .(N) ~ "bar"))), font=2, cex=1.2)) ## => "font=2" is ignored (of course) Cheers, Marius
2011 Feb 25
1
plotmath: how to create a vector of expressions?
Dear expeRts, I would like to use LaTeX-like symbols in keys via plotmath. Below is a minimal example. I get: Error in fun(key = list(x = 0.5, y = 0.8, text = list(list(expression(paste("(", : first component of text must be vector of labels What's wrong? How can I create the required vector (of expressions)? Cheers, Marius library(lattice) val <- matrix(1, nrow = 10, ncol
2008 Apr 02
1
Trouble combining plotmath, bquote, expressions
I'm using R-2.6.2 on Fedora Linux 9. I've been experimenting with plotmath. I wish it were easier to combine expressions in plotmath with values from the R program itself. There are two parameters in the following example, the mean "mymean" and standard deviation "mystd". I am able to use bquote to write elements into the graph title like mu = mymean and R will
2019 Jun 14
4
inappropriate warning in latticeExtra
This is still not repaired in R version 3.6.0 Patched (2019-05-17 r76528) > library(latticeExtra) > a <- xyplot(1 ~ 1) > c(a,a) Warning message: In formals(fun) : argument is not a function Can we have it in R-3.6.1 that Peter just announced? Rich On Mon, Apr 2, 2018 at 4:08 AM Deepayan Sarkar <deepayan.sarkar at gmail.com> wrote: > > On Fri, Mar 23, 2018 at 7:58 AM,
2019 Dec 06
1
inappropriate warning in latticeExtra
This problem is still present in > version _ platform x86_64-w64-mingw32 arch x86_64 os mingw32 system x86_64, mingw32 status Under development (unstable) major 4 minor 0.0 year 2019 month 12 day 03 svn rev 77513 language R version.string R Under development (unstable)
2012 Aug 15
3
How to join two plotmath type expressions
If I have two variables set, one of which holds an expression, for example: > label <- 'Temperature' > unit <- expression(paste(degree,'C')) how can I join them together for use in mtext (or equivalent)? The following is conceptually what I want to do, but will obviously not work: > plot(0:1) > mtext(paste(label,unit)) Preferably, I would like this to work
2008 Dec 31
3
Plotmath with values?
I hope to use the plotmath facility to print titles that mix math and values of R variables. The help for "plotmath" has an example, which after repeated reading, I find baffling. Likewise, I have read the help file for "substitute" (wqhich seems to be needed) without ever understanding what it does, other than being used in some magic incantations. I would like to do
2012 May 19
1
Names of Greek letters stored as character strings; plotmath.
I had such good luck with my previous question to r-help, (a few minutes ago) that I thought I would try again with the following query: > Suppose I have > > xNm <- "gamma" > > I would like to be able to do > > plot(1:10,xlab = <something involving xNm">) > > and get the x axis label to be the Greek letter gamma > (rather than the
2012 Oct 05
1
Format of numbers in plotmath expressions.
I want to do something like: TH <- sprintf("%1.1f",c(0.3,0.5,0.7,0.9,1)) plot(1:10) legend("bottomright",pch=1:5,legend=parse(text=paste("theta ==",TH))) Notice that the final "1" comes out in the legend as just plain "1" and NOT as "1.0" although TH is [1] "0.3" "0.5" "0.7" "0.9"
2018 Jan 15
2
consolidate three function into one
Hi Richard, Thank you so much!! I understand the problem now, I assign a name to the "ggsurvplot" object and then add print(fig) at bottom of function definition, now figure gets printed on screen. Ding # function to generate RFS curves RFS <- function( inputfile, N ) { cluster<- survfit(Surv(RFS_days2, OV_Had_a_Recurrence_CODE) ~ clusters, data =
2011 Jun 02
2
plotmath: paste string and expression [from a vector of expressions]
Dear all, I have a vector of expressions and would like to "paste" some string to it before using it in a plot: vars <- vector("expression", 2) vars[1] <- expression(alpha) vars[2] <- expression(beta) plot(0, 0, main=substitute(bold("Foo" ~~ VAR), list(VAR=vars[2]) )) Although I tried hard, I just can't figure out how to solve this. The title should be
2006 Mar 06
3
how to make plotmath expression work together with paste
Recent questions about using plotmath have renewed my interest in this question I want to have expressions take values of variables from the environment. I am able to use expressions, and I am able to use paste to put text and values of variables into plots. But the two things just won't work together. Here is some example code that shows what I mean. plot(NA,xlim=c(0,100),ylim=c(0,100))
2009 Jun 03
1
Would like to add this to example for plotmath. Can you help?
Greetings: I would like comments on this example and after fixing it up, I need help from someone who has access to insert this in R's help page for plotmath. I uploaded a drawing http://pj.freefaculty.org/R/Normal-2009.pdf that is created by the following code http://pj.freefaculty.org/R/Normal1_2009_plotmathExample.R This will be a good addition to the plotmath help page/example.
2018 Jan 15
0
consolidate three function into one
That is certainly OK, but you can also just use print(ggsurvplot(...)) as your final statement. out <- RFS( ...) would then return the ggsurvplot object *and* graph it. Any good R tutorial or a web search will provide more details on function returns, which you might find useful. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and
2005 Apr 22
1
Expression in panel.text
Hi, I've got a lattice xyplot and I want to superimpose correlation coefficients and p values on each panel. I've been trying to get this to work using something of the form: x <- rnorm(400) y <- rnorm(400) a <- gl(4, 100) xyplot(y~x | a, panel=function(x,y, ...){ panel.xyplot(x,y, ...) curr.cor <- cor.test(x,y) crho <- round(curr.cor$estimate,2)
2006 Mar 30
2
custom strip in lattice ignoring plotmath expressions for all but style = 1 (PR#8733)
Full_Name: Ben Tyner Version: 2.2.0 OS: i686-pc-linux-gnu Submission from: (NULL) (128.210.141.240) My appologies if this has already been fixed, but I didn't see it in the tracking system yet so I thought I'd report it. Demonstration: xyplot(Petal.Length ~ Petal.Width | Species, iris, strip = strip.custom(style = 1, var.name = expression(beta),