similar to: Adding data to existing plot with new=TRUE does not appear to work

Displaying 20 results from an estimated 10000 matches similar to: "Adding data to existing plot with new=TRUE does not appear to work"

2004 Jun 16
1
subset(..., drop=TRUE) doesn't seem to work.
Hello! If I read ?subset, the workings of the argument drop (to me) seem to imply equivalence of A and B (R 1.9.0): #A dd <- data.frame(rt=rnorm(10), c=factor(gl(2,5))) dd <- subset(dd, c==1) dd$c <- dd$c[, drop=TRUE] table(dd$c) 1 5 #B dd <- data.frame(rt=rnorm(10), c=factor(gl(2,5))) dd <- subset(dd, c==1, drop=TRUE) table(dd$c) 1 2 5 0 So to lose the second level of
2003 May 28
1
Numbers that look equal, should be equal, but if() doesn't see as equal (repost with code included)
Hi! Apologies for sending the mail without any code. Apparently somewhere along the way the .R attachments got filtered out. I have included the code below as clean as possible. My original mail is below the code. Thank you again for your time. regards, Paul vincentize <- function(data, bins) { if ( length(data) < 2 ) { stop("The data is really short. Is that ok?"); }
2004 Feb 24
1
Accessing columns in data.frame using formula
Hello! I'm trying the hard way to use a formula, in a function, to specify the names of several important columns in a data.frame. Maybe I'm just battling to figure out the right search terms :-( This is on XP, R 1.8.1. So, for instance, wery[1:5,] V1 V2 V3 V4 V5 congr V7 V8 V9 ok RT 1 1 1 960 520 1483 c 1 r r 1 760 2 1 2 1060 450 3753 c 1 r r 1 555
2008 Mar 27
1
Dynamic string as element name in a list
Dear all, I have a piece of code along the lines of f <- function(x) { clipname <- "LK" # but is in real determined based on info in data.frame x # other manipulations return( list(clipname=list(....))) } My intention is to do out <- f(dat) and then (in this example) having/getting out$LK which is a list in itself. Of course, it doesn't work like this, but
2010 Jan 18
3
add spline to longitudinal data - preferably similar to SAS's 'I=SM50S' routine
Hi Ruser I'm trying to replicate some SAS code. I have to add a spline to my longitudinal spaghetti plot. I have the plot, but I can't add the spline, a overall trend line. In the SAS code they use the command 'I=SM50S' and I would prefer something similar. I?m using R 2.10.1 on windows XP? I have made this working example. tolerance.pp <-
2008 May 22
1
plot 7 * 3 matrix on DIN A4 pdf
Hello, I want to plot 21 scatter plots in a 7*3 matrix on a single A4 page (using mfcol). Below is an example, which -by and large- looks very close to the desired result. But I do not get it to fill out the whole page. If I specify the a different page size, the plots still do not fill out the whole page. Anybody an idea what to do? Maybe adjusting indvidiual plot size (if so, how?). Or is there
2003 Oct 15
1
is.na(v)<-b (was: Re: Beginner's query - segmentation fault)
I think the thread ended up with several people (not only me) feeling certain they didn't like `is.na<-` but with the developers defending it and me not really understanding why. Uwe Ligges was going to come up with an example of `<- NA` going wrong (sorry Brian R, I mean behaving unexpectedly), but never did, and I think the problem has been fixed. It was apparently a problem with
2008 Jul 21
2
Getting plot axes where they should be!
Hi Folks, I've been digging for the solution to this for several hours now. If there is a solution, it must be one of the worst "needle-in-a-haystack" examples in R documentation! Essentially, I want to make an x-y plot in which the X-axis really is the X-axis (i.e. its vertical position is at y=0), and the Y-axis really is the Y-axis (i.e. its horizontal position is at x=0).
2011 Sep 30
2
Overlapping plot in lattice
Hi all, I was wondering if there's an equivalent to par(new=T) of the plot function in lattice. I'm plotting an xyplot, and I would like to highlight one point by plotting that one point again using a different symbol. For example, where 6 is highlighted: plot(1:10, xlim=c(0,10), ylim=c(0,10)) par(new=T) plot(6,6, xlim=c(0,10), ylim=c(0,10), pch=16) Is there a way to do this in lattice?
2003 Oct 16
1
Cbind warning message
Hello! I'm not grasping why cbind (in the code below) warns that Warning message: number of rows of result is not a multiple of vector length (arg 2) in: cbind(z, p) when I do sections <- function(length, parts) { p <- 1:parts q <- length %/% parts z <- array(p, dim=c(parts,q)) r <- length %% parts if ( r > 0 ) { p[r+1:length(p)] <- NA z <-
2007 Mar 22
1
Labelling a second y-axis
Hi, I am using the following code as an example function to create multiple y-axes on one plot. I have it working fine however, I can't seem to add a label on the second (right) axis. I have tried adding ylab="y2" in the axis call but, that didn't work; any ideas? Thanks, Jesse Code: function() { par(las=1,xaxs="r",mai=c(1,0.75,1,1)) x<-1:10 y1<-x
2004 Aug 26
1
library(car) Anova() and Error-term in aov()
Dear all, Type III SS time again. This case trying to reproduce some SPSS (type III) data in R for a repeated measures anova with a betwSS factor included. As I understand this list etc, if I want type III then I can do library(car) Anova(lm.obj, type="III") But for the repeated measures anova, I need to include an Error-term in the aov() call (Psychology-guide from Jonathan Baron)
2001 Nov 12
3
histogram question
hist(rbinom(1000,10,0.5),col=2,xlim=c(0,10),ylim=c(0,300)) gives a histogram with "touching bars" hist(rbinom(100000,10,0.5),col=2,xlim=c(0,10),ylim=c(0,30000)) gives a histogram with space between the bars. is there a way to control the space betweent he bars easily? -- Erich Neuwirth, Computer Supported Didactics Working Group Visit our SunSITE at http://sunsite.univie.ac.at
2009 May 26
1
stricter use of xlim in plot.stepfun
Dear R developer, I am not quite sure, if I should post my concern as a wish to r-bugs at r-project.org. Thus, as recommended, I first send an email to you. My request is the following: I would appreciate, if it was possible to obtain a plot of a 'stepfun' with a strict interpretation of xlim. What I mean: sf <- stepfun(1:4, 1:5) plot(sf, xlim=c(0,10)) does not bound the function to
2006 Jul 07
4
How to change the type of segments ends?
Hi, I am trying to plot odds ratios and the corresponding confidence intervals in horizontal segments. It would be ideal if the confidence interval segment can be drawn with little vertical bars at both ends. I have tried very hard to change the type of ends by using 'lend' arguments, but cannot make it. I even tried 'arrows()', but still failed. Following is the code I use:
2002 May 15
3
graphics question
Hi after browsing the documentation and web, I'm completely lost as how to create the graph I describe below (as best as I can). I've got 3 pairs of average response times: (390,396), (416, 421), (406,415). Each of these pairs represents a level of a certain factor (let's call it 'loc'), namely (in the same order), levels "c", "nc" and "ni".
2006 Jun 04
2
slanted ends of horizontal lines for certain line widths
Hello, if I plot a horizontal line, e.g., plot(c(1,2),c(1,1),xlim=c(0,3),lwd=2,type="l") or plot(c(1,2),c(1,1),xlim=c(0,3),lwd=4,type="l") then the left end (1st example) or both ends (2nd example) of the lines are not rectangular but slanted on the graphical display (screen). That behavour first occurred when I was trying to plot a stepfun, e.g., y <-
2008 Jun 21
1
Coloring Stripchart Points, or Better, Lattice Equivalent
Hi All. I have the commands below to create a stripchart/plot. I was hoping to color the points in the plot by yr, and use a symbol that varied with resp. However, the outcome makes it appear as though the point by point col and pch data is not being passed properly. Any suggestions? And truthfully, I?d rather be doing this with Lattice, but I?ve tried several variations of stripplot and can?t
2003 May 27
2
Numbers that look equal, should be equal, but if() doesn't see as equal
Hi! After a lot of testing and debugging I'm falling silent in figuring out what goes wrong in the following. I'm implementing the Vincentizing procedure that Ratcliff (1979) described. It's about calculating RT bins for any distribution of RT data. It boils down to rank ordering your data, replicating each data point as many times as you need bins and then splitting up the
2002 Mar 19
3
plot with the axes at xlim and ylim
I'd like to make a plot with the axes drawn at the values of xlim and ylim. The default plot draws the axes slightly outside these values. I have been experimenting with the par(mgp) setting, but specifying par(mgp=c(2,0,-1)) gives me "invalid value specified for graphics parameter "mgp".". A more complicated mathod that almost seems to work is doing the plot with