R: f(x) != sapply(x,f) -- bug or feature?
===

    > f =  function(x) as.Date(as.character(x), format='%Y%m%d')
    > f(20110606)
    [1] "2011-06-06"
    > sapply(20110606, f)
    [1] 15131

Why 2 returned values are not the same. I need to apply this function to a long vector of dates, but I'm not getting dates with sapply()!