Displaying 20 results from an estimated 30000 matches similar to: "sort(list(..)) ?"
2010 Sep 08
0
Correction to vec-subset speed patch
I found a bug in one of the fourteen speed patches I posted, namely in
patch-vec-subset. I've fixed this (I now see one does need to
duplicate index vectors sometimes, though one can avoid it most of the
time). I also split this patch in two, since it really has two
different and independent parts. The patch-vec-subset patch now has
only some straightforward (locally-checkable) speedups for
2009 Dec 10
1
switch() called with just the EXPR argument causes R to hang (PR#14124)
Dear all,
switch() called with just the EXPR argument causes R to hang so that the
only way to stop it is to kill R.
Reproducible example:
> switch(EXPR="a")
the internal C subroutine behind switch is do_switch located in
R/src/main/builtin.c
For convenience I reproduce it below.
*****************************************************************************
SEXP attribute_hidden
2010 Aug 21
1
Speed improvement to evalList
I've been inspired to look at the R source code by some strange timing
results that I wrote about on my blog at radfordneal.wordpress.com
(see the posts on "Speeding up parentheses..." and "Two surprising
things...".
I discovered that the strange speed advantage of curly brackets over
parentheses is partially explained by an inefficiency in the evalList
and
1999 Jan 27
0
load() patch
Summary: patch to add environment parameter to load() to allow
-------- specification of destination environment.
--> Patch against R 0.63.2 appended at end of this message. <--
Story:
------
I've been running some rather long MCMC chains, which occasionally crash,
either due to an "Invalid tag in name extraction" error, or due to the
machine going down. (I'm playing
2006 Oct 15
1
Feature request: names(someEnv) same as ls(someEnv)
Hi,
I would be nice if names() returned the equivalent of ls() for
environments.
--- a/src/main/attrib.c
+++ b/src/main/attrib.c
@@ -687,6 +687,8 @@ SEXP attribute_hidden do_names(SEXP call
s = CAR(args);
if (isVector(s) || isList(s) || isLanguage(s))
return getAttrib(s, R_NamesSymbol);
+ if (isEnvironment(s))
+ return R_lsInternal(s, 0);
return R_NilValue;
}
1999 Sep 27
0
text( col=, cex=, font=) : doesn't allow more than length-1 arg (PR#287)
text(..., col = <..>) doesn't work if col has length more than one;
and the same for 'cex' and 'font'
A toy example, showing what is desired
plot(1);text(1.2, .8+(0:5)/16, LETTERS[6:1])
## works alright
plot(1);text(1.2, .8+(0:5)/16, LETTERS[6:1],col=1:6)
##>>> Error in par(args) : parameter "col" has the wrong length
---
Explanation:
The source
2006 Jan 21
1
A patch for do_sample: check replace arg
A colleague sent me the following:
If you specify probabilities in the 'sample' function and forget
to type 'prob=...', then you get nonsense. E.g.
sample(1:10,1,c(0,0,0,0,1,0,0,0,0,0))
does not filter '5', while
sample(1:10,1,prob=c(0,0,0,0,1,0,0,0,0,0))
does it correctly. I wish this would return an error because the
2000 Jan 17
1
lwd patches for "contour"
I found it useful to have contour be able to do line widths ... hope
that the guts haven't changed an enormous amount in the current
development version ... the patches are relatively trivial, mostly going
by analogy with lty and col (although in my ignorance it took me a while
to figure out what UNPROTECT(2) was and why it should be changed to
UNPROTECT(3) ... hope this is useful.
Ben
1997 May 11
2
R-alpha: Logarithmic scales
Here are another three problems with logarithmic scales:
1) segments() does not work with logarithmic scales. I suggest to change
lines 962-973 in "plot.c":
for (i = 0; i < n; i++) {
if (FINITE(xt(x0[i%nx0])) && FINITE(yt(y0[i%ny0]))
&& FINITE(xt(x1[i%nx1])) && FINITE(yt(y1[i%ny1]))) {
GP->col = INTEGER(col)[i % ncol];
2008 Apr 06
0
manual 'Writing R Extensions': bug in example
Hi,
I would like to report a small bug in one of the code examples given in
the 'Writing R extensions' manual. Section 5.9.2 ("Calling .External")
defines the function "showArgs" in order to demonstrate how to access in
C the pair-listed arguments passed by .External. The function aims at
printing echoing all passed arguments to the screen but only prints
every
2023 Apr 14
0
sum(), min(), max(), prod() vs. named arguments in ...
Hello R-devel,
As mentioned on Fosstodon [1] and discussed during RCOH [2], named
arguments to sum(), min(), max() and prod() are currently processed the
same way as the un-named ones. Additionally, when specifying the na.rm
argument more than once, the last specified value is silently taken
into account.
Most of this behaviour is exactly as documented, but it's arguably a
source of mistakes
2009 Mar 03
1
profiler and loops
Hello,
(This is follow up from this thread:
http://www.nabble.com/execution-time-of-.packages-td22304833.html but
with a different focus)
I am often confused by the result of the profiler, when a loop is
involved. Consider these two scripts:
script1:
Rprof( )
x <- numeric( )
for( i in 1:10000){
x <- c( x, rnorm(10) )
}
Rprof( NULL )
print( summaryRprof( ) )
script2:
2019 Apr 05
2
patch to improve matrix conformability error message
With this patch,
> A <- matrix(1, 2, 2)
> B <- matrix(2, 3, 2)
> A %*% B
Error in A %*% B :
non-conformable arguments of dimension (2, 2) and (3, 2)
>From 205b591d4d14b5ff667325fb233a6deb08314726 Mon Sep 17 00:00:00 2001
From: Joshua Nathaniel Pritikin <jpritikin at pobox.com>
Date: Fri, 5 Apr 2019 12:03:58 -0400
Subject: [PATCH] Improve non-conformable arguments error
2023 Apr 16
0
sum(), min(), max(), prod() vs. named arguments in ...
On 2023-04-15 6:00 am, r-devel-request at r-project.org wrote:
> Date: Fri, 14 Apr 2023 13:38:00 +0300
> From: Ivan Krylov<krylov.r00t at gmail.com>
> To:r-devel at r-project.org
> Subject: [Rd] sum(), min(), max(), prod() vs. named arguments in ...
Message-ID: <20230414133800.75383dae-6792 at arachnoid>
> Content-Type: text/plain; charset="us-ascii"
>
>
2005 Sep 18
0
Updated rawConnection() patch
Here's an update of my rawConnection() implementation. In addition to
providing a raw version of textConnection(), this fixes two existing
issues with textConnection(): one is that the current textConnection()
implementation carries around unprotected SEXP pointers, the other is
a performance problem due to prolific copying of the output buffer as
output is accumulated line by line.
This new
1997 Apr 06
1
R-alpha: What should is.vector do?
[ Consumer warning: This is a little technical ... ]
I have been pondering the question
What should is.vector do?
Martin has raised this a number of times. I ran a few tests
in S and got the following results.
S> is.vector(list(1,2,3))
[1] T
S> is.vector(expression(a+b))
[1] T
S> is.vector(as.name("x"))
[1] T
S> is.vector(NULL)
[1] T
S> x <- 1:5
2001 Sep 27
1
Passing an R matrix to a C program
Hello,
I'm starting to write a C function that gets
a list and a matrix from R. I'm using .Call
because I've undertood that this is recommended
to handle lists (am I wrong?). My problem is that I
can pass the matrix as a vector, but not as a 2D array.
For example, in the following simple C program:
#include <R.h>
#include <Rdefines.h>
SEXP printListElement(SEXP list,
1998 Apr 02
1
attributes now inherited
Hi R-Developers,
After my message about a month ago concerning attributes being lost during
simple operations, Martin Maechler invited me to fix the code if I was in
a hurry (especially for attributes in general). We've just made the
following changes here, which appear to implement the rules in the
Blue Book (pg. 257)
Enclosed is the output from "diff -c" from /R-0.61.1/src
1999 Feb 02
0
Suggestion
I have to write extensions to R regularly.
One of them was an interface to a mysql database on a
different computer. The best way to do that is to have
something like
mysql<-function (dbname, host = "zap", user = "nobody", password = "ok")
{
handle <<- .RC("mysqlconnect", c(host, user, password, dbname))
}
and
query<-function (cmd)
{
2019 Apr 30
0
patch to improve matrix conformability error message
I think this is a good idea. Is there a reason why it got no interest?
Slippery slope?
Or maybe others were also just occupied trying to figure out how
Joshua's second message had timestamp earlier than his first message?
On Fri, Apr 05, 2019 at 12:05:36PM -0400, Joshua N Pritikin wrote:
>With this patch,
>
>> A <- matrix(1, 2, 2)
>> B <- matrix(2, 3, 2)
>> A