Re: [R] expression in lattice panel strip

2025-03-03 Thread Naresh Gurbuxani
Thanks all for your responses. My problem is solved. Sent from my iPhone On Mar 3, 2025, at 1:08 AM, Deepayan Sarkar wrote:  This is possible but a little cumbersome. Bert is on the right track with strip.custom: xyplot(ts(cbind(x1 = cs, x2 = cs + w)), strip = strip.custom(factor.lev

Re: [R] expression in lattice panel strip

2025-03-02 Thread Deepayan Sarkar
This is possible but a little cumbersome. Bert is on the right track with strip.custom: xyplot(ts(cbind(x1 = cs, x2 = cs + w)), strip = strip.custom(factor.levels = expression(2 * cos(2 * pi * t / 50 + 0.6 * pi), 2 *

Re: [R] expression in lattice panel strip

2025-03-02 Thread Bert Gunter
Full disclosure: I have never plotted time series using this xyplot method. However, ?xyplot.ts says: "screens factor (or coerced to factor) whose levels specify which panel each series is to be plotted in. screens = c(1, 2, 1) would plot series 1, 2 and 3 in panels 1, 2 and 1. May also be a nam

Re: [R] expression input to a function

2016-05-04 Thread Duncan Murdoch
On 04/05/2016 7:11 AM, Naresh Gurbuxani wrote: I am trying to write a function, which can be made very general if one of the inputs can be an expression. How can this be done? For example, to find root of a function, I would like to say my.func <- function(x) {x^3 + 2 * (x^2) - 7} x.left <-

Re: [R] expression evaluation during recursion

2015-10-22 Thread david . kaethner
> You seem to have ignored my explanation. True, sorry. Thanks for sticking with me. Making sense now. > > Duncan Murdoch > >> >> >>> Am 22.10.2015 um 19:05 schrieb Duncan Murdoch >> >: >>> >>> On 22/10/2015 10:20 AM,david.kaeth...@gmail.com >>>

Re: [R] expression evaluation during recursion

2015-10-22 Thread Duncan Murdoch
On 22/10/2015 2:44 PM, david.kaeth...@gmail.com wrote: Hi, I’m sure there’s a ton I don’t understand about environments, but I’m afraid your answer doesn’t make sense to me. If it’s on the search path, the „print(env)“ should yield something like: You never get to the search list. attr(,

Re: [R] expression evaluation during recursion

2015-10-22 Thread david . kaethner
Hi, I’m sure there’s a ton I don’t understand about environments, but I’m afraid your answer doesn’t make sense to me. If it’s on the search path, the „print(env)“ should yield something like: attr(,"name") [1] "package:pryr" attr(,"path") [1] "/Library/Frameworks/R.framework/Versions/3.2/Res

Re: [R] expression evaluation during recursion

2015-10-22 Thread Duncan Murdoch
On 22/10/2015 10:20 AM, david.kaeth...@gmail.com wrote: > Hello, > > I’m trying to solve an exercise, where I want to walk through the search path > recursively (http://adv-r.had.co.nz/Environments.html > ). > > I’m puzzled by a certain behavior and ho

Re: [R] expression in xlab for a plot

2014-01-01 Thread arun
HI, Another way would be to use ?substitute() hist(runif(1000,0,100),xlab=substitute(expression(AUC[low - high]~ (xyz)),list(low=low,high=high)),ylab="Frequency") A.K. On Wednesday, January 1, 2014 10:36 AM, arun wrote: Hi,May be this helps:   hist(runif(1000,0,100),xlab=bquote(AUC[.(low) -

Re: [R] expression in xlab for a plot

2014-01-01 Thread arun
Hi,May be this helps:   hist(runif(1000,0,100),xlab=bquote(AUC[.(low) - .(high)]~ (xyz)),ylab="Frequency") A.K. On Wednesday, January 1, 2014 10:30 AM, Andras Farkas wrote: Dear All, Happy new year! wonder if you could help with the following: we have: hist(runif(1000,0,100),xlab=express

Re: [R] Expression evaluation of Plotting labels containing spaces

2013-06-04 Thread Pascal Oettli
Hello, ?plotmath -> See Also demo(plotmath) Regards, Pascal On 05/06/13 15:00, Santosh wrote: Thanks so much!! Would be it be better if in vignette of plotmath, x %~% y and x~~y; likewise, other operations (.e.g., x %*% y, x * y) may be grouped, so that are not missed by a layman like me! -

Re: [R] Expression evaluation of Plotting labels containing spaces

2013-06-04 Thread Santosh
Thanks so much!! Would be it be better if in vignette of plotmath, x %~% y and x~~y; likewise, other operations (.e.g., x %*% y, x * y) may be grouped, so that are not missed by a layman like me! - just a thought... Thanks, Santosh On Tue, Jun 4, 2013 at 9:13 PM, David Winsemius wrote: > > O

Re: [R] Expression evaluation of Plotting labels containing spaces

2013-06-04 Thread David Winsemius
On Jun 4, 2013, at 8:39 PM, Santosh wrote: Dear Rxperts, How do I overcome the anomaly as in the second case of examples below? exc <- list(units=list( c(m^2)) ,vars= list(c('asb')), ,label= list(c('abs surf body'))) plot(1:10,1:10, ylab=parse(text= paste(exc$vars[1],' (',exc$units[1],')',

Re: [R] Expression evaluation of Plotting labels containing spaces

2013-06-04 Thread Pascal Oettli
Hi, On possibility is: par(mfrow=c(2,1), mar=c(5.1,5.1,4.1,2.1)) plot(1,1, ylab=expression(a.s.b.~(m^2))) plot(1,1, ylab=expression(abs~surf~body~(m^2))) Regards, Pascal On 05/06/13 11:39, Santosh wrote: Dear Rxperts, How do I overcome the anomaly as in the second case of examples below? exc

Re: [R] Expression evaluation of Plotting labels containing spaces

2013-06-04 Thread Pascal Oettli
Hello, Example not reproducible: > exc <- list(units=list( c(m^2)) ,vars= list(c('asb')), ,label= list(c('abs surf body'))) Error: object 'm' not found Regards, Pascal On 05/06/13 11:39, Santosh wrote: Dear Rxperts, How do I overcome the anomaly as in the second case of examples below? e

Re: [R] expression

2013-04-01 Thread Peter Ehlers
On 2013-04-01 12:46, Jose Narillos de Santos wrote: Hi all, I´m using titt<- expression(paste("R con ventanas de 200 ", italic(datos))) And it works properly on a plot(...,main=titt,..) But if I want to add an improvement to avoid typing n on the plot so that n<-200 titt<- expression(paste

Re: [R] expression

2013-04-01 Thread William Dunlap
Use bquote(), as in n <- 200 titt <- bquote(paste("R con ventanas de ", .(n), " ", italic(datos))) or, using ~ instead of paste(), titt <- bquote("R con ventanas de " ~ .(n) ~ italic(datos)) plot(1, 1, main=titt) The notation .(xxx) means to replace xxx by the value of the variable called

Re: [R] expression

2013-04-01 Thread Bert Gunter
?plotmath tells you how. -- Bert On Mon, Apr 1, 2013 at 12:46 PM, Jose Narillos de Santos wrote: > Hi all, > > I惴 using > > > titt<- expression(paste("R con ventanas de 200 ", italic(datos))) > > And it works properly on a plot(...,main=titt,..) > > But if I want to add an improvement to avoid

Re: [R] expression exponent labeling

2013-03-13 Thread Peter Ehlers
On 2013-03-13 06:37, Gerrit Eichner wrote: Hi, Berry, I think for(i in -8:-3) axis(1, i, substitute(10^j, list( j = i))) achieves what you want. Regards -- Gerrit Here's another (really no different) solution: for(i in -8:-3) axis(1, i, bquote(10^.(i))) For more flexibility, if you

Re: [R] expression exponent labeling

2013-03-13 Thread Gerrit Eichner
Hi, Berry, I think for(i in -8:-3) axis(1, i, substitute(10^j, list( j = i))) achieves what you want. Regards -- Gerrit On Wed, 13 Mar 2013, Berry Boessenkool wrote: Hi all, I want to label an axis with exponents, but can't get it done with expression. Any hints would be very welcom

Re: [R] Expression in legend of plot

2012-10-25 Thread stat.kk
So easy solution..., thank you very much :) -- View this message in context: http://r.789695.n4.nabble.com/Expression-in-legend-of-plot-tp4647393p4647397.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing li

Re: [R] Expression in legend of plot

2012-10-25 Thread Bert Gunter
... and note that the "{" ,"}" are unnecessary: > plot(1, main = bquote(f^-1*(x))) -- Bert On Thu, Oct 25, 2012 at 4:32 AM, Rui Barradas wrote: > Hello, > > Use an asterisk to put a space between the exponent an (x). > > plot(1, main = expression(f^{-1}*(x))) > > Hope this helps, > > Rui Barr

Re: [R] Expression in legend of plot

2012-10-25 Thread Rui Barradas
Hello, Use an asterisk to put a space between the exponent an (x). plot(1, main = expression(f^{-1}*(x))) Hope this helps, Rui Barradas Em 25-10-2012 12:21, stat.kk escreveu: I would like to have an expression f^(-1)(x) in a legend of plot. For this I used expression(f^{-1}(x)), but variabl

Re: [R] expression() and font.lab ?

2012-04-27 Thread Hermes
Thank you David. Regards, Aparna On 27 Apr 2012, at 22:44, David Winsemius wrote: > converted formated text to plain text. > On Apr 27, 2012, at 3:52 PM, Aparna Radhakrishnan wrote: > >> Hi...sorry that my question seemed incomplete. >> >> The plotting code : >> par >> (cex >> .axis >> = >>

Re: [R] expression() and font.lab ?

2012-04-27 Thread David Winsemius
converted formated text to plain text. On Apr 27, 2012, at 3:52 PM, Aparna Radhakrishnan wrote: Hi...sorry that my question seemed incomplete. The plotting code : par (cex .axis = 0.8,las=1,font.lab=2,font.axis=2,family="sans",mgp=c(2,1,0),mar=c(3, 3, 4, 2)+0.1) plot(A$pos,-log(A$GPVI_frequen

Re: [R] expression() and font.lab ?

2012-04-27 Thread Aparna Radhakrishnan
Hi...sorry that my question seemed incomplete. The plotting code : par(cex.axis=0.8,las=1,font.lab=2,font.axis=2,family="sans",mgp=c(2,1,0),mar=c(3, 3, 4, 2)+0.1) plot(A$pos,-log(A$GPVI_frequentist_add_Batch_expected_pvalue,10),col=A$R2class,pch=A$pch,xlim=c(161160087,161214038),ylim=c(0,7),xlab=

Re: [R] expression() and font.lab ?

2012-04-27 Thread David Winsemius
On Apr 27, 2012, at 11:22 AM, aparna15 wrote: Hi.. I managed to use expression() for superscripting and subscripting values in my axis labels. What's missing here is your plotting code and your machine and R installation details. You may want to review the Posting Guide for what is re

Re: [R] expression set (Bioconductor) problem

2011-10-09 Thread Juliet Hannah
Note that exprs returns a matrix, so we can manipulate that just as we would for any other type of matrix. There is also a Bioconductor mailing list, which may be helpful. On Thu, Oct 6, 2011 at 4:56 AM, Clayton K Collings wrote: > Hello R people, > >>dim(exprs(estrogenrma) > > I have an expressi

Re: [R] Expression: +/-sigma

2011-07-27 Thread David Winsemius
On Jul 27, 2011, at 8:57 AM, ogbos okike wrote: Dear List, I am trying to label a plot with the symbol +/- sigma. Using something like - expression (2*sigma) gives me the symbol 2ó. However, adding +/- to it beats me. The code I am using is: plot(x,y,type="l",main=" expression(paste("±"

Re: [R] Expression: +/-sigma

2011-07-27 Thread Yves REECHT
Hi, You may try something like: plot(rnorm(10), rnorm(10), main=expression("" %+-% 2*sigma)) HTH, Yves Le 27/07/2011 14:57, ogbos okike a écrit : > Dear List, > I am trying to label a plot with the symbol +/- sigma. Using something like > - expression (2*sigma) gives me the symbol 2ó. How

Re: [R] expression() and axis labels

2011-07-16 Thread Uwe Ligges
On 16.07.2011 20:01, Thomthom wrote: Thanks everyone! This is exactly what I needed! My graphs look perfect now thanks to you guys! :) Thanks so much! I've spent hours on this... Last question though: do I need to edit my post and signal it as a "solved" topic (I saw that on other forums...

Re: [R] expression() and axis labels

2011-07-16 Thread Thomthom
Thanks everyone! This is exactly what I needed! My graphs look perfect now thanks to you guys! :) Thanks so much! I've spent hours on this... Last question though: do I need to edit my post and signal it as a "solved" topic (I saw that on other forums... and I have to admit I am not really famil

Re: [R] expression() and axis labels

2011-07-16 Thread Uwe Ligges
On 16.07.2011 19:10, David Winsemius wrote: On Jul 16, 2011, at 12:09 PM, Thomthom wrote: Hi everyone! I tried to look up in the previous topics whether there was something similar to my question but I think there's nothing corresponding... Anyway! Here is my problem: I have a plot (qplot

Re: [R] expression() and axis labels

2011-07-16 Thread Joshua Wiley
On Sat, Jul 16, 2011 at 10:10 AM, David Winsemius wrote: > > On Jul 16, 2011, at 12:09 PM, Thomthom wrote: > >> Hi everyone! >> >> I tried to look up in the previous topics whether there was something >> similar to my question but I think there's nothing corresponding... >> >> Anyway! Here is my p

Re: [R] expression() and axis labels

2011-07-16 Thread David Winsemius
On Jul 16, 2011, at 12:09 PM, Thomthom wrote: Hi everyone! I tried to look up in the previous topics whether there was something similar to my question but I think there's nothing corresponding... Anyway! Here is my problem: I have a plot (qplot()) in which I want to insert axis labels with

Re: [R] expression help

2011-03-01 Thread Dennis Murphy
Hi: 1. expression() in plotmath ignores control characters such as \n. 2. The workaround, discussed a couple of times on this list (hence in the archives), is to use the atop function, so try something like plot(0:1,0:1,xaxt="n") axis(side=1,at=.3,expression(paste("IFN-", gamma, "\n", "TNF-", alp

Re: [R] expression for index of pairwise combinations

2011-02-09 Thread Pete Brecknock
If I have understood correctly, then as an example for 4 columns how about d=data.frame(C1=c(1,1,1,1,1),C2=c(2,2,2,2,2),C3=c(3,3,3,3,3),C4=c(4,4,4,4,4)) combs=combn(paste("C",seq_len(4),sep=""),2,simplify=FALSE) one = sapply(combs,function(x) d[x[1]]) two = sapply(combs,function(x) d[x[2

Re: [R] expression() problem !

2010-10-11 Thread David Winsemius
On Oct 11, 2010, at 7:27 PM, michel.mas wrote: Hello everyone ... I have a problem when I try to mix expressions using the function expression () with variables coming from my code. Has anyone faced such a problem? Many times: ?bquote # instead of expression -- View this message i

Re: [R] expression() and plot title

2010-08-28 Thread David Winsemius
On Aug 28, 2010, at 4:48 PM, Sancar Adali wrote: My function is like this sim.res<-gaussian_simulation(p=3, r=4, q=3, c=0.1,d=2, Wchoice = "avg", pre.scaling = TRUE, oos = TRUE, alpha = NULL, n = 100, m = 100, nmc = 100) which is defined as gaussian_simulation <- function(p,

Re: [R] expression() and plot title

2010-08-28 Thread Sancar Adali
My function is like this sim.res<-gaussian_simulation(p=3, r=4, q=3, c=0.1,d=2, Wchoice = "avg", pre.scaling = TRUE, oos = TRUE, alpha = NULL, n = 100, m = 100, nmc = 100) which is defined as gaussian_simulation <- function(p, r, q, c, d

Re: [R] expression() and plot title

2010-08-27 Thread Cheng Peng
Try this: > LinePlot(1,1) > LinePlot=function(a,b){ + # a = slope + # b = y intercept + x=seq(-10,10,0.4) + y=a*x+b + plot(x,y, type="l") + title(paste("a=",a,"b=",b)) + } > > #test > LinePlot(a=-2,b=9) HTH -- View this message in context: http://r.789695.n4.nabble.com/expression-and-plot-t

Re: [R] expression() and plot title

2010-08-27 Thread Bill.Venables
Here is a suggestion you may care to develop func <- function(a, b) { plot(1:10) title(main = bquote(a == .(a)*','~ b == .(b))) invisible() } try with func(1,2) func(36, 2^10) &c -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-proj

Re: [R] expression() and plot title

2010-08-27 Thread David Winsemius
On Aug 28, 2010, at 12:53 AM, Sancar Adali wrote: What I want to do is put the arguments I supply to a function into the title of a plot Say I'm calling func.1 func.1(a=4,b=4) plot(,..., title("a=4, b=4")) If I'm calling func.1 with different arguments, I want the plot title to refl

Re: [R] expression over-plotted

2010-03-26 Thread Chris Campbell
On Fri, Mar 26, 2010 at 16:05, Brad Eck wrote: > >   When I try to add the following annotation to a plot the entries are plotted >   one on top of the other.  I'm trying to get something that looks like " eta >   =  0.2  "  where the Greek letter is used on the plot.  I realize that >   expressio

Re: [R] expression(), mixed symbols and evaluated objects

2010-03-10 Thread Duncan Murdoch
On 10/03/2010 8:52 AM, Markus Loecher wrote: Is it possible to mix symbols and evaluated objects inside the expression() function ? The following example shows what I am trying to achieve: for (m in 1:3) { plot(1:10); #just a place holder for the real plots title(expression(y = m * lambd

Re: [R] expression() help

2010-02-12 Thread Thomas Lumley
On Fri, 12 Feb 2010, Peng Cai wrote: Hi All, I'm trying to use expression() for y-label in plot(). I'm not able to write Average(space)PM(subscript)10. I'm trying: ylab=expression(Average PM[10]) and its not working, because of a space between "Average" and "PM". Thanks, quote("Average PM"[

Re: [R] expression() help

2010-02-12 Thread Henrique Dallazuanna
Try this: expression(Average~PM[10]) On Fri, Feb 12, 2010 at 3:29 PM, Peng Cai wrote: > Hi All, > > I'm trying to use expression() for y-label in plot(). I'm not able to write > Average(space)PM(subscript)10. I'm trying: > > ylab=expression(Average PM[10]) > > and its not working, because of a s

Re: [R] expression()

2009-12-20 Thread baptiste auguie
Hi, try this, ylab = expression(Temperature~(degree*F)) ?plotmath baptiste 2009/12/20 Kim Jung Hwa : > Hi All, > > I'm wondering if its possible to write degree in symbol. > > I would like y-label as "Temperature (degreeF)". where degree should be in > symbols. Thanks in advance, > > #R Code >

Re: [R] expression

2009-09-16 Thread baptiste auguie
Try this, marco2 = matrix(rnorm(4), nrow=2, ncol=2) marco3 = 2.12 i =1 plot.new() mtext(bquote(R^2*.(round(marco2[1,i],digits=3))*" N° of proteins:"*.(marco3[i])),side=4,cex=.6) HTH, baptiste 2009/9/16 Marco Chiapello > /Dear all,/// > /I am very thankful, if you could tell what is the righ

Re: [R] Expression in axis

2008-07-09 Thread S Ellison
>>> Dani Valverde <[EMAIL PROTECTED]> 09/07/2008 10:21:46 >>> >I would like to know how to put this expression to the y axis >µmol/10^6 cells try plot(x,y, ylab=expression(mu*mol^6~cells)) It's in ?plotmath. Steve Ellison *

Re: [R] Expression in axis

2008-07-09 Thread Daniel Malter
Sorry, you want it in the y-axis. So put ylab instead of xlab. Generally, type ?plot in the R-prompt and hit enter. Click the little "par" link in the middle of the page. There you see all the options (or at least very many) that you can pass to your plot command. Best, Da. Daniel Malter wrot

Re: [R] Expression in axis

2008-07-09 Thread Gabor Csardi
E.g. > plot(1:10,1:10,xlab=NA) > title(xlab=expression(mu*"mol"/10^6*" cells")) Gabor On Wed, Jul 09, 2008 at 11:21:46AM +0200, Dani Valverde wrote: > Hello, > I am creating a plot and I would like to know how to put this expression > to the y axis >

Re: [R] Expression in axis

2008-07-09 Thread Daniel Malter
x=rnorm(100,0,10) y=rnorm(100,0,10) plot(y~x,xlab="µmol/10^6") Is that it? Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Dani Valverde Gesendet: Wedn

Re: [R] expression, strsplit, ...

2008-06-26 Thread Bert Gunter
EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of baptiste Auguié Sent: Thursday, June 26, 2008 5:54 AM To: R Help Subject: Re: [R] expression, strsplit, ... OK, thanks to both of you for the clarifications. I guess part of my confusion came from the numerous functions and concepts involv

Re: [R] expression, strsplit, ...

2008-06-26 Thread baptiste Auguié
OK, thanks to both of you for the clarifications. I guess part of my confusion came from the numerous functions and concepts involved in producing such labels: - call vs string vs formula vs expression ... - substitute, bquote, expression, "~", .(), ... I take it as a good thing once you ha

Re: [R] expression, strsplit, ...

2008-06-26 Thread Prof Brian Ripley
On Thu, 26 Jun 2008, baptiste Auguié wrote: On 25 Jun 2008, at 19:45, Gabor Grothendieck wrote: Try this: plot(1, xlab = ~ alpha / V * m^-3 * kg ^-2 * l^4) Thanks, I would never have expected this code to work, this is a mystery to me! Actually, I thought xlab wanted an expression, but

Re: [R] expression, strsplit, ...

2008-06-26 Thread Gabor Grothendieck
bquote is used like this: alpha <- 5 xlab <- bquote(.(alpha) / V * m^-3 * kg ^-2 * l^4) plot(1, xlab = xlab) On Thu, Jun 26, 2008 at 4:21 AM, baptiste Auguié <[EMAIL PROTECTED]> wrote: > > On 25 Jun 2008, at 19:45, Gabor Grothendieck wrote: > >> Try this: >> >> plot(1, xlab = ~ alpha / V * m^-3

Re: [R] expression, strsplit, ...

2008-06-26 Thread baptiste Auguié
On 25 Jun 2008, at 19:45, Gabor Grothendieck wrote: Try this: plot(1, xlab = ~ alpha / V * m^-3 * kg ^-2 * l^4) Thanks, I would never have expected this code to work, this is a mystery to me! Actually, I thought xlab wanted an expression, but it seems to be happy with a formula. Also,

Re: [R] expression, strsplit, ...

2008-06-25 Thread Gabor Grothendieck
Try this: plot(1, xlab = ~ alpha / V * m^-3 * kg ^-2 * l^4) On Wed, Jun 25, 2008 at 1:06 PM, baptiste Auguié <[EMAIL PROTECTED]> wrote: > DeaR list, > > I'm a bit lost in the behavior of substitute and co. > I often use fairly long axis labels in my graphs (long to write, that is). > Typically,

Re: [R] expression matrix

2008-03-10 Thread Jabez Wilson
>Date: Sat, 8 Mar 2008 04:56:58 -0800 (PST) >From: Keizer_71 <[EMAIL PROTECTED]> >Subject: [R] expression matrix >To: r-help@r-project.org >Message-ID: <[EMAIL PROTECTED]> >Content-Type: text/plain; charset=us-ascii >Hello, >I am to run this R script but i keep getting this error. >> expr<-expr

Re: [R] expression matrix

2008-03-08 Thread Martin Morgan
Christophe -- You'll want to coerce golubMerge to an ExpressionSet. > library(Biobase) > library(golubEsets) > data(golubMerge) > golubUpdated <- as(golubMerge, "ExpressionSet") Warning messages: 1: In asMethod(object) : missing or mis-shaped 'se.exprs' in original object; creating ExpressionSet

Re: [R] expression matrix

2008-03-08 Thread Douglas Bates
On Sat, Mar 8, 2008 at 7:00 AM, Keizer_71 <[EMAIL PROTECTED]> wrote: > Hello, > I am to run this R script but i keep getting this error. > > expr<-exprs(golubMerge) > Warning message: > The exprSet class is deprecated, use ExpressionSet instead > I tried to find information on the website