Skip to content
Back to formatted view

Raw Message

Message-ID: <AF9753DB-119B-4C6F-ADBC-FAEEE2A1A350@dcn.davis.ca.us>
Date: 2020-08-29T15:53:14Z
From: Jeff Newmiller
Subject: serialize does not work as expected
In-Reply-To: <526e2d4d-5b31-339c-ed75-e310b87f6b28@wiwi.hu-berlin.de>

Did you really conclude from looking at class that they were identical?

Numeric mode sometimes makes it hard to distinguish integers from doubles, but they are different.

On August 29, 2020 8:34:29 AM PDT, Sigbert Klinke <sigbert at wiwi.hu-berlin.de> wrote:
>Hi,
>
>if I create a list with
>
>l <- list(1:3, as.numeric(1:3), c(1,2,3))
>
>and applying
>
>lapply(l, 'class')
>lapply(l, 'mode')
>lapply(l, 'storage.mode')
>lapply(l, 'typeof')
>identical(l[[2]], l[[3]])
>
>then I would believe that as,numeric(1:3) and c(1,2,3) are identical 
>objects. However,
>
>lapply(l, serialize, connection=NULL)
>
>returns different results for each list element :(
>
>Any ideas, why it is like that?
>
>Best Sigbert

-- 
Sent from my phone. Please excuse my brevity.