Re: [R] Syntax Question

2005-10-25 Thread Berton Gunter
ng process." - George E. P. Box > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Jonathan Shaffer > Sent: Tuesday, October 25, 2005 8:59 AM > To: R-help@stat.math.ethz.ch > Subject: [R] Syntax Question > > Hello, &g

[R] Syntax Question

2005-10-25 Thread Jonathan Shaffer
Hello, I'm having some difficulty running Niels Waller's Maxcov Hitmax program in the R console, and I was hoping you could provide me with some assistance. When I attempt to run the analysis I receive the following message: Indicators 1 3 & 2Error in if (del == 0 && to == 0) return(to) : missi

Re: [R] Syntax Question

2004-04-06 Thread Clint Bowman
Thanks, I have gotten past the problem with good old grep: as.numeric(strsplit(st[grep("KGEG",st)],",")[[1]][4]) [1] 47.62139 The difficulty is trying to work with some complicated records that are coded up to work with perl. But grep will work perfectly. Thanks all, Clint On Wed, 7 Apr 2004

Re: [R] Syntax Question

2004-04-06 Thread Jason Turner
> I have a large data structure that looks like: > >> strsplit(st,",")[14395] > [1] "KGEG" > [2] "SA => KGEG" > [3] "72785" > [4] "47.62139" > [5] "-117.52778" > [6] "723" > [7] "WA" > [8] "US" > [9] "2" > [10] "SPOKANE SPOKANE INTERNATIONAL AIRPORT" > [11] "1" > > > I'd like to be able to

Re: [R] Syntax Question

2004-04-06 Thread Roger D. Peng
I'm not sure I fully understand your problem, but maybe something like: d <- strsplit(st, ",") index <- sapply(d, function(x) x[[1]]) == "KGEG" latitude <- sapply(d[index], function(x) x[[4]]) -roger Clint Bowman wrote: I have a large data structure that looks like: strsplit(st,",")[14395] [1]

[R] Syntax Question

2004-04-06 Thread Clint Bowman
I have a large data structure that looks like: > strsplit(st,",")[14395] [1] "KGEG" [2] "SA => KGEG" [3] "72785" [4] "47.62139" [5] "-117.52778" [6] "723" [7] "WA" [8] "US" [9] "2" [10] "SPOKANE SPOKANE INTERNATIONAL AIRPORT" [11] "1" I'd like to be able to retrieve, for example, the la

Re: [R] Another R syntax question

2003-09-03 Thread Peter Dalgaard BSA
Thomas Lumley <[EMAIL PROTECTED]> writes: > I think it's clear that it will parse as either > (x==y) != z > or > x == (y!=z) > but not which. The rule is that everything is left associative except assignment and exponentiation (and IF, for some reason). If in doubt, just remember that it is the o

Re: [R] Another R syntax question

2003-09-03 Thread Thomas Lumley
On Wed, 3 Sep 2003, Richard A. O'Keefe wrote: > The file src/library/base/R/print.R > contains this line: > > x0 <- xm[okP]==0 != (as.numeric(Cf[okP])==0) > > I didn't know R allowed that, and I wonder if it is deliberate? Well, I'm not surprised that it's syntactically valid, but I wouldn't

[R] Another R syntax question

2003-09-02 Thread Richard A. O'Keefe
The file src/library/base/R/print.R contains this line: x0 <- xm[okP]==0 != (as.numeric(Cf[okP])==0) I didn't know R allowed that, and I wonder if it is deliberate? In mathematics, you would expect x = y not= z to mean (x = y) and (y not= z).; In R, it