From suharto_anggono at yahoo.com  Sat Oct  8 16:42:46 2016
From: suharto_anggono at yahoo.com (Suharto Anggono Suharto Anggono)
Date: Sat, 8 Oct 2016 14:42:46 +0000 (UTC)
Subject: [Rd] 'max' on mixed numeric and character arguments
References: <1873513454.533658.1475937766535.ref@mail.yahoo.com>
Message-ID: <1873513454.533658.1475937766535@mail.yahoo.com>

Bug 17160 (https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17160) leads me to ask this. In R, should max(...) equals max(c(...)) ? If 'max' have both numeric and character arguments, should lexicographic sorting be used for all?

> max("", 3, 10)
[1] "3"
> max("", c(3, 10))
[1] "10"
> range("", c(3, 10))[2]
[1] "3"

Should all above have the same result?

> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows XP (build 2600) Service Pack 2

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base



[Rd] 'max' on mixed numeric and character arguments
Suharto Anggono Suharto Anggono