similar to: Format of numbers in plotmath expressions.

Displaying 20 results from an estimated 10000 matches similar to: "Format of numbers in plotmath expressions."

2010 Feb 02
2
mysterious extra spaces appearing in expression paste
Hi, i'm trying to put a legend on some figures and they're coming out a bit wonky. here's an example: a <- c(1:10) par(mfrow=c(2,1)) plot(a,type="s",lwd=3) leg <- c(expression(paste("data1 (",rho,"=1)")), expression(paste("data2 (",rho,"=0.0)"))) legend("bottomright",legend=leg,col=c(1,2),lwd=3)
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 23
3
Intercepts in linear models.
A colleague asked me if there is a way to specify with a ***variable*** (say ``cflag'') whether there is an intercept in a linear model. She had in mind something like lm(y ~ x - cflag) where cflag could be 0 or 1; if it's 0 an intercept should be fitted, if it's 1 then no intercept. This doesn't work ``of course''. The cflag just gets treated as another predictor
2007 Oct 03
3
Factor levels.
I have factors with levels ``Unit", "Achieved", and "Scholarship"; I wish to replace these with "U", "A", and "S". So I do fff <- factor(fff,labels=c("U","A","S")) This works as long as all of the levels are actually present in the factor. But if ``Scholarship'' is absent (as if often is) then
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))
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 Mar 30
1
avoiding expression evaluation when calling a function
Another question on functions - I have something that looks like plotter<-function(i){ temp.i<-rwb[rwb$vector1 <=(i*.10),] with(temp.i, plot(vector2, vector3, main=(i*.10),)) mod<-lm(vector3~vector3-1,data=temp.i) r2<-summary(mod)$adj.r.squared rsqrd[i]<-r2 legend("bottomright", legend=signif(r2), col="black") abline(mod) rsqrd<<-rsqrd } I'd
2006 Mar 10
2
Plot.date and legends
Hi: I'm trying to plot dates on the x-axis of a code, but the legend is not being displayed. I receive the following error: Error in match.arg(x, c("bottomright", "bottom", "bottomleft", "left", : 'arg' should be one of bottomright, bottom, bottomleft, left, topleft, top, topright, right, center In addition: Warning message: longer
2008 Feb 20
2
Data frame with 0 rows.
For reasons best known only to myself ( :-) ) I wish to create a data frame with 0 rows and 9 columns. The best I've been able to come up with is: junk <- as.data.frame(matrix(0,nrow=0,ncol=9)) Is there a sexier way? cheers, Rolf ###################################################################### Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
2012 Apr 01
1
indexing in a function doesn't work?
Hello, I've written a small function that's supposed to save me some time, and it's ending up killing it- the intention is to iteratively subset a dataset fram on framevec, fit a model (either lm or nls depending on type) and return the r2 or AIC from the model, respectively. Although as far as I can tell in my code the plots are dependent on the fit of the model to the data and the
2011 Jul 25
1
Creating png of layered legend
I am trying to create a plot that has multiple plot characters for each point (e.g. a point within a triangle, a triangle within a square, etc). The workaround I have found to do this is by plotting twice, as in this example: x <- c(1.1, 2.3, 4.6) y <- c(2.0, 1.6, 3.2) plot(x, y) points(x,y, pch=20, col="red", cex=0.5) This works, but perhaps there is a better way to do it in one
2006 Feb 09
7
putting text in the corner
I want to write some text in a corner of my plot. Is it possible to get the xlim and ylim of an open window? Or is there anything similar like legend(x="bottomright", inset=0.01,legend=...) for text(x=1,y=2, "test") Thomas
2004 Oct 23
1
Legend/Substitute/Plotmath problem
Hello, I seem unable to construct a legend which contains a substitution as well as math symbols. I'm trying to do the following: strain2 <- "YJG48" legend.txt <- c( substitute( strain * %==% * "YJG45, rpn10" * %Delta%, list(strain=strain2) ), "Verhulst/Logistic", "Malthus" ) legend( 100,2.5, legend.txt, cex=0.75,
2012 Jun 08
2
changing font to italic for one entry in legend()
Hello, I need to change the font for one of the items (C. elegans) in my legend to italic. Can someone suggest how to accomplish this? legend('bottomright', bty='n', c('C. elegans range', 'Study area'), cex=0.8, fill=c('light gray', 'white'), border=c('black','black')) I tried using lab.font=c(1,3) but R ignored and did not write
2016 Oct 26
2
borrar texto en una gráfica
Hola a todos, Os envío una consulta que considero sencilla pero me está resultando imposible de resolver. Si ejecutáis el siguiente código, obtendréis la gráfica que os adjunto: library(ltm) modelo <- rasch(LSAT) plot(modelo, main="Curva probabilidad pregunta 1",legend = TRUE, cx = "bottomright", items=1,xlab="Conocimiento",ylab="Probabilidad") Resulta
2008 Jul 15
1
manipulating (extracting) data from distance matrices
Hi all, Does anyone have any tips for extracting chunks of data from a distance matrix? For instance, if one was interested in only a subset of distance comparisons (i.e., that of rows 4 thru 6, and no others), is there a simple way to pull that data out? >From some playing around with an example (below), I've been able to figure out that a distance matrix in R is stored as a single
2013 Jun 07
1
cannot update battery.date value of APC ups battery
Hi, I'm running this command: # upsrw -s "battery.date=2013Jun7" -u ups-mon-IT "IT-APC-BOTTOMRIGHT at 127.0.0.1" Password: OK but I'm getting this listing: # upsc IT-APC-BOTTOMRIGHT at 127.0.0.1 battery.alarm.threshold: 0 battery.charge: 100.0 battery.charge.restart: 15 battery.date: 01/10/06 battery.packs: 000 battery.runtime: 1440 battery.runtime.low: 120
2006 Jun 23
2
Generate Models & Controllers from Ruby program
Hi All. I would like to create a model, database, and controller (if possible) from a webapp. Each model and controller will each have 4 methods, and the database will always have the same number of fields. I will probably create the database through create_table or a direct SQL command. My question is this - is there a method that I can call to create the model and controllers? Would it
2010 Oct 22
2
Random Forest AUC
Guys, I used Random Forest with a couple of data sets I had to predict for binary response. In all the cases, the AUC of the training set is coming to be 1. Is this always the case with random forests? Can someone please clarify this? I have given a simple example, first using logistic regression and then using random forests to explain the problem. AUC of the random forest is coming out to be
2008 Aug 01
1
Properly Parsing Pre-Superscripts & Displaying Them With grid.text
Hi all... I?m making a chart dealing with frequencies of isotopes of various elements. For instance, I'd like the following text to appear on a chart with the "35" and "37" as superscripts: Based upon: 35Cl: 75% 37Cl: 25% I am having problems properly parsing the superscript that preceeds the "Cl", since there is no character ahead of the superscript (I saw