Re: [R] Minor warning about seq
I believe the R intro manual and R-inferno have some pretty stern warnings about never using 'c' or 't' as variable names, for obvious reasons. Similarly, I nearly crushed some code once by writing a nice little function to find the mode of a data set and calling the function mode() . (conflicts w/ an R builtin). Ended up calling it 'smode' . Carl From: Dieter Menne dieter.menne_at_menne-biomed.de Date: Wed, 01 Dec 2010 00:14:17 -0800 (PST) Prof. John C Nash wrote: I spent more time than I should have debugging a script because I wanted x-seq(0,100)*0.1 but typed x-seq(O:100)*0.1 seq(0:100) yields 1 to 101, Which leads us to another rule: never use a variable called O. I remember this was a no-no even in my first Algol-course in 1967. __ R-help@r-project.org 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.
Re: [R] Minor warning about seq
Prof. John C Nash wrote: I spent more time than I should have debugging a script because I wanted x-seq(0,100)*0.1 but typed x-seq(O:100)*0.1 seq(0:100) yields 1 to 101, Which leads us to another rule: never use a variable called O. I remember this was a no-no even in my first Algol-course in 1967. In a virginal Rgui: x-seq(O:100)*0.1 Error in seq(O:100) : object 'O' not found Dieter -- View this message in context: http://r.789695.n4.nabble.com/Minor-warning-about-seq-tp3065964p3066791.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org 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.
Re: [R] Minor warning about seq
I think both responses so far have missed the point, (assuming the O was a typo for zero). That is: seq(0:1) [1] 1 2 when seq(0,1) [1] 0 1 was intended. Ray Brownrigg On Wed, 01 Dec 2010, Ista Zahn wrote: So you are warning us that you must type zero instead of the letter O when we want to enter the value of zero? Seems pretty obvious... -Ista On Tue, Nov 30, 2010 at 1:49 PM, Prof. John C Nash nas...@uottawa.ca wrote: I spent more time than I should have debugging a script because I wanted x-seq(0,100)*0.1 but typed x-seq(O:100)*0.1 seq(0:100) yields 1 to 101, Clearly my own brain to fingers fumble, but possibly one others may want to avoid it. JN __ R-help@r-project.org 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-help@r-project.org 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.
Re: [R] Minor warning about seq
So you are warning us that you must type zero instead of the letter O when we want to enter the value of zero? Seems pretty obvious... -Ista On Tue, Nov 30, 2010 at 1:49 PM, Prof. John C Nash nas...@uottawa.ca wrote: I spent more time than I should have debugging a script because I wanted x-seq(0,100)*0.1 but typed x-seq(O:100)*0.1 seq(0:100) yields 1 to 101, Clearly my own brain to fingers fumble, but possibly one others may want to avoid it. JN __ R-help@r-project.org 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. -- Ista Zahn Graduate student University of Rochester Department of Clinical and Social Psychology http://yourpsyche.org __ R-help@r-project.org 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.