Losing S3 class: Why does POSIXlt behave differently when this happens inside vs. outside of a data.frame?
Summary This incident examines why S3 objects lose their class when assigned into incompatible vectors, and why POSIXlt shows different behavior inside vs. outside a data.frame. The short answer: data.frame assignment uses a different coercion path, and POSIXlt is a deeply unusual S3 class implemented as a list, which triggers R’s internal recycling and coercion … Read more