Re: [R] else problem

2011-06-24 Thread David Winsemius
this else problem not because it is a function but because you used those brackets. Regards Petr Cheers, Kara ________ From: Bert Gunter [gunter.ber...@gene.com] Sent: June 23, 2011 8:27 AM To: David Winsemius Cc: Kara Przeczek; r-help@r-project.org Subject:

Re: [R] else problem

2011-06-24 Thread Petr PIKAL
is else problem not because it is a function but because you used those brackets. Regards Petr > Cheers, > Kara > > From: Bert Gunter [gunter.ber...@gene.com] > Sent: June 23, 2011 8:27 AM > To: David Winsemius > Cc: Kara Przeczek; r-help@r-project.org > Subjec

Re: [R] else problem

2011-06-23 Thread David Winsemius
{ if (FALSE) print("T") + else { print("F") } } > fntest() [1] "F" -- David Cheers, Kara From: Bert Gunter [gunter.ber...@gene.com] Sent: June 23, 2011 8:27 AM To: David Winsemius Cc: Kara Przeczek; r-hel

Re: [R] else problem

2011-06-23 Thread Kara Przeczek
format, because it was part of a function and thus would have been executed completely within the function? Cheers, Kara From: Bert Gunter [gunter.ber...@gene.com] Sent: June 23, 2011 8:27 AM To: David Winsemius Cc: Kara Przeczek; r-help@r-project.org S

Re: [R] else problem

2011-06-23 Thread Bert Gunter
Perhaps some additional clarification... (???) >> if (length(dat2f$year)%%2==0) { >>  md <-dat2f[, list(med_year = max(year[which(abs(tot_km3y - >> median(tot_km3y)) == min(abs(tot_km3y - median(tot_km3y ]), med_TotQ = >> median(tot_km3y))]  } >> else { > > If this line is executed at a conso

Re: [R] else problem

2011-06-23 Thread David Winsemius
On Jun 23, 2011, at 10:59 AM, Kara Przeczek wrote: Dear R users, I have run into a problem using if...else and I hope you can shed some light on it. I am using R version 2.2.0.1. I have the following data frame: head(dat2f) year tot_km3y [1,] 1964 0.1876854 [2,] 1965 0.1835116 [3,] 1

[R] else problem

2011-06-23 Thread Kara Przeczek
Dear R users, I have run into a problem using if...else and I hope you can shed some light on it. I am using R version 2.2.0.1. I have the following data frame: > head(dat2f) year tot_km3y [1,] 1964 0.1876854 [2,] 1965 0.1835116 [3,] 1966 0.1915012 [4,] 1967 0.1869758 [5,] 1968 0.2249865 [6