[R] Spider diagrams

markhall@gol.com markhall at gol.com
Wed Feb 28 04:55:10 CET 2001


Hi, I am trying to create what are called "spider diagrams" in the geochemical
literature using R.  A spider diagram is basically a plot of the atomic number 
versus the concentration on a log scale.  Lines are drawn from each atomic
number for each sample.

Right now, my data frame looks like:

     SAMPLE             SITE           V3   LA.NASC LAATNUM   CE.NASC CEATMNUM
1  1A:001    ICU Loc 1A       Kasori E     0.2708179      57 0.3285894       58
2  1A:002    ICU Loc 1A       Kasori E     0.4542450      57 0.5353200       58
3  1A:003    ICU Loc 1A       Kasori E     0.3020954      57 0.3330943       58
4  1A:004    ICU Loc 1A       Kasori E     0.4956085      57 0.5660766       58
5  1A:005    ICU Loc 1A       Kasori E     0.6821741      57 0.7434971       58
6  1A:006    ICU Loc 1A       Kasori E     0.2667235      57 0.3471334       58
7  1A:008    ICU Loc 1A       Kasori E     0.4072798      57 0.5160001       58
8  1A:011    ICU Loc 1A       Kasori E     0.2958622      57 0.4187263       58
9  1A:017    ICU Loc 1A       Kasori E     0.2479571      57 0.3287652       58
10 1A:018    ICU Loc 1A       Kasori E     0.1469086      57 0.1802292       58
11 1A:019    ICU Loc 1A       Kasori E     0.4560389      57 0.6020045       58
     ND.NASC NDATNUM   SM.NASC SMATNUM
1  0.3726716      60 0.3915657      62
2  0.6724895      60 0.6687707      62
3  0.4930570      60 0.4995848      62
4  0.6827095      60 0.6414732      62
5  1.1013142      60 1.3937307      62
6  0.4419258      60 0.3340616      62
7  0.6425135      60 0.4334365      62
8  0.4402632      60 0.2898625      62
9  0.3856467      60 0.2911848      62
10 0.1991619      60 0.1864905      62
11 0.7596844      60 0.7790251      62

My plotting commands:

plot(spider[,5],spider[,4],xlim=range(57,63),ylim=range
(0.1,10),log="y",pch=as.integer(spider[,1]))

points(spider[,7],spider[,6],pch=as.integer(spider[,1]))
points(spider[,9],spider[,8],pch=as.integer(spider[,1]))
points(spider[,11],spider[,10],pch=as.integer(spider[,1]))

Okay, sop far, so good.  the problem I am having is getting the points
connected properly (based on the sample number).  I need the lines going across
the plot, not parallel to the y-axis (which I have done all too easily).

Sorry to bother you folks with what is probably an easy question, but I've 
reached the point of not sure what to try next.  I have a suspicion this
is something readily done in R though...

Are there any people out there using R for geochemical data?

Best, Mark Hall
markhall at gol.com





-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list