@startz answer you should mark as the solution. To see more detail use help() for the two functions.
For help(mean) the argument, x
x An R object. Currently there are methods for numeric/logical vectors and date, date-time and time interval objects. Complex vectors are allowed for trim = 0, only.
That tells you that only dates and numbers can be used.
For help(median) the argument x
x an object for which a method has been defined, or a numeric vector containing the values whose median is to be computed.
is a little trickier. You can use numbers, it clearly says, but what is "an object for which a method has been defined?"
That's a bit of R geekery, which means that the default can be modified by a "method." But the interesting part is in Details
the default method will work for most classes (e.g., "Date") for which a median is a reasonable concept.
Why are characters a reasonable concept? Because they are ordered. a is less than c and c is less than a. For example:
> letters[c(1,3,2)]
#[1] "a" "c" "b"
the number being used is an integer index.
Note, however, that this works only for an odd number of arguments.
> median("a","c","b","d")
Error in if (na.rm) x <- x[!is.na(x)] else if (any(is.na(x))) return(x[FALSE][NA]) : argument is not interpretable as logical
because you can't have half an index.