Though I have read quite a bit, and tried quite a bit, I have yet to
find a nice way to overlay 2 or more curves in the same plot, with
different ranges.
Here is simplified sample code to demonstrate the question:
plot(2*(seq(1,5)), type=l, axes=FALSE)
curve(2*(seq(1,5)), type=b, add=TRUE)
First my excuses if I keep bugging everyone in this list, but I am a
newbie, and tend to find some behaviour that looks unexpected to me; and
I would really appreciate to be pointed to some location that allows me
to understand more about this software. Here is my next question:
Peter Ehlers wrote:
par(mfrow=c(1,1))
qqnorm(rnorm(20))
qqmath(rnorm(20))
par(mfrow=c(3,4))
for(i in 1:12)qqnorm(rnorm(20))
Until here everything works as expected, and the last line prints 12
samples of qqnorm. However,
for(i in 1:12)qqmath(rnorm(20))
is doing nothing at all.
Peter Ehlers wrote:
You are mixing 'traditional' graphics (par(...)) and
'lattice' graphics.
That won't work. In lattice, you use the 'layout' argument to
select the number of columns/rows. This is easiest if you set
up a conditioning variable:
cond - gl(12, 20, labels = letters[1:12])
x -
Greg Snow wrote:
The first thing to do is look at the help page for the function: ?qqnorm and ?qqmath, the package where these functions are defined is at the top of the page, if that package is graphics then it is a base graphics function, if the package is grid, lattice, or ggplot2 then it is
The same thing that happened to my 'maptools'
(http://permalink.gmane.org/gmane.comp.lang.r.general/177404)
also hits me here: It eats all memory until the system dies.
Alas, in this case, no Ubuntu package.
Since I installed some tens of packages with the same method in the
meantime, I guess
Referring to Using R for Data Analysis and Graphics by J H Maindonald,
and available from the R site, I found the example on p.30 non-working:
stem(qqnorm(possum$hdlngth))
Error in stem(qqnorm(possum$hdlngth)) : 'x' must be numeric
Since qqnorm(possum$hdlngth) plots, and
class(possum$hdlngth)
I am studying Using R for Introductory Statistics and find it in
general very useful. At present, I am stumbling over the function
simple.median.test.
x
[1] 12.8 3.5 2.9 9.4 8.7 0.7 0.2 2.8 1.9 2.8 3.1 15.8
simple.median.test (x,median=5)
[1] 0.3876953
simple.median.test
Jim Lemon wrote:
Yes, I realized that I had forgotten to require(plotrix) after I sent
the message. From your example, you might also want to look at the
diamondplot function, also in plotrix.
Jim,
thanks for the hint to diamondplot. It is much closer natively to what I
wanted to do, and
First of all, I really like R! Still being a newbie, I find things (the
difficult ones) to be very simple.
Alas, some 'simple' things still escape me. (Maybe the tutorials are
often too much focused on the 'difficult' items??)
Here comes my 'problem', over which I have sweated for the last 2
Both packages are listed on the website, but neither installs here:
gnumeric:
...
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* Removing ‘/usr/local/lib/R/site-library/XML’
* Installing *source* package ‘gnumeric’ ...
** R
** preparing package for lazy loading
Warning
Jim Lemon wrote:
Hi Uwe,
Here's one way to get your spider plot:
ld1-matrix(sample(1:5,310,TRUE),nrow=31)
ld2-apply(ld1,2,table)
radial.plot(ld2,line.col=2:6,rp.type=p,
radial.pos=seq(0,9*pi/5,by=pi/5),
labels=paste(Q,1:10,sep=),start=pi/2,
clockwise=TRUE,main=Frequency of response by
Having found the online version of SimpleR, I wanted to to download the
respective data:
The data sets for these notes are available from the CSI math
department (http://www.math.csi.cuny.edu/Statistics/R/simpleR)
and must be installed prior to this.
There it says:
The simpleR package is now
I had downloaded and installed a number of packages, successfully, when
I ran into some problem with maptools: It would eat up CPU and most of
all memory.
I rebooted, and tried again, only running the terminal after the reboot;
with the same result:
sp2WB text html latex example
sp2tmap text
This is what I tried:
num.vec - c(12.34,56.78,90.12,34.56)
names(num.vec)-c(first,second,third,fourth)
num.vec
first second third fourth
12.34 56.78 90.12 34.56
seq-(1:4)
num.mat-rbind(num.vec,seq)
num.mat
first second third fourth
Meyners,Michael,LAUSANNE,AppliedMathematics wrote:
What you (probably) want here is
num.mat [seq,]
num.mat [num.vec]
[1] NA NA NA NA
num.mat[num.vec,]
and so on. You have to use tell R that you want the ROW (that's why the
comma is needed) defined by the NAME seq or num.vec
16 matches
Mail list logo