added serialization / unserialization of an R object