Re: [R] How to find row maximum of two columns

2006-05-11 Thread Rob Steele
Dale Steele wrote: Hello -- Given the 10x2 matrix below, my goal is to create a vector which contains the maximum of column 1 and column 2, or the only value if there is an NA in one column. I experimented with max.col without success. Thanks. --Dale tmax.m tmaxhme tmaxer

[R] Legend titles in log plots broken? (ver. 2.2.1)

2006-05-10 Thread Rob Steele
Legend titles work in linear plots: curve(1/x, xlim = c(0, 1)) legend(x = 'topright', inset = 0.04, legend = '1/x', lty = 1, title = 'Legend Title') But when you change to a log plot on either dimension things get screwy: curve(1/x, xlim = c(0, 1), log = 'y') legend(x =

Re: [R] Overlapping assignment

2006-04-25 Thread Rob Steele
Prof Brian Ripley wrote: On Mon, 24 Apr 2006, Rob Steele wrote: Is it valid to assign a slice of an array or vector to an overlapping slice of the same object? R seems to do the right thing but I can't find anything where it promises to. Yes. Remember R is a vector language, so

[R] Overlapping assignment

2006-04-24 Thread Rob Steele
Is it valid to assign a slice of an array or vector to an overlapping slice of the same object? R seems to do the right thing but I can't find anything where it promises to. a - 1:12 a[4:12] - a[1:9] a [1] 1 2 3 1 2 3 4 5 6 7 8 9 b - 1:12 b[1:9] - b[4:12] b [1] 4 5 6 7 8

[R] A question about boxplot: mean and median

2005-04-15 Thread Rob Steele
I have worked through the examples given in the help on boxplot(). If I am reading it right, only the median is produced (as a default), which is represented by the horizontal line inside the box. What argument do I need to specify if I want to show the mean as well? Try this: boxplot(count ~

[R] R-help

2005-02-22 Thread Rob Steele
I am tring to create a plot with two y-axis. I found an example which is fine but the problem is that the range of the second y-axes appears in the first y-axes causing confusion. [...] The key is the ann = FALSE in the second plot(): n = 100 x = rnorm(n) y = rnorm(n) z = rnorm(n) * 250 par(mar =

[R] 49 histograms on one page

2005-02-21 Thread Rob Steele
The pdf format works well for large numbers of plots on a single page. You can use a viewer like Acrobat Reader to zoom in to the areas of interest. Ideally you can arrange the plots in a meaningful order, maybe where both their horizontal and vertical position convey information. If you

[R] Thrashing?

2004-11-13 Thread Rob Steele
Does R do its own swapping out to disk? I disabled Linux swapping and the system still gets stuck in Purgatory where there's little CPU activity but the disk goes like crazy. That's with R having almost the whole machine to itself and running a memory hungry compute only function. I've seen

[R] Idiom for column operations?

2004-10-26 Thread Rob Steele
: m / matrix(v, nrow = nrow(m), ncol = length(v), byrow = TRUE) But that seems even worse. Thanks! Rob Steele __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting