Displaying 20 results from an estimated 2000 matches similar to: "Help page on '$': 'warnPartialMatchAttr' should be 'warnPartialMatchDollar'"
2016 Jan 20
2
Warn on partial matches in R CMD check
Hi all (but especially Kurt),
Would it be possible to have a flag to R CMD check that warned on
partial all matches, i.e. turning on:
options(
warnPartialMatchDollar = TRUE,
warnPartialMatchArgs = TRUE,
warnPartialMatchAttr = TRUE
)
I think this is good practice for package code.
I don't think it can currently be made part of the default (because
sometimes the warnings come from
2019 Feb 18
1
Extract.data.frame.Rd about $.data.frame
The statement in R devel:
There is no \code{data.frame} method for \code{$}, so \code{x$name}
uses the default method which treats \code{x} as a list (with no partial
matching of column names). The replacement method (for \code{$}) checks
\code{value} for the correct number of rows, and replicates it if necessary.
The added "(with no partial matching of column names)" is wrong.
2019 Jul 02
1
eliminate a partial argument match warning in R CMD check
Hello,
I'm seeing a nuisance warning when I run `R CMD check --as-cran
whatever_x.y.z.tar.gz`.
I generally work with these options set:
options(
warnPartialMatchArgs = TRUE,
warnPartialMatchAttr = TRUE,
warnPartialMatchDollar = TRUE
)
And I see this:
* checking use of SHLIB_OPENMP_*FLAGS in Makefiles ...Warning in dir("src",
patt = "[.]c$") :
partial argument
2012 Dec 06
2
factor(x, exclude=y) if x is a factor
I found this part in the documentation of 'factor'.
'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. If 'exclude' is used it should
also be a factor with the same level set as 'x' or a set of codes
for the levels to be excluded.
2013 Jan 28
1
Suggestions for 'diff.default'
I have suggestions for function 'diff.default' in R.
Suggestion 1: If the input is matrix, always return matrix, even if empty.
What happens in R 2.15.2:
> rbind(1:2) # matrix
[,1] [,2]
[1,] 1 2
> diff(rbind(1:2)) # not matrix
integer(0)
> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: i386-w64-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United
2016 Sep 26
2
Undocumented 'use.names' argument to c()
By "an argument named 'use.names' is included for concatenation", I meant something like this, that someone might try.
> c(as.Date("2016-01-01"), use.names=FALSE)
use.names
"2016-01-01" "1970-01-01"
See, 'use.names' is in the output. That's precisely because 'c.Date' doesn't have 'use.names', so
2017 Nov 04
1
ans[nas] <- NA in 'ifelse' (was: ifelse() woes ... can we agree on a ifelse2() ?)
Removal of
ans[nas] <- NA
from the code of function 'ifelse' in R is not committed (yet). Why?
--------------------------------------------
On Mon, 28/11/16, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
Subject: Re: [Rd] ifelse() woes ... can we agree on a ifelse2() ?
Cc: R-devel at r-project.org, maechler at stat.math.ethz.ch
Date: Monday, 28 November, 2016, 10:00
2017 Aug 19
1
Issues of R_pretty in src/appl/pretty.c
Yes, they work now.
I mentioned them partly because the commit description said overflow for large n and partly to be considered for regression tests.
--------------------------------------------
On Sat, 19/8/17, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
Subject: Re: [Rd] Issues of R_pretty in src/appl/pretty.c
Cc: r-devel at r-project.org
Date: Saturday, 19 August, 2017,
2013 Feb 01
1
Was confused with options(error = expression(NULL)) in example(stop)
In example for function 'stop' in R, there is
options(error = expression(NULL))
with comment
# don't stop on stop(.) << Use with CARE! >>
I was interested, wanted to know how "don't stop on stop(.)" was. So, I tried it.
Typing
example(stop)
at the R prompt and pressing ENTER give this.
> example(stop)
stop> options(error = expression(NULL))
2013 Jan 28
1
Minor issue in code of 'diffinv.vector' in R 2.15.2
In R 2.15.2 (and not before), in the definition of function 'diffinv.vector' in package stats, there is
difference <- as.integer(differences)
I believe
differences <- as.integer(differences)
is intended, because 'difference' is not referenced anywhere. However, without conversion of 'differences' to integer, 'diffinv.vector' in R 2.15.2 works OK.
Also,
2019 May 30
2
stopifnot
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 +0000
+++ stop_new.R 2019-05-30 14:01:51.372187466 +0000
@@ -31,7 +31,7 @@
.Internal(stop(call., .makeMessage(..., domain = domain)))
}
2018 Mar 24
1
Function 'factor' issues
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 Anggono Suharto Anggono <suharto_anggono at yahoo.com> wrote:
Subject: Re: [Rd] Function
2010 Jul 08
2
strsplit("dia ma", "\\b") splits characterwise
\b is word boundary.
But, unexpectedly, strsplit("dia ma", "\\b") splits character by character.
> strsplit("dia ma", "\\b")
[[1]]
[1] "d" "i" "a" " " "m" "a"
> strsplit("dia ma", "\\b", perl=TRUE)
[[1]]
[1] "d" "i" "a" " "
2016 Aug 14
2
table(exclude = NULL) always includes NA
useNA <- if (missing(useNA) && !missing(exclude) && !(NA %in% exclude)) "ifany"
An example where it change 'table' result for non-factor input, from https://stat.ethz.ch/pipermail/r-help/2005-April/069053.html :
x <- c(1,2,3,3,NA)
table(as.integer(x), exclude=NaN)
I bring the example up, in case that the change in result is not intended.
2019 Feb 03
1
Inefficiency in df$col
While doing some performance testing with the new version of pqR (see
pqR-project.org), I've encountered an extreme, and quite unnecessary,
inefficiency in the current R Core implementation of R, which I think
you might want to correct.
The inefficiency is in access to columns of a data frame, as in
expressions such as df$col[i], which I think are very common (the
alternatives of
2019 Mar 05
2
stopifnot
Another possible shortcut definition:
assert <- function(exprs)
do.call("stopifnot", list(exprs = substitute(exprs), local = parent.frame()))
After thinking again, I propose to use
??? ? ? stop(simpleError(msg, call = if(p <- sys.parent()) sys.call(p)))
- It seems that the call is the call of the frame where stopifnot(...) is evaluated. Because that is the correct context, I
2016 Aug 15
1
table(exclude = NULL) always includes NA
>>>>> Martin Maechler <maechler at stat.math.ethz.ch>
>>>>> on Mon, 15 Aug 2016 11:07:43 +0200 writes:
>>>>> Suharto Anggono Suharto Anggono <suharto_anggono at yahoo.com>
>>>>> on Sun, 14 Aug 2016 03:42:08 +0000 writes:
>> useNA <- if (missing(useNA) && !missing(exclude) && !(NA %in%
2019 Feb 04
2
Inefficiency in df$col
> > I think you might want to just delete the definition of $.data.frame,
> > reverting to the situation before R-3.1.0.
>
> I imagine the cause is that the list version is done in C code rather
> than R code (i.e. there's no R function `$.list`). So an alternative
> solution would be to also implement `$.data.frame` in the underlying C
> code. This won't
2010 Nov 17
3
Fatal Error R
Hello.
First, I'm thankful about your wonderful project.
However, I have serious worries about the reliability of R. I found
the next bug which I consider important because in my job everytime We
work with datanames like next. Please see below:
b=data.frame(matrix(1:9,ncol=3))
names(b)=c("q99","r88","s77")
>b
q99 r88 s77
1 1 4 7
2 2 5 8
3
2016 Sep 10
1
table(exclude = NULL) always includes NA
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
a[a0 %in% c(exclude,NA)] <- NA .
So, it should be
is.na(a) <- match(a0, c(exclude,NA),