Re: [R] Reducing the size of pdf graphics files produced with R

2007-05-23 Thread Waichler, Scott R
as you are using MacOS X, you'll have ghostscript installed anyway. so try in R `dev2bitmap' with `type =pdfwrite'. I believe `gs' _does_ include compression. a quick test showed at least a reduction by about a factor of 2 relative to `pdf()'. probably one can fiddle with the ghostscript

Re: [R] Reducing the size of pdf graphics files produced with R

2007-05-23 Thread Waichler, Scott R
--- -Original Message- From: Joerg van den Hoff [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 23, 2007 9:25 AM To: Waichler, Scott R Cc: r-help@stat.math.ethz.ch; [EMAIL PROTECTED] Subject: Re: [R] Reducing the size of pdf graphics files produced with R On Wed, May

[R] How to create an R RPM from source

2007-05-21 Thread Waichler, Scott R
I use some computers that run older versions of Redhat Linux such as EL3. RPMs for the current version of R are no longer provided via CRAN for these older operating system versions. How can I compile my own RPM for the current version of R, which I could then use to install R quickly and easily

Re: [R] How to create an R RPM from source

2007-05-21 Thread Waichler, Scott R
I use some computers that run older versions of Redhat Linux such as EL3. RPMs for the current version of R are no longer provided via CRAN for these older operating system versions. How can I compile my own RPM for the current version of R, which I could then use to install R

[R] Getting default aspect ratio from lattice

2007-05-15 Thread Waichler, Scott R
How can I get the value of the aspect ratio that is used in a lattice plot? In a levelplot for instance, the native units per cm of my x and y axes are different, and I need to know the aspect ratio so that I can correctly plot vectors. I know how to set the aspect in a high-level lattice

Re: [R] Getting default aspect ratio from lattice

2007-05-15 Thread Waichler, Scott R
How can I get the value of the aspect ratio that is used in a lattice plot? In a levelplot for instance, the native units per cm of my x and y axes are different, and I need to know the aspect ratio so that I can correctly plot vectors. I know how to set the aspect in a

Re: [R] levelplot and unequal cell sizes

2007-04-26 Thread Waichler, Scott R
my.panel.levelplot - function (x, y, z, subscripts, at = pretty(z), col.regions = regions$col, ..., w, h) { regions - trellis.par.get(regions) numcol - length(at) - 1 numcol.r - length(col.regions) col.regions - if (numcol.r = numcol)

[R] levelplot and unequal cell sizes

2007-04-25 Thread Waichler, Scott R
I am using levelplot() from lattice with grids that have unequal cell sizes. This means that the boundary between two cells is not always half-way between nodes, as levelplot() assumes. The result is that some cell sizes are rendered incorrectly, which can be painfully obvious if using

Re: [R] levelplot and unequal cell sizes

2007-04-25 Thread Waichler, Scott R
Hadley and Deepayan, Thank you for responding. Here is a simple example of what I'm talking about. It is a grid that is 5 cells wide by 2 cells tall. The width of the cells in the x-direction is variable; the cells at either end have width = 4 units, and the three cells in the middle have

Re: [R] levelplot and unequal cell sizes

2007-04-25 Thread Waichler, Scott R
You are right, panel.levelplot is indeed assuming that the boundaries are between consecutive midpoints. There is no built in way around that; there simply isn't enough information available to the panel function. The cleanest solution, in principle, is to write your own panel function

[R] Possible to get a definition of a function from a package to use without invoking the package?

2006-06-27 Thread Waichler, Scott R
Hi, I often use the mod() and instring() functions that are available in the clim.pact package. This package has a lot of dependencies, including installation of netCDF, and I haven't yet been able to get library(clim.pact) to work on a Mac OS 10.4.6. A previous request for help with the Mac

[R] Failed library(ncdf)

2006-06-13 Thread Waichler, Scott R
I am trying to use the ncdf package on a Mac OS X machine (10.4.6), but I get the following error message: library(ncdf) Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library '/Library/Frameworks/R.framework/Resources/library/ncdf/libs/ppc/ncdf.so ':

Re: [R] Parallel computing with the snow package: external file I/O possible?

2006-04-20 Thread Waichler, Scott R
Hello, After getting help to solve part of my problem and some delay on my part, I am posting a more refined version to see if someone can help me further. I am trying to autocalibrate a model in my subject area using the snow and rgenoud packages. I want to use the key function fn that is

[R] Getting polygons from contiguous grid cells having same value in sp

2006-03-21 Thread Waichler, Scott R
I have been using the sp package to deal with gridded data. I would like to know how to extract the vertices (x,y) of polygons that outline areas of like-valued cells in a grid. Here is a simple 3x3 grid: 2 2 1 1 2 1 1 1 3 x - c(1,1,1,2,2,2,3,3,3) # define a 3 x 3 array of points y -

[R] Parallel computing with the snow package: external file I/O possible?

2006-03-13 Thread Waichler, Scott R
Hello, I am trying to do model autocalibration using the snow and rgenoud packages. The function I want to run in task-parallel fashion across multiple machines is one that pre- and post-processes data and runs an external model code. My problem is that external file I/O is happening only in

[R] Package compiling problem in Linux

2006-02-13 Thread Waichler, Scott R
Hi, I am trying to install packages in R-2.2.1 on a Redhat WS4 system. I get the following error messages trying to install, for example, the akima package: R.version.string [1] R version 2.2.1, 2005-12-20 install.packages(akima, lib=/usr/lib/R/library, repos = http://cran.fhcrc.org/;) . . .

Re: [R] Package compiling problem in Linux

2006-02-13 Thread Waichler, Scott R
The only way I can see this happening is if you installed a ix86 RPM on a x86_86 system. You can do that and R will run, but you will not be able to build packages out of the box. This is exactly what happened. Now I know to use 'uname -a' to check machine architecture first. I was able

[R] Parallel computing in R for dummies--how to optimize an external model?

2006-02-13 Thread Waichler, Scott R
I am trying to use the optimizing function genoud() with the snow package on a couple of i686 machines running Redhat Linux WS4 . I don't know anything about PVM or MPI, so I just followed the directions in snow and rgenoud for the simplest method and started a socket cluster. My function fn for

[R] Timeliness of precompiled binaries--R-2.2.1 still not available as RPM

2006-01-30 Thread Waichler, Scott R
R-2.2.1 is still not available for Redhat Linux as an RPM on CRAN. It is available as an SRPM. Can someone fill me in on why it takes so long to make RPMs available? I would be happy to help make the RPMs for el4 and el3 if such help is needed. Regards, Scott Waichler Pacific Northwest

Re: [R] Timeliness of precompiled binaries--R-2.2.1 still notavailable as RPM

2006-01-30 Thread Waichler, Scott R
...More the point, though, which CRAN mirror were you looking at? R 2.2.1 was in all the EL3/4 and FC3/4 i386 and x86_64 directories I could be bothered to look at on the UK Bristol mirror for example. I use this mirror: http://cran.fhcrc.org/ Fred Hutchinson Cancer Research Center, Seattle,

[R] change lattice panel background color

2006-01-13 Thread Waichler, Scott R
I can't find a way to change just the panel background color in lattice. I would like NA regions in levelplot() to appear black. I've tried the trellis.par.set() stuff, but it it makes the background of the whole graphic black. Thanks, Scott Waichler Pacific Northwest National Laboratory

[R] Connectivity across a grid above a variable surface

2006-01-03 Thread Waichler, Scott R
Hi, I'm looking for ideas or packages with relevant algorithms for calculating the connectivity across a grid, where connectivity is defined as the minimum amount of cross-sectional area along a continuous path. The upper boundary of the cross-sectional area is a fixed elevation, and the lower

[R] How to get aspect ratio as output from from plot()

2005-10-11 Thread Waichler, Scott R
Is there a way to get the aspect ratio as output from a plot() call or something similar in the base graphics system? I would like to note vertical exaggeration on an elevation profile. Thanks, Scott Waichler Pacific Northwest National Laboratory [EMAIL PROTECTED]

Re: [R] How to get aspect ratio as output from from plot()

2005-10-11 Thread Waichler, Scott R
Sundar, Perhaps this will work for you? plot(1:10) w - par(pin)[1]/diff(par(usr)[1:2]) h - par(pin)[2]/diff(par(usr)[3:4]) asp - w/h Thank you for your help. For vertical exaggeration I will make a slight change to make it more intuitive (for me): w - diff(par(usr)[1:2]) / par(pin)[1]

[R] using forecast() in dse2 with an ARMA model having a trend component

2005-06-14 Thread Waichler, Scott R
(My apologies if this is a repeated posting. I couldn't find any trace of my previous attempt in the archive.) I'm having trouble with forecast() in the dse2 package. It works fine for me on a model without a trend, but gives me NaN output for the forecast values when using a model with a

[R] problem with chron scales in lattice

2005-06-01 Thread Waichler, Scott R
I can't get the scales parameter in xyplot of lattice to work as I expected. I'm using R-2.1.0 and lattice 0.11-8. There should be year labels from 1992 to 2004 for the x axis in the plot below, but instead only a few of them appear, and in the wrong spots, as if the coordinate system has

RE: [R] problem with chron scales in lattice

2005-06-01 Thread Waichler, Scott R
I can't get the scales parameter in xyplot of lattice to work as I expected. I'm using R-2.1.0 and lattice 0.11-8. There should be year labels from 1992 to 2004 for the x axis in the plot below, but instead only a few of them appear, and in the wrong spots, as if the coordinate

[R] RE: Soil texture triangle in R?

2005-05-31 Thread Waichler, Scott R
Sander, has anybody made an attempt to create the soil texture triangle graph in R? See ternaryplot() in package vcd. Its options are quite limited, but it may help. I think you'll need to write your own function to do a ternary plot like the one you point to, perhaps using functions in the

RE: [R] Omitting NAs in aggregate.ts()

2005-05-17 Thread Waichler, Scott R
I have a time series vector (not necessarily ts class) that has NAs in it. How can I omit the NAs when using aggregate.ts() to compute a function on each window? If there is at least one non-NA value in each window, I'd like to proceed with evaluating the function; otherwise, I would

[R] Omitting NAs in aggregate.ts()

2005-05-16 Thread Waichler, Scott R
I have a time series vector (not necessarily ts class) that has NAs in it. How can I omit the NAs when using aggregate.ts() to compute a function on each window? If there is at least one non-NA value in each window, I'd like to proceed with evaluating the function; otherwise, I would like NA

[R] Trying to understand kpss.test() in tseries package

2005-05-02 Thread Waichler, Scott R
I'm trying to understand how to use kpss.test() properly. If I have a level stationary series like rnorm() in the help page, shouldn't I get a small p-value with the null hypothesis set to Trend? The (condensed) output from kpss.test() for the two possible null hypotheses is given below. I

[R] R-2.1.0 search engine works with mozilla browser but not firefox

2005-04-29 Thread Waichler, Scott R
I'm running R-2.1.0 on a Linux box and found that the HTML search engine help would not work with Firefox 1.0.3 but would work with Mozilla 1.7.7. I have Java Runtime Environment 1.5.0_02 installed. With Firefox, when I launch help.start() and click to the search engine, it brings up the first

[R] postscript() filenames with forward slashes cause abort

2005-04-29 Thread Waichler, Scott R
My newly installed R-2.1.0 apparently doesn't like forward slashes in filenames: R.version.string [1] R version 2.1.0, 2005-04-18 plotfile - \home\mean_monthly_stl.eps postscript(plotfile) plotfile - /home/mean_monthly_stl.eps postscript(plotfile) *** glibc detected *** double free or

RE: [R] postscript() filenames with forward slashes cause abort

2005-04-29 Thread Waichler, Scott R
My newly installed R-2.1.0 apparently doesn't like forward slashes in filenames: R.version.string [1] R version 2.1.0, 2005-04-18 plotfile - \home\mean_monthly_stl.eps postscript(plotfile) plotfile - /home/mean_monthly_stl.eps postscript(plotfile) *** glibc detected ***

RE: [R] R-2.1.0 search engine works with mozilla browser but not firefox

2005-04-29 Thread Waichler, Scott R
I'm running R-2.1.0 on a Linux box and found that the HTML search engine help would not work with Firefox 1.0.3 but would work with Mozilla 1.7.7. I have Java Runtime Environment 1.5.0_02 installed. With Firefox, when I launch help.start() and click to the search engine, it

RE: [R] R-2.1.0 search engine works with mozilla browser but notfirefox

2005-04-29 Thread Waichler, Scott R
I believe the problem is related to the change in the installation directory for the updated JVM from Sun. If you use the jre1.5.0_02 from java.sun.com, then the plugin is installed in: /usr/java/jre1.5.0_02/plugin/i386/ns7/libjavaplugin_oji.so Ok, the above pathname is the exact one.

[R] Problem with R-2.1.0: install.packages() doesn't work

2005-04-22 Thread Waichler, Scott R
I installed R-2.1.0 from source on a Linux box running Red Hat Enterprise Linux WS release 4 but install.packages() wouldn't work (see below). When I install R-2.0.1 from RPM on the same system, everything is fine. Version 2.1.0 (2005-04-18), ISBN 3-900051-07-0 . . . options(CRAN =

[R] Emacs keystroke to toggle T/F for setting logical values

2005-03-04 Thread Waichler, Scott R
I'd like to have an Emacs keystroke that would let me toggle between T and F when editing logical settings in R code. I looked in the ESS documentation and in my O'Reilly emacs books but found nothing. Any ideas? Scott Waichler Pacific Northwest National Laboratory [EMAIL PROTECTED]

[R] Rounding parameter values in genoud(), Rgenoud package

2005-03-02 Thread Waichler, Scott R
I would like to limit the significant figures of the calibrated parameters determined by genoud() in the Rgenoud package. Below is some example output, where column 1 is model run number, columns 2-7 are the parameter values, and columns 8-12 are model fit statistics. I would like genoud to

[R] Code contributed for a gant (Gantt) chart

2005-01-14 Thread Waichler, Scott R
I searched CRAN for material on gant (or Gantt) charts, those schedule plots that look like horizontal barplots where the x-axis is time. Finding none, I wrote the following and am submitting it to the archive so that it may help someone in the future. plotfile - gant.eps regular.color -

[R] Customizing axis labels with alternating in lattice

2004-12-16 Thread Waichler, Scott R
I would like to have complete control over which plots and which axes have labels in a lattice figure. I tried lots of vectors for the alternating setting in scales, but none worked. Here is what I would like to do for a 2 col x 3 row figure, where the x designates a location I would like to

[R] Unsightly lines from x*y grid in levelplot with Postscript

2004-12-16 Thread Waichler, Scott R
When I generate levelplot figures with Postscript, the lines from the underlying grid (i.e., the x and y in z ~ x* y) show up as faint white lines in the output. If I have a dense grid, the lines wash out the contour colors. I can avoid the problem if I use png instead, but that brings up other

FW: [R] Unsightly lines from x*y grid in levelplot with Postscript

2004-12-16 Thread Waichler, Scott R
One typical problem with gv is that some artifacts show up (which may not be what you describe) when the display is anti-aliased. Try turning that off (by pressing 'a') and see if that improves the display. If you produce PDF, it's possible to just turn off antialiasing for line art,

RE: [R] Problem with number characters

2004-10-14 Thread Waichler, Scott R
Gabor wrote: Assuming that the problem is that your input file has additional embedded characters added by the data base program you could try extracting just the text using the UNIX strings program: strings myfile.csv myfile.txt Spencer wrote: strsplit can break character strings into

RE: [R] bwplot panels like stripplot

2004-09-24 Thread Waichler, Scott R
I would like to plot horizontal box-and-whisker plots in lattice where each factor has its own panel and scales are free. Below is a stripplot version of what I have in mind. Substituting bwplot doesn't work. This won't work (easily) with R = 1.9.1. Try with 2.0.0 beta, and let us know

[R] Separation between tick marks and tick labels in lattice

2004-09-14 Thread Waichler, Scott R
I can't find a way to control the distance between tick marks and tick labels in lattice. In a stripplot I'm making these components are too close. I don't see anything like base graphics mgp in the scales list. Thanks for your help, Scott Waichler Pacific Northwest National Laboratory

[R] Problem with seq.dates in chron

2004-09-03 Thread Waichler, Scott R
I get faulty output from seq.dates() if I specify a length that is too long. For example, I ask for 129 months in the following call to the function, but it returns 131: R.version.string [1] R version 1.9.1, 2004-06-21 startdatetime - chron(dates=01/01/1995, times=00:00:00)

[R] Problem with seq.dates in chron

2004-08-31 Thread Waichler, Scott R
I get faulty output from seq.dates() if I specify a length that is too long. For example, I ask for 129 months in the following call to the function, but it returns 131: R.version.string [1] R version 1.9.1, 2004-06-21 startdatetime - chron(dates=01/01/1995, times=00:00:00)

[R] Making a ranking algorithm more efficient

2004-06-01 Thread Waichler, Scott R
I would like to make a ranking operation more efficient if possible. The goal is to rank a set of points representing objective function values such that points which are dominated by no others have rank 1, those which are dominated by one other point have rank 2, etc. In the example with two

RE: [R] Tagging identical rows of a matrix

2004-05-14 Thread Waichler, Scott R
Thanks to all of you who responded to my help request. Here is the very efficient upshot of your advice: mat2 - apply(mat, 1, paste, collapse=:) vec - match(mat2, unique(mat2)) vec [1] 1 2 1 1 2 3 P.S. I found that Andy Liaw's method didn't preserve the index order that I wanted; it yields

[R] Sweave and R output: possible to suppress Schunk tags in *.tex file output?

2004-03-12 Thread Waichler, Scott R
Hello, I would like to fill the rows of a Latex tabular environment with output from R, as in \begin{table} \caption{Table caption.} \label{tab:events} \begin{tabular}{c r r r r r} \hline echo=false,results=tex= fill.my.table.rows() @ \end{tabular} \end{table} Sweave produces the

[R] Extracting multiple elements from a list

2004-01-15 Thread Waichler, Scott R
For a long time I've wanted a way to conveniently extract multiple elements from a list, which [[ doesn't allow. Can anyone suggest an efficient function to do this? Wouldn't it be a sensible addition to R? For example, alist - list() alist[[1]] - list() alist[[1]]$name - first alist[[1]]$vec

RE: [R] Extracting multiple elements from a list

2004-01-15 Thread Waichler, Scott R
]] [[2]][[2]]$name [1] two [[2]][[2]]$vec [1] 5 6 7 8 -Original Message- From: Roger D. Peng [mailto:[EMAIL PROTECTED] Sent: Thursday, January 15, 2004 12:24 PM To: Waichler, Scott R Cc: [EMAIL PROTECTED] Subject: Re: [R] Extracting multiple elements from a list Sorry

[R] Different scales for keys in lattice levelplots

2003-12-19 Thread Waichler, Scott R
Can anyone tell me how to obtain a custom scale for the colorkey in each levelplot of a lattice? I am using lattice and levelplot to plot z = f(x, y) for multiple z variables. x and y values are the same across plots, but units for z are different and therefore I need to create a custom scale

[R] Can't get Sweave syntax highlighting with Emacs

2003-11-13 Thread Waichler, Scott R
I can't get Emacs to automatically do syntax highlighting of Sweave files. I have followed Friedrich's suggestion for code to insert into my .emacs file. The complete section from my .emacs file is given below. When I load a *.Snw file, font is white until I press M-x, then the first code and