Apologies all. This must have been fixed in a recent version and the
cloud error was a resource limit not associated with the issue.
On Tue, 21 Jan 2025 at 23:06, Hugh Parsonage wrote:
>
> I tried doing this on a cloud instance of R 4.4.2 but the terminal
> exited and the cloud e
N=C
time zone: UTC
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.4.2 tools_4.4.2
On Tue, 21 Jan 2025 at 22:56, Ivan Krylov wrote:
>
> В Tue, 21 Jan 2025
Reprex (not recommended in an interactive session as it is difficult to kill):
x <- vector("list", 2^31)
which triggers (presumably) billions of error messages like
Error: long vectors are not supported yet ../include/Rinlinedfuns.h
I believe the error arises from checking each element of the lis
In src/main/printvector.c in the definition of printVector and
printNamedVector (and elsewhere):
Rprintf(" [ reached getOption(\"max.print\") -- omitted %d entries ]\n",
n - n_pr);
Though n - n_pr is of type R_xlen_t so may not be representable as
int. In practice negative values may be observed
The data.frame method deliberately skips non-atomic columns before
invoking is.na(x) so I think it is fair to assume this behaviour is
intentional and assumed.
Not so clear to me that there is a sensible answer for list columns.
(List columns seem to collide with the expectation that in each
varia
While profiling some C code, I rolled my own nchar function which
appears to be much faster than base R's (25 times faster for a 10M
length vector). Obviously base::nchar provides significantly more
features than my barebones function (C snippet below); however, for
argument type = "bytes" it seem
In the help for Extremes ?min
> Note that all versions fail for raw and complex vectors since these have no
> ordering.
This makes sense for complex vectors, yet `raw` vectors seem to have a
natural order. Indeed:
which.min(as.raw(c(5L, 2L, 1L, 99L)))
works and would identify the minimum. Si
I'm surprised by the aversion to
mtcars |> nrow
over
mtcars |> nrow()
and I think the decision to disallow the former should be
reconsidered. The pipe operator is only going to be used when the rhs
is a function, so there is no ambiguity with omitting the parentheses.
If it's disallowed, it be
I noticed the recent commit to R-dev (r79434). Is this wise? I've
often used get() in constructions like
for (j in ls()) if (is.numeric(x <- get(j))) ...
(and often interactively, rather than in a package)
Am I to understand that get(j) will now be equivalent to `j` even if j
is a string referr
This works as expected:
"[.foo" <- function(x, i, j) {
sx <- substitute(x)
si <- substitute(i)
sj <- substitute(j)
100 * length(sx) + 10 * length(si) + length(sj)
}
x <- 1:10
class(x) <- "foo"
x[y == z, a(x)]
#> [1] 132
Note in your implementation you ask the function evaluate the
expres
Perhaps I have misread that excerpt from WRE, but my read is that
package authors should not duplicate GNU COPYING, since it is present
in all R distributions already when using GPL-2 and friends. It
doesn't apply to packages distributed with other licenses.
It should be noted that in GPL FAQ jus
gt;> wrote:
> >>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
> >>>> Unfortunately I only get
> >>>>
> >>>> [Thread 21752.0x4aa8 exited with code 3221225477]
> >>>> [Thread 21752.0x4514 exited with code 3221225477]
> &
R Under development (unstable) (2020-09-08 r79165)
On Wed, 9 Sep 2020 at 18:00, Tomas Kalibera wrote:
>
> On 9/9/20 9:30 AM, Hugh Parsonage wrote:
> > Thank you!
> >
> > I get
> >
> > Starting program: C:\R\R-devel-20200909\bin\x64\Rgui.exe
> >
.
0x6c72d206 in compact_intseq_Dataptr (x=0x12783350,
writeable=) at altclasses.c:169
169 altclasses.c: No such file or directory.
On Wed, 9 Sep 2020 at 17:03, Tomas Kalibera wrote:
>
> On 9/9/20 8:48 AM, Hugh Parsonage wrote:
> > I am unable to set break or use gdb with any succes
te this list might not be the best
place to get a tutorial on using gdb on Windows.
On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms wrote:
>
> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms wrote:
> >
> > On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
> > wrote:
&g
on of R, or
can R be debugged using gdb with an off-the-shelf installation?)
On Wed, 9 Sep 2020 at 00:32, wrote:
>
> On Tue, 8 Sep 2020, Hugh Parsonage wrote:
>
> > Thanks Martin. On further testing, it seems that the segmentation
> > fault can only occur when the amou
$ R --vanilla --max-mem-size=29G -e "x <- c(0L, -2e9:2e9)"
Error: cannot allocate vector of size 14.9 Gb
Execution halted
On Tue, 8 Sep 2020 at 18:52, Martin Maechler wrote:
>
> >>>>> Martin Maechler
> >>>>> on Tue, 8 Sep 2020 10:40:24 +0200 w
I can only reproduce on Windows, but reliably (both 4.0.0 and 4.0.2):
$> R --vanilla
x <- c(0L, -2e9:2e9)
# > Segmentation fault
Tried to reproduce on Linux but the above worked as expected. Not an
issue merely with the length of the vector; for example, x <-
rep_len(1:10, 1e10) works, though th
(If I may be so bold, although I think it's unlikely that a majority
would be in favour of this change, and I doubt anyone is actually
proposing it, I think quite a bit more than "a majority" should be
required before a change like this should be allowed.
Considering the feature that cumsum coerce
My advice would be to avoid the network in one of the following ways
1. Store installed packages on your local drive
2. Copy the installed packages to a tempdir on your local drive each time
the script is executed
3. Keep an R session running in perpetuity and source the scripts within
that everla
Further, in addition to the `val <- FALSE` patch a few hours ago by
Martin, the line after should also be changed
- if(!is.logical(val) || is.na(val) || length(val) != 1L)
+ if(!is.logical(val) || length(val) != 1L || is.na(val))
## Consider
Sys.setenv("_R_CHECK_LENGTH_1_LOGIC2_" = "TRUE")
option
I mean if the person filing the bug regards style as more important than
the truth of how R treats formulas then they’re literally talking in
another language.
I strongly recommend you do nothing or at most make a note in the
documentation addressing this. Your time is too valuable.
On Tue, 25 Fe
I believe should be February 2020 not 2010
--- a/doc/manual/R-exts.texi
+++ b/doc/manual/R-exts.texi
@@ -2631,9 +2631,9 @@ not necessarily installed) on all known @R{}
platforms. As from @R{}
4.0.0 a C++ compiler will be selected only if it conforms to the 2011
standard (`C++11'). A minor upda
The only observation I can make is that the change to round() was made
in r77727 whereas your R-devel appears to be r77715 (so would not
exhibit the fixed behaviour). My guess is that there was a perpetual
installation failure after r77715 but that the test folder was still
retrieved and used.
On
This is (was) a bug in data.table that is similar to one which was
putatively closed. Recommend you update to the latest version and if the
problem persists reopen the issue here
https://github.com/Rdatatable/data.table/issues/3032
This mailing list is for R bugs, which this isn’t. R Core can no m
You may be trying to do something similar to hutilscpp::which_first(x < 5)
which does most of its work at the R level. That is notice an expression is
of the form lhs operator rhs then evaluate each element of lhs separately
On Fri, 27 Sep 2019 at 8:35 pm, Morgan Morgan
wrote:
> Hi,
>
> I am
The warning is that the vignette failed to be rebuilt due to an error in
its code. The error log was truncated.
Of course for practical purposes errors and warnings both constitute check
failures
On Thu, 29 Aug 2019 at 1:56 am, Therneau, Terry M., Ph.D. via R-devel <
r-devel@r-project.org> wrote:
I was initially pretty shocked by the result in this question:
https://stackoverflow.com/questions/57527434/when-do-i-need-parentheses-around-an-if-statement-to-control-the-sequence-of-a-f
Briefly, the following returns 0, not 3 as might be expected:
if (TRUE) {
0
} else {
2
} + 3
At fir
Are you running that command in RStudio? And do you get the documented
results when you run utils::install.packages() rather than just
install.packages()
If yes, then the function is likely working as advertised and you've
mixed up the R and RStudio versions
On 29/07/2019, Ant F wrote:
> Dear a
Would this not be the case *for* a new package?
FWIW I would much prefer packages maintainers who make significant changes
also change the name of the package (e.g. to survival2). That way
disturbance is minimized and the package’s developers can add features and
refactor their code much faster.
If a function contains the pattern `<-` it is (with a few exceptions)
deemed to be a replacement function and in particular must have second
argument `value` to pass R CMD check.
Consider the function %<->% or any other function containing <- within
grapes. I claim that such functions should not b
It seems that exists accepts character vectors of lengths other than
one, but discards all but the first element without an error or
warning. Is this intended? The name "exists" is in the singular, so
it's not surprising that it only contemplates the length-one instance
but in the absence of an e
I would add my support for the change.
>From a cursory survey of existing code, I'd say that usage like `class(x)
== 'y'` -- rather than inherits(x, 'y') or is.y -- is probably going to be
the major source of new warnings. So perhaps in the NEWS item it could be
noted as a clue for developers enco
In r75110 at line 1846 in src/library/tools/R/check.R the following
line was changed
- if(length(grep("^Found the defunct/removed function", out8)))
+ if(any(startsWith(out8, "Found the defunct/removed function")))
However, if `out8` is NULL at this point (which is plausible), the
original return
I believe a reproducible example is to simply have a very large object
defined literally (i.e. through structure() etc) in ./R/ . For
example, fBasics has a couple of files test-jbLM.R and test-jbTable.R
which are about 500 KB. For a given amount of RAM, I believe any
sufficiently large file will a
e.g.
grDevices::grey(level = 0.1, alpha = c(0, 1))
#> Error in grey(level = 0.1, alpha = c(0, 1)) :
#> attempt to set index 1/1 in SET_STRING_ELT
Perhaps
#> Error in grey(level = 0.1, alpha = c(0, 1)) :
#> lengths of 'level' and 'alpha' differ
__
R-d
t I saw, is to avoid as much &ing and subsetting as we can.
> If there are no NAs none of the test&ok or test[ok] operations do anything
> because ok has only TRUEs in it. Even when there are, we want to do the &
> once and avoid test[ok].
>
> There are further savings fo
I'd add my support for mode = "wb" to (eventually) become the default,
though I respect Tomas's comments about backwards-compatibility.
Instead of making the argument mandatory (which would immediately
break scripts -- even ones that won't be helped by changing to mode =
'wb') or otherwise changin
Thanks Radford. I concur with all your points. I've attempted to address
the issues you raised through the github.io post. The new method appears
to be slower for test lengths < 100 and possibly longer lengths (not just <
10). Of course length(test) < 100 is very quick, so I simply added this to
t
eturn(.ifelse(test, yes, no))
+ }
+}
+if (!is.null(attributes_of_test)) {
+ attributes(out) <- attributes_of_test
+}
+
+out
+ } else {
+return(.ifelse(test, yes, no))
+ }
+}
+
+.ifelse <- function(test, yes, no) {
ans <- test
ok <- !is.na(test)
if
to reflect this.
I've written up a short note detailing the performance improvements
and some unit tests at
https://hughparsonage.github.io/content/post/A-new-ifelse.html
Best
Hugh Parsonage
__
R-devel@r-project.org mailing list
https://stat.ethz.ch
storical changes.
Best,
Hugh Parsonage.
Grattan Institute
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Lines 129-131:
\code{grep(value = FALSE)} returns a vector of the indices
of the elements of \code{x} that yielded a match (or not, for
\code{invert = TRUE}. This will be an integer vector unless the input
There should be a closing parenthesis after \code{invert = TRUE}
__
s = TRUE)
[1] "AUTHOR: AMéLIE" # latin1 encoding
A call to `readLines` (possibly `scan()` and `read.table` and friends)
is essential.
On 18 February 2018 at 02:15, Dirk Eddelbuettel wrote:
>
> On 17 February 2018 at 21:10, Hugh Parsonage wrote:
> | I was told to re-raise thi
o end case
> conversion.
However, the following code runs differently:
tempf <- tempfile()
writeLines(enc2utf8("author: Amélie"), con = tempf, useBytes = TRUE)
entry <- readLines(tempf, encoding = "UTF-8")
gsub("(\\w)", "\\U\\1", entry, perl = TRUE
I think the problem you're experiencing is not uncommon but has a solution.
FWIW, I prefer git, but I think the best version control system for R
is whatever R-core prefers. If they were 2% more productive working in
an MS Word documents with Track Changes than git, so much worse for
git.
On 25 J
eously when
failing to copy files which will never be built.
This may or may not make the unlink(allfiles[exclude], recursive = TRUE,
force = TRUE) line redundant; I'm not sure.
Hugh Parsonage
Grattan Institute.
[[alternative HTML vers
glish_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.0
Many thanks,
Hugh Parsonage
Associate, Grattan Institute, Melbourne, AU
48 matches
Mail list logo