Re: [R] Is this a bug?
On 17/04/07 - 14:59, Roland Rau wrote: > On 4/17/07, Luca Braglia <[EMAIL PROTECTED]> wrote: > >ifelse(T,1+1,1+2) > [1] 2 > >ifelse(F,1+1,1+2) > [1] 3 > >ifelse(T,"hello","goodbye") > [1] "hello" > >ifelse(F,"hello","goodbye") > [1] "goodbye" > >ifelse(T,print("hello"),print("goodbye")) > [1] "hello" > [1] "hello" > >ifelse(F,print("hello"),print("goodbye")) > [1] "goodbye" > [1] "goodbye" > >ifelse(T,print(1+1),print(1+2)) > [1] 2 > [1] 2 > >ifelse(F,print(1+1),print(1+2)) > [1] 3 > [1] 3 Thank you , Weiwei and Roland, all right now: I was thinking wrong! bye Luca __ R-help@stat.math.ethz.ch 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.
[R] Is this a bug?
I have found a strange "ifelse" behaviour (I think) This works: > ifelse(T,1+1,1+2) [1] 2 > ifelse(F,1+1,1+2) [1] 3 Maybe I missed something about R internals, but why > ifelse(T,print("hello"),print("goodbye")) [1] "hello" [1] "hello" > ifelse(F,print("hello"),print("goodbye")) [1] "goodbye" [1] "goodbye" values are returned two times? I'm not sure: if it's a bug I'll post it immediately Thank You Luca Version: platform = i486-pc-linux-gnu arch = i486 os = linux-gnu system = i486, linux-gnu status = major = 2 minor = 4.1 year = 2006 month = 12 day = 18 svn rev = 40228 language = R version.string = R version 2.4.1 (2006-12-18) Locale: LC_CTYPE=it_IT.UTF-8;LC_NUMERIC=C;LC_TIME=it_IT.UTF-8;LC_COLLATE=it_IT.UTF-8;LC_MONETARY=it_IT.UTF-8;LC_MESSAGES=it_IT.UTF-8;LC_PAPER=it_IT.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=it_IT.UTF-8;LC_IDENTIFICATION=C Search Path: .GlobalEnv, package:MASS, package:utils, package:stats, package:graphics, package:grDevices, package:methods, Autoloads, package:base __ R-help@stat.math.ethz.ch 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.
[R] r.lang for "highlight" software
Dear helpeRs, I apologies if I'll go OT, but I would like to know if someone has yet scripted an "R language definition file" for "highlight" (software for syntax highlight, webpage at http://www.andre-simon.de/ ) better than default one which come with installation (on my Debian it's /usr/share/highlight/langDefs/r.lang). If yes, is it accessable via web? Thanks in advance Luca __ R-help@stat.math.ethz.ch 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.