> Suharto Anggono Suharto Anggono
> on Sat, 12 Apr 2025 08:27:26 + (UTC) writes:
> For NA case (x == NA_LOGICAL), if R_print.na_width > NB-1 , the "fast
path" for 'EncodeLogical' that I propose previously behaves differently from
the general case that truncates at (NB-1).
Y
For NA case (x == NA_LOGICAL), if R_print.na_width > NB-1 , the "fast path" for
'EncodeLogical' that I propose previously behaves differently from the general
case that truncates at (NB-1).
To be consistent with the general case,
if(w == R_print.na_width)
can be replaced with
if(w == R_print.na_
On 4/11/25 16:23, Suharto Anggono Suharto Anggono via R-devel wrote:
Alternative revision:
Added to my changed 'StringFromLogical':
#define CACHE 16
if (!(*warn & CACHE)) {TrueCh = FalseCh = NULL; *warn |= CACHE;}
No change to 'coerceToString' and 'coerceToSymbol'.
--
On Friday
Alternative revision:
Added to my changed 'StringFromLogical':
#define CACHE 16
if (!(*warn & CACHE)) {TrueCh = FalseCh = NULL; *warn |= CACHE;}
No change to 'coerceToString' and 'coerceToSymbol'.
--
On Friday, 11 April 2025 at 08:02:58 pm GMT+7, Suharto Anggono Suharto Anggono
wr
Oh, with the abuse of 'warn' in my previous message, warning would be issued
if the input 'v' of 'coerceToString' is a logical vector of length 1.
Revision:
Added to my changed 'StringFromLogical':
if (*warn) {TrueCh = FalseCh = NULL; *warn = 0;}
'coerceToString': insert
if (i == 0) warn = 1;
On second thought, I wonder if the caching in my changed 'StringFromLogical'
in my previous message is safe. While 'ans' in the C function 'coerceToString'
is protected, its element is also protected. If the object corresponding to
'ans' is then no longer protected, is it possible for the cache
Right, thanks! These are non-standard uses of factor(), edge cases I
alluded to. We didn't see any problems with the patch in existing tests
nor in CRAN/BIOC package checks. Note that 'levels' is documented as
an optional vector of the unique values (as character
strings) that ‘x’ might
> Suharto Anggono Suharto Anggono via R-devel
> on Thu, 10 Apr 2025 07:53:04 + (UTC) writes:
> Chain of calls of C functions in coerce.c for as.character() in
R:
> do_asatomic
> ascommon
> coerceVector
> coerceToString
> StringFromLogical (for each elemen
Chain of calls of C functions in coerce.c for as.character() in R:
do_asatomic
ascommon
coerceVector
coerceToString
StringFromLogical (for each element)
The definition of 'StringFromLogical' in coerce.c :
attribute_hidden SEXP StringFromLogical(int x, int *warn)
{
int w;
formatLogical(&x,
With the change to 'factor',
factor(1L, levels = TRUE)
doesn't give NA, different from
factor(1, levels = TRUE)
With the change to 'factor',
factor(TRUE, levels = 1L)
and
factor(TRUE, levels = 1)
don't give NA.
With the change to 'factor',
factor(2L, levels = sqrt(2)^2)
gives NA, different from
f
Am 21.03.25 um 15:42 schrieb Aidan Lakshman via R-devel:
After investigating the source of table, I ended up on the reason being
“as.character()”:
This is specifically happening within the conversion of the input to type
factor, which is where the as.character conversion happens.
Yes, I als
Some small points to add on this discussion:
> After investigating the source of table, I ended up on the reason being
> “as.character()”:
This is specifically happening within the conversion of the input to type
factor, which is where the as.character conversion happens.
# Timing is all on
12 matches
Mail list logo