Re: [R] imaging and contouring

2006-04-06 Thread Gregory Snow
The help for filled.contour suggests using the plot.axes argument to annotate a plot, try changing the last part of your 3rd example to: filled.contour(nlong,nlat,z1,col=rainbow (100),xlab=longitude,ylab=latitude, plot.axes=map(add=TRUE)) Or filled.contour(nlong,nlat,z1,col=rainbow

Re: [R] Help on hypothesis testing

2006-04-06 Thread Gregory Snow
There is a z.test function in the TeachingDemos Package. Note however that this function is meant for teaching purposes as a stepping stone for students to learn the syntax and output for hypothesis test functions before learning about t tests etc. The z.test function only does one sample tests.

Re: [R] Ternary or Triangular Plots (soil texture triangle plot)?

2006-04-03 Thread Gregory Snow
There is also the triplot function in the TeachingDemos package that does some of what you want (but always shows the full range 0 to 1 on all axes). I expect that each of the implementations out there does part of what you want and you may need to find which will come closest, or find which is

Re: [R] Maps of Canada and some (very) simple instructions

2006-04-03 Thread Gregory Snow
I found a shapefile for a map of Canada at: http://www.vdstech.com/map_data.htm you can read this in and plot it using the maptools package (or the sp package and friends if you want more control): library(maptools) tmp - read.shape('c:/maps/canada') tmp2 - Map2poly(tmp) plot(tmp2) For

[R] [R-pkgs] New Package blockrand

2006-03-30 Thread Gregory Snow
The package blockrand is now available on CRAN. This package aids in doing block randomizations for clinical trials or other situations where subjects or experimental units arrive over time and need to be randomized one at a time. The block randomization keeps the number of subjects in each arm

Re: [R] graphing and scrolling

2006-03-29 Thread Gregory Snow
in regards to the dynamic resizing, one would think that commands like plot.default {package:graphics} does it, as I am exploring other commands from graphics it seams like tkrplot may not be needed, I am not sure as I just started with graphics in R, maybe a

Re: [R] graphing and scrolling

2006-03-28 Thread Gregory Snow
thanks that was very helpful. i have been reading and trying to modify the code around to suit, but haven't been able to: first, maximize the chart with the window being maximized, the way it is it stays the same size after maximizing the window. The function tkrplot has optional

Re: [R] graphing and scrolling

2006-03-27 Thread Gregory Snow
Does the following (or some simple modification of it) do what you want?: library(tkrplot) y - rnorm(1, 10, 2) + 5*sin( (1:1)/1000 ) tt - tktoplevel() left - tclVar(1) oldleft - tclVar(1) right - tclVar(100) f1 - function(){ lleft - as.numeric(tclvalue(left)) rright -

Re: [R] create a gui with a button to change graphic?

2006-03-20 Thread Gregory Snow
Gael, Try the following to get you started: library(tkrplot) y - rnorm(1, 10, 2) + 5*sin( (1:1)/1000 ) tt - tktoplevel() left - tclVar(1) oldleft - tclVar(1) right - tclVar(100) f1 - function(){ lleft - as.numeric(tclvalue(left)) rright - as.numeric(tclvalue(right))

Re: [R] bug in map('world') ?

2006-03-08 Thread Gregory Snow
There is a function recenter.Map in the TeachingDemos package that can be used with the maptools packages (rather than the maps package) to move polygons around for better looking maps. The original idea was to put the Alaskan islands on the left of the map rather than having some of them on the

Re: [R] graphing dilemna

2006-02-27 Thread Gregory Snow
When barplots start getting complicated (and sometimes before that) you may want to start considering dotplots (package lattice) instead. For your specific problem you could possibly do the side-by-side plot, then using the output from barplot and the rect function you could plot a rectangle over

Re: [R] Need a hint

2006-02-23 Thread Gregory Snow
Here are a couple of quick thoughts on your problem. 1. Use alpha channels (may require you to produce all your graphs as pdf files). Fill each of your criteria categories with a mostly transparent color, e.g. the full contour of z[1] between 20 and 30 is 20% opaque and the full contour(s) of

Re: [R] Transferring R results to word prosessors

2006-02-10 Thread Gregory Snow
Just to add a couple of thoughts to the previous suggestions. If you really want output from things like summary.lm to have tabs instead of spaces then you can type: getAnywhere(print.summary.lm) at the R prompt and it will show you the (not quite) source of code that R uses to do the

Re: [R] putting text in the corner

2006-02-09 Thread Gregory Snow
par('usr') will give you the coordinates of the corners of the current plot. If you want to go a little beyond this (more like your legend example) by specifying that you want your text to be some distance from the bottom and left of the plot and have the distance not affected by the scale

Re: [R] format of 2x2 table

2006-02-01 Thread Gregory Snow
Look at the CrossTable function in the gmodels package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of array chip Sent:

Re: [R] reducing learning curves?

2006-01-25 Thread Gregory Snow
In addition to the other suggestions you may want to look at JGR (http://www.rosuda.org/JGR/). It does most of what you asked (except debugging, use the debug package for that). -Original Message- From: [EMAIL PROTECTED] on behalf of Michael Sent: Wed 1/25/2006 1:09 AM To:

Re: [R] Repeated measures aov with post hoc tests?

2006-01-12 Thread Gregory Snow
The multcomp package may do what you want (there is mention of nested variables in the help). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On

Re: [R] A comment about R

2006-01-05 Thread Gregory Snow
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Liaw, Andy Sent: Thursday, January 05, 2006 6:26 AM To: 'Patrick Burns'; John Maindonald Cc: r-help@stat.math.ethz.ch Subject: Re: [R] A comment about R [snip] Any suggestion on how to go about

Re: [R] Newbie question--locally weighted regression

2006-01-04 Thread Gregory Snow
Using a gam model (package gam, possibly others) will take care of the link function (and variance function) for you and allow using loess to fit the data. Here is a quick example to get you started, though you should read up on gam models yourself as well. library(gam) x - seq(0,1, length=250)

Re: [R] multiple lowess line in one plot

2006-01-04 Thread Gregory Snow
Here is one approach using lattice (trellis) graphics: tmp.state - data.frame( Frost=state.x77[,'Frost'], Murder=state.x77[,'Murder'], Region=state.region) library(lattice) trellis.par.set(col.whitebg()) xyplot( Murder ~ Frost, groups=Region, data=tmp.state,

Re: [R] Show graph integrated to GUI

2005-12-27 Thread Gregory Snow
The slider function in the TeachingDemos and relax packages (same function is in both packages you can use either) provides a way to do this using a Tk window. There are also several functions in the TechingDemos package that use a lower level interface to a Tk window that you can look at their

Re: [R] help with writing function

2005-12-13 Thread Gregory Snow
Does this do what you want: IED - function(risk){ tmp - outer(risk,risk,-) tmp - abs(tmp) return(tmp[lower.tri(tmp)]) } -- Gregory L. Snow Ph.D. Statistical Data Center, IHC [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED]

Re: [R] Time delay function or plot animation

2005-12-12 Thread Gregory Snow
Look at ?Sys.sleep -- Gregory L. Snow Ph.D. Statistical Data Center, IHC [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ulrike Grömping Sent: Monday, December 12, 2005 12:44 PM To: r-help@stat.math.ethz.ch

Re: [R] figure with inset

2005-12-08 Thread Gregory Snow
There is a subplot command in the latest version of the TeachingDemos package (version 1.1 available today) that does what you want using traditional graphics (others have given suggestions using grid graphics). An example: x - 0:10 y - x^4 plot(x,y,xaxs='i',yaxs='i') subplot(

Re: [R] strange plots with type = h option

2005-11-30 Thread Gregory Snow
Look at ?par specifically at the 'lend' argument. You probably want to do: par(lend=1) Before doing your plot. -- Gregory L. Snow Ph.D. Statistical Data Center, IHC [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf