Displaying 20 results from an estimated 800 matches similar to: "R-devel Digest, Vol 133, Issue 23"
2014 Mar 23
1
A rep_each function
The rep function is very versatile, but that versatility comes at a
cost: it takes a bit of effort to learn (and remember) its syntax.
This is a problem, since rep is one of the first functions many
beginners will come across. Of the three main uses of rep, two have
simpler alternatives.
rep(x, times = ) has rep.int
rep(x, length.out = ) has rep_len
I think that a rep_each function would be a
2010 Oct 18
1
make error for R 2.13.0 (and 2.12.0)
Regarding Tengfei Yin's post about an error trying to install
"cluster" in 2.13.0, I have gotten an error with this package when
trying to install the released version of 2.12.0. Here is the output
on an Ubuntu Linux system:
begin installing recommended package cluster
* installing *source* package 'cluster' ...
** libs
make[3]: Entering directory
2011 Feb 01
1
dotchart {graphics} 2.11.1 vs. 2.12.1
I have a factor vector of subject races (Asian, Black, Hispanic, White; n=30) that I want to plot with a Cleveland dotplot or dotchart.
I tried the following in R2.12.1 :
> dotchart(table(school$Race))
Error in plot.xy(xy.coords(x, y), type = type, ...) : invalid plot type
Using the same data set in R2.11.1 the operation succeeded (I tried several variations to be sure):
>
2015 Aug 21
2
OpenMP problem with 64-bit Rtools
I've been getting pqR to work on windows systems, and in the process
have discovered various problems with R core versions of R and with
Rtools.
One is with the implementation of OpenMP in 64-bit Rtools. This
problem is in Rtools215 and Rtools33, and presumably all the ones in
between. You can see the problem with the following test program:
#include <stdio.h>
#include <omp.h>
2015 Jun 13
2
Lack of protection bug in current R release candidate
The current R release candidate has a lack of protect bug (of very
long standing) with respect to the R_print.na_string and
R_print.na_string_noquote fields of the static R_print structure
declared in Print.h. This shows up very occassionally as incorrect
output from the following lines in reg-tests-2.R:
x <- c("a", NA, "b")
factor(x)
factor(x, exclude="")
2018 May 03
2
Proposed speedup of ifelse
> I propose a patch to ifelse that leverages anyNA(test) to achieve an
> improvement in performance. For a test vector of length 10, the change
> nearly halves the time taken and for a test of length 1 million, there
> is a tenfold increase in speed. Even for small vectors, the
> distributions of timings between the old and the proposed ifelse do
> not intersect.
For smaller
2014 Dec 04
1
\U with more than 4 digits returns the wrong character
Great spot, thanks Mark.
This really ought to appear somewhere in the ?Quotes help page.
Having a warning under Windows might be nicer behaviour than silently
returning the wrong value too.
On 4 December 2014 at 22:24, Mark van der Loo <mark.vanderloo at gmail.com> wrote:
> Richie,
>
> The R language definition [1] says (10.3.1):
>
> \Unnnnnnnn \U{nnnnnnnn}
> (where
2015 May 25
5
Unicode display problem with data frames under Windows
On 25/05/2015 11:37 AM, Ista Zahn wrote:
> AFAIK this is the way it works on Windows. It has been discussed in several
> places, e.g.
> http://stackoverflow.com/questions/17715956/why-do-some-unicode-characters-display-in-matrices-but-not-data-frames-in-r
> ,
> http://stackoverflow.com/questions/17715956/why-do-some-unicode-characters-display-in-matrices-but-not-data-frames-in-r
2015 Jun 15
1
Lack of protection bug in current R release candidate
> > The current R release candidate has a lack of protect bug
> > (of very long standing)
>
> [ but not really reported, right ? ]
It's "long standing" because it exists in versions of R going
back many years.
> but the R 3.2.1 release candidate probably really cannot be
> touched now, with something non-trivial like this.
>
> We'd be
2013 Dec 13
1
substring() and propagation of names
Hi,
In R < 3.0.0, we used to get:
> substring(c(A="abcdefghij", B="123456789"), 2, 6:2)
A B A B A
"bcdef" "2345" "bcd" "23" "b"
But in R >= 3.0.0, we get:
> substring(c(A="abcdefghij", B="123456789"), 2, 6:2)
[1] "bcdef"
2016 Sep 09
3
R (development) changes in arith, logic, relop with (0-extent) arrays
> Radford Nea:
> > So it may make more sense to move towards consistency in the
> > permissive direction, rather than the restrictive direction.
>
> > That would mean allowing matrix(1,1,1) < (1:2), and maybe also things
> > like matrix(1,2,2)+(1:8).
>
> Martin Maechler:
> That is an interesting idea. Yes, in my view that would
>
2015 Jul 14
3
Two bugs showing up mostly on SPARC systems
In testing pqR on Solaris SPARC systems, I have found two bugs that
are also present in recent R Core versions. You can see the bugs and
fixes at the following URLs:
https://github.com/radfordneal/pqR/commit/739a4960a4d8f3a3b20cfc311518369576689f37
https://github.com/radfordneal/pqR/commit/339b7286c7b43dcc6b00e51515772f1d7dce7858
The first bug, in nls, is most likely to occur on a 64-bit
2015 Jun 17
1
Add-on argument in sample()
> Then the question would be if this test could be replaced with a new
> argument to sample, e.g. expandSingle, which has TRUE as default for
> backward compatibility, but FALSE if you dont want population to be
> expanded to 1:population. It could certainly be useful in some cases,
> but you still need to know about the expansion to use it. I think most
> of these bugs
2011 Jul 25
2
Best practices for writing R functions (really copying)
Gabriel Becker writes:
AFAIK R does not automatically copy function arguments. R actually tries
very hard to avoid copying while maintaining "pass by value" functionality.
... R only copies data when you modify an object, not
when you simply pass it to a function.
This is a bit misleading. R tries to avoid copying by maintaining a
count of how many references there are to an
2015 Feb 18
3
Recycling memory with a small free list
> ... with assignments inside of loops like this:
>
> reweight = function(iter, w, Q) {
> for (i in 1:iter) {
> wT = w * Q
> }
> }
> ... before the RHS is executed, the LHS allocation would be added
> to a small fixed length list of available space which is checked
> before future allocations. If the same size is requested before the
> next garbage
2017 Jun 16
4
[WISH / PATCH] possibility to split string literals across multiple lines
> On Wed, 14 Jun 2017, G?bor Cs?rdi wrote:
>
> > I like the idea of string literals, but the C/C++ way clearly does not
> > work. The Python/Julia way might, i.e.:
> >
> > """this is a
> > multi-line
> > lineral"""
>
> luke-tierney at uiowa.edu:
> This does look like a promising option; some more careful checking
2017 Mar 19
3
RFC: (in-principle) native unquoting for standard evaluation
Michael Lawrence (as last in long series of posters)...
> Yes, it would bind the language object to the environment, like an
> R-level promise (but "promise" of course refers specifically to just
> _lazy_ evaluation).
>
> For the uqs() thing, expanding calls like that is somewhat orthogonal
> to NSE. It would be nice in general to be able to write something like
>
2015 May 25
2
Unicode display problem with data frames under Windows
Here's a data frame with some Unicode symbols (set intersection and union).
d <- data.frame(x = "A \u222a B \u2229 C")
Printing this data frame under R 3.2.0 patched (r68378) and Windows 7, I see
d
## x
## 1 A <U+222A> B n C
Printing the column itself works fine.
d$x
## [1] A ? B ? C
## Levels: A ? B ? C
The encoding is correctly UTF-8.
2018 May 03
1
Proposed speedup of ifelse
I propose a patch to ifelse that leverages anyNA(test) to achieve an
improvement in performance. For a test vector of length 10, the change
nearly halves the time taken and for a test of length 1 million, there
is a tenfold increase in speed. Even for small vectors, the
distributions of timings between the old and the proposed ifelse do
not intersect.
The patch does not intend to change the
2015 Jun 18
1
Improving string concatenation
Gabor Csardi writes:
> Btw. for some motivation, here is a (surely incomplete) list of
> languages with '+' as the string concatenation operator:
>
> ALGOL 68, BASIC, C++, C#, Cobra, Pascal, Object Pascal, Eiffel, Go,
> JavaScript, Java, Python, Turing, Ruby, Windows Powers hell,
> Objective-C, F#, Sc-ala, Ya.
The situation for R is rather different from that of a