Re: [Rd] Improving string concatenation

2015-06-17 Thread Hervé Pagès
Hi Bill, On 06/17/2015 12:36 PM, William Dunlap wrote: if '+' and paste don't change their behavior with respect to factors but you encourage people to use '+' instead of paste then you will run into problems with data.frame columns because many people don't notice whether a character-like colum

Re: [Rd] Add-on argument in sample()

2015-06-17 Thread Hervé Pagès
Hi, Special behavior of sample(x, ...) when length(x) is 1 is of course a bad feature. I think it pre-dates sample.int() which is what people should use these days if they want the behavior of sample(x, ...) when length(x) is 1. And because we now have sample.int(), this feature could in theory b

Re: [Rd] Improving string concatenation

2015-06-17 Thread William Dunlap
if '+' and paste don't change their behavior with respect to factors but you encourage people to use '+' instead of paste then you will run into problems with data.frame columns because many people don't notice whether a character-like column is character or factor. With paste() this is not a prob

Re: [Rd] Improving string concatenation

2015-06-17 Thread Joshua Bradley
> How would this new '+' deal with factors, as paste does or as the current '+' > does? Would number+string and string+number cause errors (as in current > '+' in R and python) or coerce both to strings (as in current R:paste and in perl's '+'). I had posted this sample code previously to demons

Re: [Rd] Improving string concatenation

2015-06-17 Thread Avraham Adler
On Wed, Jun 17, 2015 at 1:25 AM, Joshua Bradley wrote: > …I work in the bioinformatics domain and write R scripts for > pipelines with calls to various programs that require a lot of parameters > to be set/varied. Seeing "paste" everywhere detracts from reading the code > (in my opinion). In that

Re: [Rd] Improving string concatenation

2015-06-17 Thread Gábor Csárdi
On Wed, Jun 17, 2015 at 12:45 PM, William Dunlap wrote: >> ... adding the ability to concat >> strings with '+' would be a relatively simple addition (no pun intended) > to >> the code base I believe. With a lot of other languages supporting this > kind >> of concatenation, this is what surprised

Re: [Rd] Improving string concatenation

2015-06-17 Thread William Dunlap
> ... adding the ability to concat > strings with '+' would be a relatively simple addition (no pun intended) to > the code base I believe. With a lot of other languages supporting this kind > of concatenation, this is what surprised me most when first learning R. Wow! R has a lot of surprising f

Re: [Rd] Add-on argument in sample()

2015-06-17 Thread William Dunlap
I don't like the idea of having a length-1 dim attribute trigger some behavior of sample. (Should a length-2 dim cause it to sample rows of a matrix, as unique() and duplicated() do?). S+'s sample() had another argument, 'n', that could be used to specify the size of the population to sample from

Re: [Rd] Add-on argument in sample()

2015-06-17 Thread Radford Neal
> 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 s

Re: [Rd] Improving string concatenation

2015-06-17 Thread Gábor Csárdi
On Wed, Jun 17, 2015 at 9:04 AM, Michael Lawrence wrote: > Just to clarify, primitive (C-level) generics do not support dispatch > on basic classes (like character). This is for performance (no need to > consider dispatch on non-objects) and for sanity (in general, > redefining fundamental behavio

Re: [Rd] Improving string concatenation

2015-06-17 Thread Michael Lawrence
Just to clarify, primitive (C-level) generics do not support dispatch on basic classes (like character). This is for performance (no need to consider dispatch on non-objects) and for sanity (in general, redefining fundamental behaviors is dangerous). It is of course possible to define a "+" method

Re: [Rd] Code demos via HTML help gives an error

2015-06-17 Thread Henrik Bengtsson
Went ahead and did it directly, cf. PR #16432 (https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16432). /H On Wed, Jun 17, 2015 at 4:02 AM, Duncan Murdoch wrote: > On 16/06/2015 4:20 PM, Henrik Bengtsson wrote: >> PROBLEM: >> I'm getting error: >> >> Error in order(matches$Position) : argume

Re: [Rd] Code demos via HTML help gives an error

2015-06-17 Thread Duncan Murdoch
On 16/06/2015 4:20 PM, Henrik Bengtsson wrote: > PROBLEM: > I'm getting error: > > Error in order(matches$Position) : argument 1 is not a vector > > Whenever I try to access a package's "Code demos" page via the link on > the package HTML index page. > > > SOME TROUBLESHOOTING: > Looking at for

Re: [Rd] Bugzilla activity?

2015-06-17 Thread Duncan Murdoch
On 16/06/2015 4:18 PM, Milan Bouchet-Valat wrote: > Hi! > > I was wondering whether anybody was looking at the bugs on Bugzilla. I'm > asking because I've seen bugs tackled on the mailing list quite quickly, > but two fully reproducible reports I've filed on Bugzilla haven't > triggered any reacti

Re: [Rd] Add-on argument in sample()

2015-06-17 Thread Jon Skoien
On 6/16/2015 1:32 PM, Peter Meissner wrote: Am .06.2015, 14:55 Uhr, schrieb Millot Gael : Hi. I have a problem with the default behavior of sample(), which performs sample(1:x) when x is a single value. This behavior is well explained in ?sample. However, this behavior is annoying when the n