Thomas W Blackwell
2003-Nov-02 20:28 UTC
[R] cannot have a function argument named 'break'
Dear list - I just discovered to my surprise that I cannot define a function with an argument named 'break' or 'while'! 'breaks' is okay. Maybe this is no surprise to the R developers. R-1.7.1, 2003-06-16, i686-pc-linux-gnu. - tom blackwell - u michigan medical school - ann arbor -
Yup. R 1.8.0 gives me a syntax error from "if", also: > iff <- function(if)if Error: syntax error spencer graves Thomas W Blackwell wrote:>Dear list - > >I just discovered to my surprise that I cannot define >a function with an argument named 'break' or 'while'! >'breaks' is okay. Maybe this is no surprise to the R >developers. > >R-1.7.1, 2003-06-16, i686-pc-linux-gnu. > >- tom blackwell - u michigan medical school - ann arbor - > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://www.stat.math.ethz.ch/mailman/listinfo/r-help > >
On Sun, 2 Nov 2003, Thomas W Blackwell wrote:> Dear list - > > I just discovered to my surprise that I cannot define > a function with an argument named 'break' or 'while'! > 'breaks' is okay. Maybe this is no surprise to the R > developers.You can't use any of the words that are part of the R language (as opposed to functions). The ones I can think of are for while repeat next break if else function -thomas Thomas Lumley Assoc. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle