From Gael.Millot at curie.fr  Mon Jun 15 14:55:17 2015
From: Gael.Millot at curie.fr (Millot Gael)
Date: Mon, 15 Jun 2015 12:55:17 +0000
Subject: [Rd] Add-on argument in sample()
Message-ID: <D62EEDC839E38446B9F9378AFA4408E983EEA95E@mbxparis01.recherche.curie.fr>

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 number of value is not predictable. Would it be possible to add an argument
that desactivates this and perform the sampling on a single value ? Examples:
> sample(10, size = 1, replace = FALSE)
10

> sample(10, size = 3, replace = TRUE)
10 10 10

> sample(10, size = 3, replace = FALSE)
Error

Many thanks for your help.

Best wishes,

Gael Millot.


Gael Millot
UMR 3244 (IC-CNRS-UPMC) et Universite Pierre et Marie Curie
Equipe Recombinaison et instabilite genetique
Pav Trouillet Rossignol 5eme etage
Institut Curie
26 rue d'Ulm
75248 Paris Cedex 05
FRANCE
tel : 33 1 56 24 66 34
fax : 33 1 56 24 66 44
Email : gael.millot at curie.fr
http://perso.curie.fr/Gael.Millot/index.html


	[[alternative HTML version deleted]]



[Rd] Add-on argument in sample()
Millot Gael