Thaden, John J
2006-Jul-28 09:53 UTC
[R] order() 'decreasing =' argument must be typed in full
## While in R v. 2.3.1 (the mid-July patch for Windows) ## on a Windows XP machine, this call to order() works fine... order(1:10,decreasing = TRUE) ## [1] 10 9 8 7 6 5 4 3 2 1 ## ...however, the argument name 'decreasing' ## must be typed in toto (note the missing 'g' ## in the following):> order(1:10,decreasin = TRUE)## Error in order(na.last, decreasing, ...) : ## argument lengths differ ## Isn't is standard practice to have R base functions ## accept truncated argument names as long as they are ## unambiguous? Thanks, John Thaden, Ph.D. Confidentiality Notice: This e-mail message, including any a...{{dropped}}
Berwin A Turlach
2006-Jul-28 10:12 UTC
[R] order() 'decreasing =' argument must be typed in full
G'day John,>>>>> "JT" == Thaden, John J <ThadenJohnJ at uams.edu> writes:JT> Isn't is standard practice to have R base functions accept JT> truncated argument names as long as they are unambiguous? No. :) The help page of order states: Usage: order(..., na.last = TRUE, decreasing = FALSE) Standard practice in R is that arguments behind ... are only matched by "exact matching", i.e., you have to specify the tag of that argument in full. Details on how arguments are matched are in the section "Argument matching" of "The R Language Definition" (and all though this is a draft, that part seems to be authoritative :) ). Cheers, Berwin ========================== Full address ===========================Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr) School of Mathematics and Statistics +61 (8) 6488 3383 (self) The University of Western Australia FAX : +61 (8) 6488 1028 35 Stirling Highway Crawley WA 6009 e-mail: berwin at maths.uwa.edu.au Australia http://www.maths.uwa.edu.au/~berwin