Skip to content

switch with a single character

2 messages · Henrik Andersson, Charles C. Berry

#
Can anyone explain the results from switch below when a single
charachter "E" is entered? It seems to work with letter S or N...
[1] 2
[1] 1
[1] "E"
[1] -1

Kind regards, Henrik
#
On Thu, 6 Mar 2008, Henrik Andersson wrote:

            
?switch
.
.
.

Warning:

      Beware of partial matching: an alternative 'E = foo' will match
      the first argument 'EXPR' unless that is named. See the examples
      for good practice in naming the first argument.

HTH,

Chuck
Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901