Skip to content
Prev 292575 / 398500 Next

automating a script to read a file

Petr,  R- Users

The scheme you provided yesterday worked very well.  I am now trying to add
more information to the graph(s) to make them more informative for my
purposes.

Essentially, I am trying to use a double Y axis graphic that will include
the skew normal curves that I wrote about yesterday and a histogram.

The graph is very similar to the one produced by the following:

library(latticeExtra)
However, I'd like to substitute the following syntax:
plot.spdf(x), use.style=FALSE)

This does not work as doubleYScale expects histogram and densityplot,  and
I'd like to use the plot.spdf routine in its place.

Any Suggestions would be greatly appreciated.

I'm working with
R 2.15.0 (2012-03-12)
Platform i386-pc-mingw32/ie86 (32-bit)

Thanks
Steve


Steve Friedman Ph. D.
Ecologist  / Spatial Statistical Analyst
Everglades and Dry Tortugas National Park
950 N Krome Ave (3rd Floor)
Homestead, Florida 33034

Steve_Friedman at nps.gov
Office (305) 224 - 4282
Fax     (305) 224 - 4147


                                                                           
             Petr Savicky                                                  
             <savicky at cs.cas.c                                             
             z>                                                         To 
             Sent by:                  r-help at r-project.org                
             r-help-bounces at r-                                          cc 
             project.org                                                   
                                                                   Subject 
                                       Re: [R] automating a script to read 
             04/23/2012 04:42          a file                              
             PM
On Mon, Apr 23, 2012 at 04:02:45PM -0400, Steve_Friedman at nps.gov wrote:
to
Hi.

If you read the parameters from a file and put them to a matrix,
then all the plots may be produced using a loop like the following.

  #some parameters
  p <- matrix(1:18, nrow=3, ncol=6)
  for (i in 1:nrow(p)) {
      plot.spdf(p[i, 1], p[i, 2], p[i, 3], p[i, 4], p[i, 5], p[i, 6])
      readline("press Enter to continue")
  }

If you use pdf() for sending the graphics to a file, then remove
the "readline" command.

Hope this helps.

Petr Savicky.

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.