Type Conversions in R