src/main/attrib.c
r87863
'TRUE' is not replaced with 'true' in functions 'row_names_gets',
'isOneDimensionalArray', 'getAttrib0', 'copyMostAttribNoTs', 'classgets',
'R_data_class2'.
But it works fine.
src/main/main.c
r87863
'FALSE' is not replaced with 'false' in
bool wasDisplayed = FALSE;
way, the comment in 'formatLogical' implies that 5 "is the widest it can
be, so stop". It is not true if R_print.na_width > 5 .
The output of
print(c(FALSE, NA), na.print = "**")
is not as it should be.
On Thursday, 10 April 2025 at 10
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+
;coerceToString': insert
if (i == 0) warn = 1;
for LGLSXP case or initialize 'warn' to 16
'coerceToSymbol': insert
warn = 1;
for LGLSXP case or initialize 'warn' to 16
Another way is following the approach of caching in ''StringFromInteger'.
nged 'StringFromLogical'.
if (*warn) TrueCh = FalseCh = NULL;
Correspondingly, in 'coerceToString',
warn = i == 0;
is inserted before
SET_STRING_ELT(ans, i, StringFromLogical(LOGICAL_ELT(v, i), &warn));
for LGLSXP case.
---------
On Thursday, 10 April
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
In function 'Summary.Date' in dates.R ,
..1
could be used instead of
...elt(1L)
In function 'format.POSIXlt' in datetime.R ,
unlist(unclass(x)[1L:3L], use.names=FALSE)
could be used instead of
unlist(`names<-`(unclass(x)[1L:3L], NULL))
Also, the fragment
secs <- x$sec[f0]; secs <- secs[is.finite(s
With
if (!j--) {
R_CheckUserInterrupt();
j = 1;
}
as in current R devel (r83976), j goes negative (-1) and interrupt is checked
every 10001 instead of 1. I prefer
if (!--j) {
R_CheckUserInterrupt();
j = 1;
}
.
In current R devel (r83976), if EOF is reach
e remains.
x <- as.POSIXlt(as.POSIXct("2013-01-31", tz = "America/Chicago"))
Sys.setenv(TZ = "UTC")
x[1] <- NA
# Error in x[[n]][i] <- value[[n]] : replacement has length zero
---
On Saturday, 22 October 2022, 07:12:51 pm GMT+7, Mar
I think '[.POSIXlt' and '[<-.POSIXlt' don't need to normalize out-of-range
values. I think they just make same length for all components, to ensure
correct extraction or replacement for arbitrary index.
I have a thought of adding an optional argument for 'as.POSIXlt' applied to
"POSIXlt" object
'year', 'mon', or 'mday' of 'r1' is then modified. It may have more
than one elements. For 'mon' or 'mday', some may be out-of-bounds.
On Monday, 3 October 2022, 11:58:53 pm GMT+7, Martin Maechler
wrote:
>
onday, 3 October 2022, 11:58:53 pm GMT+7, Martin Maechler
wrote:
>>>>> Martin Maechler
>>>>>on Mon, 3 Oct 2022 14:46:08 +0200 writes:
>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>>on Sun, 2 Oct 2022 08:42:50 + (UTC
With r82904, 'as.character.POSIXt' in R devel is changed. The NEWS item:
as.character() now behaves more in line with the
methods for atomic vectors such as numbers, and is no longer
influenced by options().
Part of the code:
s <- trunc(x$sec)
fs <- x$sec - s
r1 <- sp
This issue has come up before:
https://stat.ethz.ch/pipermail/r-help/2013-February/346721.html ("gettext
wierdness"), https://stat.ethz.ch/pipermail/r-devel/2007-December/047893.html
("gettext() and messages in 'pkg' domain").
Using 'ngettext' is a workaround, like in
https://rdrr.io/cran/svMi
By r80949, 'formatC' code in R devel has
if (!(n <- length(x))) return(character())
If 'x' has length zero, the return value of 'formatC' doesn't have attributes.
It doesn't follow the documented "Value": "A character object of the same size
and attributes as x".
Based on my observation, th
In summary.c, in function 'isum', the loop is 'ITERATE_BY_REGION' that contains
'for' loop
for (int k = 0; k < nbatch; k++)
It is since SVN revision 73445, in released R since version 3.5.0.
Previously, the loop is
for (R_xlen_t i = 0; i < n; i++)
Inside 'ITERATE_BY_REGION', the type of the ind
This is about R 4.0.2 (or 4.0.1) help on 'paste'.
End part of the first paragraph in "Details" section:
If the arguments are vectors, they are concatenated term-by-term to give a
character vector result. Vector arguments are recycled as needed, with
zero-length arguments being recycled to '""'
In "An Introduction to R", in "Appendix A A sample session", in the part on
Michelson data, information for
attach(mm)
is
Make the data frame visible at position 3 (the default).
In fact, the 'attach' is at position 2.
__
R-devel@r-project.org maili
In 'conformMethod', there is another instance of
omittedSig & .
It just affects error message.
Original:
if(any(is.na(match(signature[omittedSig], c("ANY", "missing") {
bad <- omittedSig & is.na(match(signature[omittedSig], c("ANY",
"missing")))
After r76756:
if(any(iiN <- i
Here is a patch to function 'stopifnot' that adds 'evaluated' argument and
makes 'exprs' argument in 'stopifnot' like 'exprs' argument in 'withAutoprint'.
--- stop.R 2019-05-30 14:01:15.282197286 +
+++ stop_new.R 2019-05-30 14:01:51.372187466 +
@@ -31,7 +31,7 @@
.Internal(s
rror message from 'stopifnot' includes
call since R 3.5.0. Such an example is in
https://stat.ethz.ch/pipermail/r-devel/2017-May/074303.html .
On Mon, 1/4/19, Martin Maechler wrote:
Subject: Re: [Rd] stopifnot
Cc: r-devel@r-project.org
lso,
'tryCatch' (or 'withCallingHandlers' ...) can wrap the entire 'for' loop. The
slowdown can be less than in R 3.5.x.
On Mon, 1/4/19, Martin Maechler wrote:
Subject: Re: [Rd] stopifnot -- eval(*) inside for()
== 1, 2 < 1, stop("NOT
GOOD!\n" :
expression(1 == 1, 2 < 1, stop("NOT GOOD!\n")) are not all TRUE
To be the same as in R 3.5.x, the 'else' can be
as.call(c(quote(expression), as.expression(exprs)))
On Wed, 6/
In current R devel (r76247), "See Also" section of help page on
'txtProgressBar'
(https://svn.r-project.org/R/trunk/src/library/utils/man/txtProgressBar.Rd) has
"Unix-alike platforms" as a detail on 'tkProgressBar':
\seealso{
\code{\link{winProgressBar}} (Windows only),
\code{\link{tkProgres
se' clause for 'cl' gives
call("expression", exprs) .
For
do.call(stopifnot, list(exprs = expression())) ,
the whole expression object is taken as one.
do.call(stopifnot, list(exprs = expression(1==1, 2 < 1, stop("NOT GOOD!\n"
Error in do.call(stopifnot, list(exprs = expression(1 == 1, 2 < 1, stop(&quo
On Mon, 4/3/19, Martin Maechler wrote:
Subject: Re: [Rd] stopifnot
Cc: r-devel@r-project.org
Date: Monday, 4 March, 2019, 4:59 PM
>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>> on Sat, 2 Mar 2019 08:28:23 + w
Instead of
if(!is.null(names(cl))) names(cl) <- NULL ,
just
names(cl) <- NULL
looks simpler and the memory usage and speed is not bad in my little experiment.
Subject: Re: [Rd] stopifnot
To: r-devel@r-project.org
Date: Saturday, 2 March, 2019, 3:28
(simpleError(msg, call = if(n > 1) sys.call(n-1)))
}
}
invisible()
On Fri, 1/3/19, Martin Maechler wrote:
Subject: Re: [Rd] stopifnot
Cc: "Martin Maechler" , r-devel@r-project.org
Date: Friday, 1 March, 2019, 6:40 PM
tical(sys.function(p), stopifnot) &&
+ !eval(expression(missE), p)) # originally stopifnot(exprs=*)
+ p <- sys.parent(2)
+ stop(simpleError(msg, call = if(p) sys.call(p)))
}
}
invisible()
--
>From https://github.com/HenrikBengtsson/Wishlist-for-R/issues/70 :
... and follow up note from 2018-03-15: Ouch... in R-devel, stopifnot() has
become yet 4-5 times slower;
...
which is due to a complete rewrite using tryCatch() and withCallingHandlers().
>From https://stat.ethz.ch/pipermail/r-
-
On Fri, 15/2/19, Martin Maechler wrote:
Subject: Re: [Rd] Extract.data.frame.Rd about $.data.frame
Cc: r-devel@r-project.org
Date: Friday, 15 February, 2019, 4:15 PM
>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>>on Sun, 10 Feb 2019 16
In R devel, data.frame method of '$' has been removed, but this part of
"Details" section of Extract.data.frame.Rd still implies existence of the
method.
The \code{data.frame} method for \code{$}, treats \code{x} as a
list, except that (as of R-3.1.0) partial matching of \code{name} to
the
After r75387, function 'split.default' in R devel still has this part that no
longer has effect.
lf <- levels(f)
y <- vector("list", length(lf))
names(y) <- lf
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-dev
: [Rd] Proposal: more accurate seq(from, to, length=n)
Cc: "r-devel"
Date: Saturday, 8 September, 2018, 5:38 AM
Suharto,
My 2c
inline.
On Fri,
Sep 7, 2018 at 2:34 PM, Suharto Anggono Suharto Anggono via
R-devel
wrote:
In R,
seq(0, 1, 0.1)
gives the same result as
(0:10)*
In R,
seq(0, 1, 0.1)
gives the same result as
(0:10)*0.1.
It is not the same as
c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1) ,
as 0.1 is not represented exactly. I am fine with it.
In R,
seq(0, 1, length=11)
gives the same result as
seq(0, 1, 0.1).
However, for
seq(0, 1, length=11),
it is
In R, family has aic component since version 0.62. There is no aic component in
family in R 0.61.3.
Looking at blame,
https://github.com/wch/r-source/blame/tags/R-0-62/src/library/base/R/family.R ,
aic component in family is introduced in svn revision 640
(https://github.com/wch/r-source/commi
Does anyone notice r-devel thread "stopifnot() does not stop at first non-TRUE
argument" starting with
https://stat.ethz.ch/pipermail/r-devel/2017-May/074179.html ?
I have mentioned
(function(...)nargs())(...)
in https://stat.ethz.ch/pipermail/r-devel/2017-May/074294.html .
Something like ..elt
> .Internal(inspect(1:10))
@300e4e8 13 INTSXP g0c0 [NAM(3)] 1 : 10 (compact)
> .Internal(inspect(seq(1,10)))
@3b6e1f8 13 INTSXP g0c4 [] (len=10, tl=0) 1,2,3,4,5,...
> system.time(1:1e7)
user system elapsed
0 0 0
> system.time(seq(1,1e7))
user system elapsed
0.050.0
In the code of functions 'order' and 'sort.list' in R 3.5.0 alpha (in
https://svn.r-project.org/R/branches/R-3-5-branch/src/library/base/R/sort.R),
in "fastpass, take advantage of ALTREP metadata", there is "try the reverse
since that's easy too...". If it succeeds, ties are reordered, violating
I am raising this again.
As
as.character(list(c(one = "1")))
is still
"1"
in R 3.5.0 alpha, could
as.character(list(c(one = 1)))
be
"1"
, too, as before?
The case here is the list component is atomic with length 1.
--------
On
I am trying once again.
By just changing
f <- match(xlevs[f], nlevs)
to
f <- match(xlevs, nlevs)[f]
, function 'factor' in R devel could be made more consistent and
back-compatible. Why not picking it?
On Sat, 25/11/17, Suharto
Logic.Rd has been changed again in r74377. After change:
\item{x, y}{raw or logical or \sQuote{number-like} vectors (i.e., of
types \code{\link{double}} (class \code{\link{numeric}},
\code{\link{integer}}) and \code{\link{complex}}), or objects for
It is still inappropriate. As I said be
Logic.Rd is one of the files changed in r74363.
Before change:
\item{x, y}{raw or logical or \sQuote{number-like} vectors (i.e., of types
\code{\link{double}} (class \code{\link{numeric}}), \code{\link{integer}}
and \code{\link{complex}})), or objects for
After change:
\item{x, y}{raw
x <- 0; names(x) <- "recursive"
I am saying more plainly: With 'x' above, deparse(x, control = "all") is wrong
in R devel.
------------
On Sat, 16/12/17, Suharto Anggono Suharto Anggono
wrote:
Subject: Nice names in depa
Maybe behavior of 'as.list' in R is not inherited from S?
- From https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=78 , in "the
prototype" (S), 'as.list' on a data frame gave a list, not a data frame as
given by the default 'as.list' in R. That led to introduction of
'as.list.data.frame'.
- F
Tags (argument names) in call to 'list' becomes names of the result. It is not
necessarily so with call to 'c'. The default method of 'c' has 'recursive' and
'use.names' arguments.
In R devel r73778, with
x <- 0; names(x) <- "recursive" ,
dput(x)
or even
dput(x, control = "all")
gives
c(recursi
length(xlevs) .
[snip]
On Wed, 18/10/17, Martin Maechler wrote:
Subject: Re: [Rd] Function 'factor' issues
Cc: r-devel@r-project.org
Date: Wednesday, 18 October, 2017, 11:54 PM
>>>>> Suharto Anggono Suharto Anggono via R
ct.org, maech...@stat.math.ethz.ch
Date: Monday, 28 November, 2016, 10:00 PM
>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>> on Sat, 26 Nov 2016 17:14:01 + writes:
...
> On current 'ifelse' code in R:
> * The part
> ans[nas]
x) in R devel:
'as.character', 'order', 'unique' corresponding to '['. Take data frame and
"Surv" object (package survival) as examples.
On Wed, 18/10/17, Martin Maechler wrote:
Subject: Re: [Rd] Fu
In R devel, function 'factor' has been changed, allowing and merging duplicated
'labels'.
Issue 1: Handling of specified 'labels' without duplicates is slower than
before.
Example:
x <- rep(1:26, 4)
system.time(factor(x, levels=1:26, labels=letters))
Function 'factor' is already rather slow
Currently, in function 'logicalSubscript' in subscript.c, the case of no
recycling is handled like the implentation of R function 'which'. It passes
through the data only once, but uses more memory. It is since R 3.3.0. For the
case of recycling, two passes are done, first to get number of eleme
Previous mentions:
- https://stat.ethz.ch/pipermail/r-devel/2017-July/074723.html
- https://stat.ethz.ch/pipermail/r-devel/2017-August/074737.html
The NEWS item corresponding to PR#17284 is in "CHANGES in R-devel". However,
fix for PR#17284 is already included in R 3.4.2 beta.
__
A recent R devel NEWS item: approx(), spline(), splinefun() and approxfun()
also work for long vectors.
In current R devel, in function 'approx1' in src/library/stats/src/approx.c and
in function 'spline_eval' in src/library/stats/splines.c, in
#ifdef LONG_VECTOR_SUPPORT
there is a comment "R_xl
/pretty.c
Cc: r-devel@r-project.org
Date: Saturday, 19 August, 2017, 7:47 PM
>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>> on Fri, 18 Aug 2017 15:44:06 + writes:
> Examples similar to
> pretty(c(-1,1)*1e300, n = 1e9, min.n = 1)
>
;>>> Martin Maechler
>>>>> on Mon, 14 Aug 2017 11:46:07 +0200 writes:
>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>> on Fri, 11 Aug 2017 17:11:06 + writes:
>>>>> Suharto Anggono Suharto Anggono via R-devel
See https://stat.ethz.ch/pipermail/r-devel/2017-August/074746.html for the
origin of the example here.
That
pretty(c(-1,1)*1e300, n = 1e9, min.n = 1) gave 20 intervals, far from 1e9, but
pretty(c(-1,1)*1e300, n = 1e6, min.n = 1) gave 100 intervals
(on a machine), made me trace through the cod
7, 8:38 PM
>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>> on Sun, 30 Jul 2017 14:57:53 + writes:
> R devel's bind.c has been ported to R patched. Is it OK while names of
'unlist' or 'c' result may be not strictly the
Kalibera wrote:
Subject: Re: [Rd] translateChar in NewName in bind.c
@r-project.org
Date: Tuesday, 13 June, 2017, 2:35 PM
Thanks, fixed in R-devel.
Best
Tomas
On
06/11/2017 02:30 PM, Suharto Anggono Suharto Anggono via
R-devel wrote:
> I see another thing in
function 'NewNa
factor subsetting ('[.factor') knows "contrasts"
attribute.
--------------------
On Sat, 10/6/17, Martin Maechler wrote:
Subject: Re: [Rd] [bug] droplevels() also drop object attributes (comment…)
To: "R Development"
Cc: "Serge Bibau
I see another thing in function 'NewName' in bind.c. In
else if (*CHAR(tag)) ,
'ans' is basically copied from 'tag'. Could the whole thing there be just the
following?
ans = tag;
It seems to me that it can also replace
ans = R_BlankString;
in 'else'; so,
else if (*CHAR(tag))
and
else
can be merged
In function 'NewName' in bind.c
(https://svn.r-project.org/R/trunk/src/main/bind.c), in
else if (*CHAR(base)) ,
'translateChar' is used. Should it be 'translateCharUTF8' instead? The end
result is marked as UTF-8:
mkCharCE(cbuf, CE_UTF8)
Other cases already use 'translateCharUTF8'.
_
* Be careful with "contrasts" attribute. If the number of levels is reduced,
the original contrasts matrix is no longer valid.
Example case:
x <- factor(c("a", "a", "b", "b", "b"), levels = c("a", "b", "c"))
contrasts(x) <- contr.treatment(levels(x), contrasts=FALSE)[, -2, drop=FALSE]
droplevels(x
Subject: Re: [Rd] stopifnot() does not stop at first non-TRUE argument
Cc: r-devel@r-project.org
Date: Thursday, 18 May, 2017, 3:03 PM
>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>> on Tue, 16 May 2017 16:37:45 + writes:
> switch(i,
switch(i, ...)
extracts 'i'-th argument in '...'. It is like
eval(as.name(paste0("..", i))) .
Just mentioning other things:
- For 'n',
n <- nargs()
can be used.
- sys.call() can be used in place of match.call() .
---
> peter dalgaard
> on Mon, 15 May 2017 16:28
In R 3.4.0 RC, argument list of 'c' as S4 generic function has become
(x, ...) .
However, "S4 methods" section in documentation of 'c' (c.Rd) is not updated yet.
Also, in R 3.4.0 RC, 'c' method of class "Date" ('c.Date') is still not
explicitly documented.
___
I am raising this again.
With
z <- complex(real = c(0,NaN,NaN), imaginary = c(NA,NA,0)) ,
results of
sapply(z, match, table = z)
and
match(z, z)
are different in R 3.4.0 alpha. I think they should be the same.
I suggest changing 'cequal' in unique.c such that a complex number that has
both NA an
that will last long, I think.
On Mon, 27/2/17, Martin Maechler wrote:
Subject: Re: [Rd] rep/rep.int: in NEWS, but not yet ported from trunk
Cc: R-devel@r-project.org
Date: Monday, 27 February, 2017, 4:20 PM
>>>>> Suharto Anggono
According to "CHANGES IN R 3.3.2 patched" in NEWS, rep(x, times) and rep.int(x,
times) also work when 'times' has length greater than one and has element
larger than the maximal integer. In fact, it is still not the case in R 3.3.3
beta r72259. In seq.c
(https://svn.r-project.org/R/branches/R-3
a(default) is TRUE and user-specified 'default' is
NaN.
On Sat, 4/2/17, Martin Maechler wrote:
Subject: Re: [Rd] RFC: tapply(*, ..., init.value = NA)
Cc: R-devel@r-project.org
Date: Saturday, 4 February, 2017, 10:48 PM
>>>>&g
Function 'stopifnot' in R devel r72104 has this.
head <- function(x, n = 6L) ## basically utils:::head.default()
x[if(n < 0L) max(length(x) + n, 0L) else min(n, length(x))]
If definition like utils:::head.default is intended, the index of 'x' should be
wrapped in seq_len(...):
x[seq_l
NA)
Cc: R-devel@r-project.org
Date: Wednesday, 1 February, 2017, 12:14 AM
>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>> on Tue, 31 Jan 2017 15:43:53 + writes:
> Function 'aggregate.data.frame' in R has taken a different
Function 'aggregate.data.frame' in R has taken a different route. With
drop=FALSE, the function is also applied to subset corresponding to combination
of grouping variables that doesn't appear in the data (example 2 in
https://stat.ethz.ch/pipermail/r-devel/2017-January/073678.html).
Because 'd
The "no factor combination" case is distinguishable by 'tapply' with
simplify=FALSE.
> D2 <- data.frame(n = gl(3,4), L = gl(6,2, labels=LETTERS[1:6]), N=3)
> D2 <- D2[-c(1,5), ]
> DN <- D2; DN[1,"N"] <- NA
> with(DN, tapply(N, list(n,L), FUN=sum, simplify=FALSE))
ABCDEF
1 NA
Interspersed below.
Subject: Re: ifelse() woes ... can we agree on a ifelse2() ?
To: r-de...@lists.r-project.org
Date: Sunday, 27 November, 2016, 12:14 AM
On current 'ifelse' code in R:
...
* If 'test' is a factor, doing
storage.mode(test) <- "log
Related to the length of 'ifelse' result, I want to say that "example of
different return modes" in ?ifelse led me to perceive a wrong thing in the past.
## example of different return modes:
yes <- 1:3
no <- pi^(0:3)
typeof(ifelse(NA,yes, no)) # logical
typeof(ifelse
For S Ellison, just clarifying, I am Suharto Anggono, not Martin Maechler.
"Martin et al.," from my previous E-mail was the beginning of message from
Gabriel Becker, that I quoted.
The quoted "still a bit disappointed that nobody has taken a look" is from
Martin Maechler.
In all of the proposed
Just stating, in 'ifelse', 'test' is not recycled. As I said in "R-intro:
length of 'ifelse' result"
(https://stat.ethz.ch/pipermail/r-devel/2016-September/073136.html),
ifelse(condition, a, b) returns a vector of the length of 'condition', even if
'a' or 'b' is longer.
On current 'ifelse' cod
Function 'do_mapply' in mapply.c has the following fragment.
for (int i = 0; i < longest; i++) {
Variable 'longest' is declared as R_xlen_t. Its value can be larger than the
maximum int.
In the fragment, when 'longest' is larger than the maximum int, when 'i'
reaches the maximum int, i++ wi
I report here that, in RStudio in Data Scientist Workbench,
lapply(raw(2^31), function(x) NULL)
failed after not so long time.
> res <- lapply(raw(2^31), function(x) NULL)
Error in FUN(X[[i]], ...) : long vectors not supported yet: memory.c:1652
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platfor
Bug 17160 (https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17160) leads me
to ask this. In R, should max(...) equals max(c(...)) ? If 'max' have both
numeric and character arguments, should lexicographic sorting be used for all?
> max("", 3, 10)
[1] "3"
> max("", c(3, 10))
[1] "10"
> range(
27; is in the output. That's precisely because 'c.Date' doesn't
have 'use.names', so that 'use.names' is absorbed into '...'.
On Sun, 25/9/16, Martin Maechler wrote:
Subject: Re: [Rd] Undocumented
st", TRUE, 2)
>>>> c(A=1,B=2,use.names=FALSE)
>>> A B use.names
>>> 1 2 0
>>>
>>> The C code used sys_index==2 to mean 'the last argument is the
'use.names'
>>> argument, if sys_index=
In S-PLUS 3.4 help on 'c'
(http://www.uni-muenster.de/ZIV.BennoSueselbeck/s-html/helpfiles/c.html), there
is no 'use.names' argument.
Because 'c' is a generic function, I don't think that changing formal arguments
is good.
In R devel r71344, 'use.names' is not an argument of functions 'c.Date'
In "An Introduction to R" Version 3.3.1, in "9.2.1 Conditional execution: if
statements", the last paragraph is the following:
There is a vectorized version of the if/else construct, the ifelse function.
This has the form ifelse(condition, a, b) and returns a vector of the length of
its longest
Looking at the code of function 'table' in R devel r71227, I see that the part
"remove NA level if it was added only for excluded in factor(a, exclude=.)" is
not quite right.
In
is.na(a) <- match(a0, c(exclude,NA), nomatch=0L) ,
I think that what is intended is
In "An Introduction to R" Version 3.3.1, in "4.2 The function tapply() and
ragged arrays", after
stderr <- function(x) sqrt(var(x)/length(x)) ,
there is a note in brackets:
Writing functions will be considered later in [Writing your own functions], and
in this case was unnecessary as R also has
;NA")
ff <- factor(cc)
factor(ff,exclude=ff[3])
However, the coercion of 'exclude' has been in function 'factor' in R "forever".
On Wed, 31/8/16, Martin Maechler wrote:
Subject: Re: [Rd] 'droplevels' inappropriate change
Cc: "Martin Ma
In R devel r71157, 'droplevels' documentation, in "Arguments" section, says
this about argument 'exclude'.
passed to factor(); factor levels which should be excluded from the result even
if present. Note that this was implicitly NA in R <= 3.3.1 which did drop NA
levels even when present in x,
In R devel r71124, if 'x' is a factor, droplevels(x) gives
factor(x, exclude = NULL) .
In R 3.3.1, it gives
factor(x) .
If a factor 'x' has NA and levels of 'x' doesn't contain NA, factor(x) gives
the expected result for droplevels(x) , but factor(x, exclude = NULL) doesn't.
As I said in https:/
The quirk as in table(1:3, exclude = 1, useNA = "ifany") is actually somewhat
documented, and still in R devel r71104. In R help on 'table', in "Details"
section:
It is best to supply factors rather than rely on coercion. In particular,
‘exclude’ will be used in coercion to a factor, and so val
day, 13 August, 2016, 4:29 AM
>>>>> Martin Maechler
>>>>> on Fri, 12 Aug 2016 10:12:01 +0200 writes:
>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>> on Thu, 11 Aug 2016 16:19:49 + writes:
>> I stand correcte
/8/16, Martin Maechler wrote:
Subject: Re: [Rd] table(exclude = NULL) always includes NA
@r-project.org
Cc: "Martin Maechler"
Date: Thursday, 11 August, 2016, 12:39 AM
>>>>> Martin Maechler
>>>>> on Tue, 9 Aug 2016 15:35:41 +0200 writes:
>>
This is an example from
https://stat.ethz.ch/pipermail/r-help/2007-May/132573.html .
With R 2.7.2:
> a <- c(1, 1, 2, 2, NA, 3); b <- c(2, 1, 1, 1, 1, 1)
> table(a, b, exclude = NULL)
b
a 1 2
11 1
22 0
31 0
1 0
With R 3.3.1:
> a <- c(1, 1, 2, 2, NA, 3); b <- c(2,
#x27;
above is already assumed)?
At the moment, I would not tackle Problem 2.
It would become less problematic once Problem 1 is
solved
according to '1 A', because it least length(unique(.))
would
not change: It would contain *one* z[] with an NA, and
all the
other z[]s.
Op
In R 3.3.0 (also in R 2.7.2), the documentation on 'factor', in "Details"
section, has this statement.
'factor(x, exclude = NULL)' applied to a factor is a no-operation unless there
are unused levels: in that case, a factor with the reduced level set is
returned.
It is not true for a factor 'x'
ack-compatible change
proposal
Cc: R-devel@r-project.org
Date: Monday, 23 May, 2016, 11:06 PM
>>>>>
Suharto Anggono Suharto Anggono via R-devel
>>>>> on Fri, 13
May 2016 16:33:05 + writes:
> That, for example, complex(real=NaN)
and complex(imagin
That, for example, complex(real=NaN) and complex(imaginary=NaN) are regarded as
equal makes it possible that length(unique(as.character(x))) >
length(unique(x)) (current code of function 'factor' doesn't expect it). Yes,
an argument for the behavior is that NA and NaN are of one kind.
On my sys
At first read, the logic of the following fragment in code of function 'factor'
was not clear to me.
if (missing(levels)) {
y <- unique(x, nmax = nmax)
ind <- sort.list(y) # or possibly order(x) which is more (too ?)
tolerant
y <- as.character(y)
levels <- uniq
In "R News", in "Changes in R 3.3.0", in "New Features", a news item is
match.arg(arg) (the one-argument case) is faster; so is sort.int(). (PR#16640)
While it was motivated by speeding up tapply, it is in a separate bug number:
16652 (https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16652).
1 - 100 of 128 matches
Mail list logo