Re: [R-es] SVM hadoop

2015-12-11 Thread Jorge Ayuso Rejas
Si SparkR está muy bien pero todavía está en algunas cosas un poco verde.

para la parte de mlib solo se pueden hacer glm:

https://spark.apache.org/docs/latest/sparkr.html#machine-learning

Justo di un pequeño taller de esto en las jornadas de R, aquí tienes los
apuntes:

http://jayusor.github.io/taller_SparkR/

Un saludo.

El 11 de diciembre de 2015, 10:57, MªLuz Morales 
escribió:

> Hola Jorge,
> muchas gracias por tu esquema. Mi caso sería el primero, el más
> complicado. Por lo que he leído, svm no es fácil de implementar, aunque he
> visto algo(muy poco) de implementación svm en hadoop con R. Yo he
> encontrado que hay algo llamado SparkR, mediante lo cual puedes usar la
> librería mllib, que tiene svm y ejecutarlo directamente desde R y corre en
> paralelo mediante Spark. Espero haberlo entendido bien. También esto puede
> estar integrado con hadoop. No se si realmente se podrá hacer un svm o
> tendrá limitaciones...
>
> Un saludo
> MªLuz
>
> El 11 de diciembre de 2015, 9:49, Jorge Ayuso Rejas 
> escribió:
>
>> Hola Mª Luz,
>>
>> Te cuento un poco mi visión:
>>
>> Lo primero de todo es tener claro qué quiero hacer exactamente en
>> paralelo, se me ocurren 3 escenarios:
>>
>> (1)  Aplicar un modelo en este caso SVM sobre unos datos muy grandes y
>> por eso necesito hadoop/spark
>> (2)  Realizar muchos modelos SVM sobre datos pequeños (por ejemplo uno
>> por usuario)  y por eso necesito hadoop/spark para parelilizar estos
>> procesos en muchas máquinas y acabar en un tiempo finito.
>> (3)  Con un modelo ya realizado en local sobre una muestra quiero hacer
>> predicciones "predict" sobre muchos datos y por eso necestio hadoop/spark
>> para hacer las predicciones ne paralelo.
>>
>>
>> Posibles soluciones:
>>
>> (1) Lo más complicado de los 3 escenarios. Lo primero de todo es pensar
>> si con una muestra suficientemente grande y un único ordenador potente
>> (32gb 64gb?) te puede valer. Si es el caso puedes usar R y cualquier
>> paquete que incluya SVM. Si esto no te vale y quieres hacerlo sobre el
>> total de los datos (En mi opinión esto no garantiza que vayas a conseguir
>> mejores resultados..). Por lo que estuve investigando (si me equivoco que
>> alguien me corrija!) los SVM no son de lo mejorcito para paralelizar, Spark
>> como comentó Carlos tiene implementado SVM lineal pero hoy por hoy no lo
>> podrás ejecutar desde R (si desde python). Otras opciones que te recomiendo
>> es probar con otros algoritmos, mira por ejemplo h2o (http://h2o.ai/)
>>
>>
>> (2) Con esto te vale perfectamente RHADOOP y cualquier svm implementado
>> en R ya que cada svm es 'pequeño' solo que tienes que hacer muchos
>>
>> (3) Lo mismo que (2) puedes te vale con RHADOOP y hacer `predict` en
>> paralelo.
>>
>>
>> Un saludo,
>> Jorge A.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> El 11 de diciembre de 2015, 8:49, MªLuz Morales 
>> escribió:
>>
>>> Hola,
>>> cuando hablas de la opción Rstudio en Amazon, te refieres mediante
>>> hadoop?
>>> (esa es la idea que tengo, usar R con hadoop en amazon, pero necesito que
>>> el algoritmo svm sea paralelizable...
>>>
>>> Esto otro que mencionas:
>>> http://www.teraproc.com/front-page-posts/r-on-demand/
>>> que entorno de paralelización usa? conozco hadoop y spark,
>>>
>>>
>>> Gracias
>>> Un saludo
>>>
>>>
>>> El 10 de diciembre de 2015, 16:03, Carlos Ortega <
>>> c...@qualityexcellence.es>
>>> escribió:
>>>
>>> > Hola,
>>> >
>>> > Puedes poner un RStudio en Amazon, poner "caret" y a correr
>>> > No sé si tendrás suficiente con lo que te pueda ofrecer Amazon para tu
>>> > problema... creo que sí...  ;-)
>>> >
>>> > O directamente hacerlo aquí, que toda esta instalación ya la tienen
>>> hecha:
>>> >
>>> > http://www.teraproc.com/front-page-posts/r-on-demand/
>>> >
>>> > Gracias,
>>> > Carlos.
>>> >
>>> > El 10 de diciembre de 2015, 14:43, MªLuz Morales 
>>> > escribió:
>>> >
>>> >> Hola,
>>> >>
>>> >> gracias por tu sugerencia, aunque creo que no será suficiente porque
>>> mi
>>> >> objetivo es trabajar con big data
>>> >>
>>> >> El 10 de diciembre de 2015, 13:23, Carlos Ortega <
>>> >> c...@qualityexcellence.es> escribió:
>>> >>
>>> >>> Hola,
>>> >>>
>>> >>> ¿Y no te valdría el ejecutar tu código con "caret" y activar la
>>> opción
>>> >>> de paralelizar?.
>>> >>> El escenario "caret + paralelización + svm" funciona sin problemas.
>>> >>>
>>> >>> Adjunto una captura de pantalla del libro de "Kuhn" (Applied
>>> Predictive
>>> >>> Modeling) con los tiempos de ejecución que se obtienen al ejecutar
>>> >>> diferentes modelos (SVM, RF, LDA) sobre un mismo conjunto de datos y
>>> >>> utiilzando diferente número de "cores".
>>> >>>
>>> >>> Gracias,
>>> >>> Carlos Ortega
>>> >>> www.qualityexcellence.es
>>> >>>
>>> >>> El 10 de diciembre de 2015, 11:56, MªLuz Morales 
>>> >>> escribió:
>>> >>>
>>>  Hola,
>>>  gracias por vuestras respuestas anteriores.  Son interesantes
>>> aunque me
>>>  

Re: [R] expand dataframe but time gap is not the same

2015-12-11 Thread Dagmar

Hello Bill (and Petr and all),

Thank you very much! That was exactly what I was looking for! I could 
have never accomplished that on my own.


Have a great time,
Tagmarie

Am 09.12.2015 um 18:07 schrieb William Dunlap:

You can use the approx() function (in that stats package) to put
5 equally spaced times between your high and low water times.
E.g., in the following 'tmp' will be your interpolated times, in seconds
since 1970, which I clumsily convert to POSIX times (I can never
remember how to deal with time zones so I make everything use UTC).


tmp <- with(myframe2, approx(x=seq(1, by=6, length.out=length(Timestamp)), 
y=as.numeric(Timestamp), xout=seq(1,by=1,length.out=6*(length(Timestamp)-1)+1))$y)
as.POSIXct(i, origin="1970-01-01 00:00", tz="UTC")

  [1] "2013-08-02 22:10:00 UTC" "2013-08-02 23:09:00 UTC"
  [3] "2013-08-03 00:08:00 UTC" "2013-08-03 01:07:00 UTC"
  [5] "2013-08-03 02:06:00 UTC" "2013-08-03 03:05:00 UTC"
  [7] "2013-08-03 04:04:00 UTC" "2013-08-03 05:06:20 UTC"
  [9] "2013-08-03 06:08:40 UTC" "2013-08-03 07:11:00 UTC"
[11] "2013-08-03 08:13:20 UTC" "2013-08-03 09:15:40 UTC"
[13] "2013-08-03 10:18:00 UTC"

diff(.Last.value)

Time differences in mins
  [1] 59.0 59.0 59.0 59.0 59.0 59.0 62.3 62.3
  [9] 62.3 62.3 62.3 62.3

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Thu, Dec 3, 2015 at 2:51 AM, Dagmar  wrote:

Hello,
I hope someone can help me with my problem:
I have a dataframe like this:

datframe <- data.frame(dates=c("02.08.2013","03.08.2013","03.08.2013"),
times =c("22:10","4:04", "10:18"), tide =c("NW","HW", "NW"))
datframe
Timestamp <- paste(datframe$dates, datframe$times)
myframe2 <- cbind( Timestamp,datframe)
head(myframe2)
myframe2$dates <- NULL
myframe2$times <- NULL
myframe2$Timestamp <- as.POSIXct (strptime(myframe2$Timestamp, "%d.%m.%Y
%H:%M"), tz="GMT")
head(myframe2)
str(myframe2)

# In the end I want a frame like this:
datframeres <- data.frame(Timestamp=c("2013-08-02 22:10:00", "2013-08-02
23:09:00","2013-08-03 00:08:00","2013-08-03 01:07:00", "2013-08-03
02:06:00", "2013-08-03 03:05:00",
"2013-08-03 04:04:00","2013-08-03 05:06:20","2013-08-03 06:08:40",
"2013-08-03 07:11:00", "2013-08-03 08:13:20", "2013-08-03 09:15:40",
"2013-08-03 10:18:00")
, tidalclass =c("NW", "HW-5","HW-4", "HW-3", "HW-2", "HW-1", "HW",
"HW+1","HW+2","HW+3", "HW+4","HW+5", "NW"))

datframeres

# That means: I want to expand to 13 classes instead of the two classes "HW"
and "NW": "HW", "HW+1", "HW+2" and so on.
# The time gap between HW and NW is not always quite the same (always around
6 hours). So I would divide the time gap by 6 and add this number (0:59 and
1:02:20 respectively) to the timestamp before.
# I do not know how to do this. Does anyone know how to do this? Many thanks
in advance!
Tagmarie

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] egscore - lambda will not go below 1.1

2015-12-11 Thread aoife doherty
Hi all,

I want to associate mortality with ~100K SNPs, in 6,500 samples that are
divided up into 60 breeds.

So it's important to account for population stratification in my analysis.

I'm using egscore (the eigenstrat method) for the association (and I've
tried using the polygen and grammar packages too). The problem is that I
cannot get lambda (the inflation factor) to go below the accepted inflation
threshold of 1.1, it seems to converge around 1.5-1.6 when I include an
increasing number of PC axes into the analysis.

Then, I also tried to use the polygen and grammar packages, but the same
thing happens.

Here is the code that I am using:


library(GenABEL)
#Load the data as a gwaa.class
my.geno.data <- load.gwaa.data(phenofile =
"pheno.dat",genofile="youroutput.dat")

#Calculate the IBS matrix
kin<-ibs(my.geno.data, weight="freq", snpfreq=NULL)
diag(kin) <-hom(my.geno.data)$Var

# Estimation of polygenic model, This estimates the residuals when the
effect of covariates breeds are factored out.
polygen <-polygenic(mortality~breed,kin=kin,my.geno.data)
grammarobject <-qtscore(polygen$pgres,data=my.geno.data,clam=FALSE)

so then you found that the lambda was still > 1.1

#So then I used egscore on the output from polygen
output <-egscore(polygen$pgresidualY,data=my.geno.data,kin=kin,naxes=X)

where I iteratively included an increasing number of PC axes (naxes=X),
lambda still > 1.1, and doesn't change if I run egscore on the raw data
instead of the environmental residuals (again iterating through axes), and
it also doesn't change regardless of if I include breed as a co-variate, or
as a stratification variable.

output <-egscore(mortality~breed,data=my.geno.data,kin=kin,naxes=X)

Am I doing something wrong? What else can I try to properly account for
population stratification in an association between trait and SNPs?

Thanks

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Error message when running gam (mgcv). object not found

2015-12-11 Thread Diego Pavon
Dear all

I am trying to fit gam to my data but it keeps giving me errors.


It does not find the covariate ArrivalTime even though it is clearly
defined in the data frame. It happens with any covariate that I put in the
s() term... And not only for this data set, but for any dataset that I try
to analyse.

Do you have any idea why I can't run gam? I can run perfectly any other
type of models (GLM, GLMM, ZIP...)..

Any help would be appreciated. Thank you very much.

Best

Diego




-- 
*Diego Pavón Jordán*

*Finnish Museum of Natural History*
*PO BOX 17 *

*Helsinki. Finland*



*0445061210https://tuhat.halvi.helsinki.fi/portal/en/persons/diego-pavon-jordan%288d5db37c-eddd-4fca-92cd-9c9956a42b4a%29.html
http://www.linkedin.com/profile/view?id=170617924=nav_responsive_tab_profile
https://helsinki.academia.edu/DiegoPavon
*

> T1 <- gam(E1 ~ s(ArrivalTime), data = Owls)Error in as.matrix(x) : object 
> 'ArrivalTime' not found> ls(Owls) [1] "ArrivalTime""BroodSize"
>   "FoodTreatment"  "LogNeg"
 [5] "NegPerChick""Nest"   "SexParent"
"SiblingNegotiation"
 [9] "Xcoord" "Ycoord"

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] regexp inside and outside brackets

2015-12-11 Thread phgrosjean
It depends the complexity of your expression. If you are sure you don’t have 
nested brackets, and pairs of brackets always match, this will take everything 
outside the brackets:

str <- "A1{0}~B0{1} CO{a2}NN{12}”
gsub("\\{[^}]*\\}", " ", str)

Philippe Grosjean


> On 11 Dec 2015, at 14:50, Adrian Dușa  wrote:
> 
> For the regexp aficionados, out there:
> 
> I need a regular expression to extract either everything within some
> brackets, or everything outside the brackets, in a string.
> 
> This would be the test string:
> "A1{0}~B0{1} CO{a2}NN{12}"
> 
> Everything outside the brackets would be:
> 
> "A1 ~B0 CO NN"
> 
> and everything inside the brackets would be:
> 
> "0 1 a2 12"
> 
> I have a working solution involving strsplit(), but I wonder if there is a
> more direct way.
> Thanks in advance for any hint,
> Adrian
> 
> -- 
> Adrian Dusa
> University of Bucharest
> Romanian Social Data Archive
> Soseaua Panduri nr.90
> 050663 Bucharest sector 5
> Romania
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] regexp inside and outside brackets

2015-12-11 Thread Marc Schwartz

> On Dec 11, 2015, at 7:50 AM, Adrian Dușa  wrote:
> 
> For the regexp aficionados, out there:
> 
> I need a regular expression to extract either everything within some
> brackets, or everything outside the brackets, in a string.
> 
> This would be the test string:
> "A1{0}~B0{1} CO{a2}NN{12}"
> 
> Everything outside the brackets would be:
> 
> "A1 ~B0 CO NN"
> 
> and everything inside the brackets would be:
> 
> "0 1 a2 12"
> 
> I have a working solution involving strsplit(), but I wonder if there is a
> more direct way.
> Thanks in advance for any hint,
> Adrian


x <- "A1{0}~B0{1} CO{a2}NN{12}"

The first is a bit easier:

> gsub("\\{[[:alnum:]]*\\}", " ", x)
[1] "A1 ~B0  CO NN "


The second, at least using standard functions, is a bit more cumbersome, given 
the repeated sequences:

> gsub("\\{|\\}", "", regmatches(x, gregexpr("\\{[[:alnum:]]+\\}", x))[[1]])
[1] "0"  "1"  "a2" "12"

Note that a multi-element vector is returned.

In the above:

> gregexpr("\\{[[:alnum:]]+\\}", x)
[[1]]
[1]  3  9 15 21
attr(,"match.length")
[1] 3 3 4 4
attr(,"useBytes")
[1] TRUE

returns the starting positions of the matches, which are passed to regmatches() 
to get the actual values:

> regmatches(x, gregexpr("\\{[[:alnum:]]+\\}", x))
[[1]]
[1] "{0}"  "{1}"  "{a2}" "{12}"

The gsub() replaces the returned braces.

You could invert the result of regmatches() to get:

> regmatches(x, gregexpr("\\{[[:alnum:]]+\\}", x), invert = TRUE)[[1]]
[1] "A1"  "~B0" " CO" "NN"  ""   


Of course, this presumes non-nesting of braces, etc.

Regards,

Marc Schwartz

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Raster-package - problem with stackApply()

2015-12-11 Thread Mark R. Payne
Thanks for the reply Don - that's the problem in a nutshell - I'll 
repost on r-sig-geo


Mark

On 10/12/15 20:46, MacQueen, Don wrote:

Appears to me that results for the third set of indices you supplied (1,1)
ended up in the third layer of the result. Similarly for the other sets of
indices. This makes sense to me.

r-sig-geo might be a better place to ask questions about the raster
package. I've seen other questions about stackApply there.

-Don



--
Mark Payne
Senior Researcher
Centre for Ocean Life
DTU Aqua
---
Technical University of Denmark
National Institute of Aquatic Resources
Charlottenlund Slot,
Jægersborg Allé 1
2920 Charlottenlund
Direct +45 35883422
m...@aqua.dtu.dk
http://www.aqua.dtu.dk/mpay
@MarkPayneAtWork
Skype: MarkPayneAtWork

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] problem with spplot

2015-12-11 Thread Debasish Pai Mazumder
Hi all,

I am using spplot for a spatial map.

spplot(hspdf, "CDP", col = "white", col.regions = blue2red(20), sp.layout =
list(l2), at = seq(1,10,1), colorkey = list(space = "bottom", labels =
list(labels = paste(seq(1,10,1)), cex = 1.5)), sub = list("CDP", cex = 1.5,
font = 2))

I have three questions related to spplot

[1] How to control the limit of xlim and ylim

 I defined the latitude and longitude limit in l2 but it did not work

[2] How to control color scale

  if change the "at = seq(1,10,1)" and "labels = paste(seq(1,10,1))" to
0-10, I only get color 0-5 in plot
 don't know why?

[3] Panel plot

 I would like to panel spplot with hist. How do I do that?

spplot(hspdf, "CDP", col = "white", col.regions = blue2red(20),
sp.layout = list(l2), at = seq(1,10,1), colorkey = list(space = "bottom",
labels = list(labels = paste(seq(1,10,1)), cex = 1.5)), sub =
list("CDP", cex = 1.5, font = 2))

   hist(cdp.obsc, col="grey", border="grey", main="CDP", probability=T)

with regards

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] stopifnot with logical(0)

2015-12-11 Thread Dario Beraldi
Hi All,

I'd like to understand the reason why stopifnot(logical(0) == x) doesn't
(never?) throw an exception, at least in these cases:

stopifnot(logical(0) == 1)
stopifnot(logical(0) == TRUE)
stopifnot(logical(0) == FALSE)

My understanding is that logical(0) is an empty set, so I would expect the
above tests to fail.

(I got bitten by this in a piece of code where "x" happened to be
logical(0) and stopifnot didn't catch it)

Thanks!
Dario

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] forest plot metafor

2015-12-11 Thread Michael Dewey

See below

On 09/12/2015 18:48, Mario Petretta wrote:

Dear all,



I use metafor package to generate a forest plot showing the weight of each 
study in the plot.



I use the code:

library(metafor)

data(dat.bcg)

res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg, measure="RR",

slab=paste(author, year, sep=", "), method="REML")

forest(res, showweights=TRUE)



It is possible to order the columns, placing the weights after effect size and 
CI?



There are some fairly extensive examples in the forest.rma 
documentation. You will also need some patience to get everything 
exactly where you want it and looking exactly how you want. Graphics are 
like that.





A further query: using escalc (or rma), it is possible to add the weight of 
each study (other than yi and vi) to the data (in the example: data.bcg)?



You can extract the weights from the fitted object using weights.ram.uni 
and put them in the data  frame yourself. I am a bit worried about your 
mention of escalc, you do realise that the weights are a function of the 
fit, not the data?


So weights(res) should be OK here (not tested).




Thanks for your attention







Mario Petretta

Professor of Internal Medicine

Department of Translational Medical Science

Naples University “Federico II” - Italy





   _


  

Questa e-mail è priva di virus e malware perché è attiva la protezione avast! 
Antivirus   .



Nessun virus nel messaggio.
Controllato da AVG - www.avg.com
Versione: 2014.0.4259 / Database dei virus: 3705/7093 - Data di rilascio: 
14/02/2014



---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Error message when running gam (mgcv). object not found

2015-12-11 Thread Simon Wood
Hi Diego, I suggest you send me an example offline, along with the 
result of  sessionInfo(), best, Simon


On 11/12/15 09:25, Diego Pavon wrote:

Dear all

I am trying to fit gam to my data but it keeps giving me errors.


It does not find the covariate ArrivalTime even though it is clearly
defined in the data frame. It happens with any covariate that I put in the
s() term... And not only for this data set, but for any dataset that I try
to analyse.

Do you have any idea why I can't run gam? I can run perfectly any other
type of models (GLM, GLMM, ZIP...)..

Any help would be appreciated. Thank you very much.

Best

Diego







--
Simon Wood, School of Mathematics, University of Bristol BS8 1TW UK
+44 (0)117 33 18273 http://www.maths.bris.ac.uk/~sw15190

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] stopifnot with logical(0)

2015-12-11 Thread Henrik Bengtsson
On Fri, Dec 11, 2015 at 8:10 AM, David Winsemius  wrote:
>
>> On Dec 11, 2015, at 5:38 AM, Dario Beraldi  wrote:
>>
>> Hi All,
>>
>> I'd like to understand the reason why stopifnot(logical(0) == x) doesn't
>> (never?) throw an exception, at least in these cases:
>
> The usual way to test for a length-0 logical object is to use length():
>
> x <- logical(0)
>
> stopifnot( !length(x) & mode(x)=="logical" )

I found

stopifnot(!length(x), mode(x) == "logical")

more helpful when troubleshooting, because it will tell you whether
it's !length(x) or mode(x) == "logical" that is FALSE.  It's as if you
wrote:

stopifnot(!length(x))
stopifnot(mode(x) == "logical")

/Henrik

>
>
>>
>> stopifnot(logical(0) == 1)
>> stopifnot(logical(0) == TRUE)
>> stopifnot(logical(0) == FALSE)
>>
>> My understanding is that logical(0) is an empty set, so I would expect the
>> above tests to fail.
>>
>> (I got bitten by this in a piece of code where "x" happened to be
>> logical(0) and stopifnot didn't catch it)
>>
>> Thanks!
>> Dario
> --
>
> David Winsemius
> Alameda, CA, USA
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] regexp inside and outside brackets

2015-12-11 Thread Jeff Newmiller
The gsub function is your friend. 

s <- "A1{0}~B0{1} CO{a2}NN{12}"
gsub( "([^{}]*)\\{([^{}]*)\\}", "\\1 ", s )
gsub( "([^{}]*)\\{([^{}]*)\\}", "\\2 ", s )

but keep in mind that there are many resources on the Internet for learning 
about regular expressions... they are hardly R-specific. 

-- 
Sent from my phone. Please excuse my brevity.

On December 11, 2015 5:50:28 AM PST, "Adrian Dușa"  
wrote:
>For the regexp aficionados, out there:
>
>I need a regular expression to extract either everything within some
>brackets, or everything outside the brackets, in a string.
>
>This would be the test string:
>"A1{0}~B0{1} CO{a2}NN{12}"
>
>Everything outside the brackets would be:
>
>"A1 ~B0 CO NN"
>
>and everything inside the brackets would be:
>
>"0 1 a2 12"
>
>I have a working solution involving strsplit(), but I wonder if there
>is a
>more direct way.
>Thanks in advance for any hint,
>Adrian
>
>-- 
>Adrian Dusa
>University of Bucharest
>Romanian Social Data Archive
>Soseaua Panduri nr.90
>050663 Bucharest sector 5
>Romania
>
>   [[alternative HTML version deleted]]
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] regexp inside and outside brackets

2015-12-11 Thread Marc Schwartz
Hi,

Needless to say, Jeff's solution is easier than my second one. I was wrestling 
in dealing with the greedy nature of regex's and so shifted to thinking about 
the use of the functions that I proposed in the second scenario.

Also, I was a bit hypo-caffeinated ... ;-)

Regards,

Marc


> On Dec 11, 2015, at 9:12 AM, Adrian Dușa  wrote:
> 
> Thanks very much, Marc and Jeff.
> Jeff's solutions seem to be simple one liners. I really need to learn these
> things, too powerful to ignore.
> 
> Thank you very much,
> Adrian
> 
> On Fri, Dec 11, 2015 at 5:05 PM, Jeff Newmiller 
> wrote:
> 
>> The gsub function is your friend.
>> 
>> s <- "A1{0}~B0{1} CO{a2}NN{12}"
>> gsub( "([^{}]*)\\{([^{}]*)\\}", "\\1 ", s )
>> gsub( "([^{}]*)\\{([^{}]*)\\}", "\\2 ", s )
>> 
>> but keep in mind that there are many resources on the Internet for
>> learning about regular expressions... they are hardly R-specific.
>> 
>> --
>> Sent from my phone. Please excuse my brevity.
>> 
>> On December 11, 2015 5:50:28 AM PST, "Adrian Dușa" 
>> wrote:
>>> 
>>> For the regexp aficionados, out there:
>>> 
>>> I need a regular expression to extract either everything within some
>>> brackets, or everything outside the brackets, in a string.
>>> 
>>> This would be the test string:
>>> "A1{0}~B0{1} CO{a2}NN{12}"
>>> 
>>> Everything outside the brackets would be:
>>> 
>>> "A1 ~B0 CO NN"
>>> 
>>> and everything inside the brackets would be:
>>> 
>>> "0 1 a2 12"
>>> 
>>> I have a working solution involving strsplit(), but I wonder if there is a
>>> more direct way.
>>> Thanks in advance for any hint,
>>> Adrian
>>> 
>>> 
> 
> 
> -- 
> Adrian Dusa
> University of Bucharest
> Romanian Social Data Archive
> Soseaua Panduri nr.90
> 050663 Bucharest sector 5
> Romania
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] stopifnot with logical(0)

2015-12-11 Thread Jeff Newmiller
The goal of the comparison operators is to obtain a logical value.  Why compare 
logical values... you clearly already have that?

stopifnot( logicalvariable ) and 
stopifnot( !logicalvariable )

are sensible,  but not

stopifnot( logicalvariable == TRUE ) or 
stopifnot( logicalvariable == FALSE )

That said, R lets you construct the department of redundancy department  
anyway,  but you have to have a value to compare.  logical(0) is the absence of 
a logical value, so there is nothing to compare, so the result has to also be 
the absence of a logical value (logical(0)).

Somewhere, the test that lead to the existence of this empty logical vector had 
no data. That absence of data is what you need to test for. Or, at the very 
least, you need to verify that the length of your logical variable is greater 
than zero before checking its value. 
-- 
Sent from my phone. Please excuse my brevity.

On December 11, 2015 5:38:47 AM PST, Dario Beraldi  
wrote:
>Hi All,
>
>I'd like to understand the reason why stopifnot(logical(0) == x)
>doesn't
>(never?) throw an exception, at least in these cases:
>
>stopifnot(logical(0) == 1)
>stopifnot(logical(0) == TRUE)
>stopifnot(logical(0) == FALSE)
>
>My understanding is that logical(0) is an empty set, so I would expect
>the
>above tests to fail.
>
>(I got bitten by this in a piece of code where "x" happened to be
>logical(0) and stopifnot didn't catch it)
>
>Thanks!
>Dario
>
>   [[alternative HTML version deleted]]
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] regexp inside and outside brackets

2015-12-11 Thread Adrian Dușa
Thanks very much, Marc and Jeff.
Jeff's solutions seem to be simple one liners. I really need to learn these
things, too powerful to ignore.

Thank you very much,
Adrian

On Fri, Dec 11, 2015 at 5:05 PM, Jeff Newmiller 
wrote:

> The gsub function is your friend.
>
> s <- "A1{0}~B0{1} CO{a2}NN{12}"
> gsub( "([^{}]*)\\{([^{}]*)\\}", "\\1 ", s )
> gsub( "([^{}]*)\\{([^{}]*)\\}", "\\2 ", s )
>
> but keep in mind that there are many resources on the Internet for
> learning about regular expressions... they are hardly R-specific.
>
> --
> Sent from my phone. Please excuse my brevity.
>
> On December 11, 2015 5:50:28 AM PST, "Adrian Dușa" 
> wrote:
>>
>> For the regexp aficionados, out there:
>>
>> I need a regular expression to extract either everything within some
>> brackets, or everything outside the brackets, in a string.
>>
>> This would be the test string:
>> "A1{0}~B0{1} CO{a2}NN{12}"
>>
>> Everything outside the brackets would be:
>>
>> "A1 ~B0 CO NN"
>>
>> and everything inside the brackets would be:
>>
>> "0 1 a2 12"
>>
>> I have a working solution involving strsplit(), but I wonder if there is a
>> more direct way.
>> Thanks in advance for any hint,
>> Adrian
>>
>>


-- 
Adrian Dusa
University of Bucharest
Romanian Social Data Archive
Soseaua Panduri nr.90
050663 Bucharest sector 5
Romania

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] stopifnot with logical(0)

2015-12-11 Thread Giorgio Garziano
I think the inspection of the "stopifnot()" source code may help.

> stopifnot
function (...)
{
n <- length(ll <- list(...))
if (n == 0L)
return(invisible())
mc <- match.call()
for (i in 1L:n) if (!(is.logical(r <- ll[[i]]) && !anyNA(r) &&
all(r))) {
ch <- deparse(mc[[i + 1]], width.cutoff = 60L)
if (length(ch) > 1L)
ch <- paste(ch[1L], "")
stop(sprintf(ngettext(length(r), "%s is not TRUE", "%s are not all 
TRUE"),
ch), call. = FALSE, domain = NA)
}
invisible()
}


The following code may help in understanding.

(arg <- (logical(0) == 1))
(arg <- (logical(0) == TRUE))
(arg <- (logical(0) == FALSE))

n <- length(ll <- list(arg))
n

if (n == 0L)
  return(invisible())

for (i in 1L:n) {
  print(is.logical(r <- ll[[i]]))
  print(!anyNA(r))
  print(all(r))
  if (! (is.logical(r <- ll[[i]]) && !anyNA(r) &&  all(r)) ) {
print("stop")
  }
}

Executing such code:

> (arg <- (logical(0) == 1))
logical(0)
> (arg <- (logical(0) == TRUE))
logical(0)
> (arg <- (logical(0) == FALSE))
logical(0)
>
> n <- length(ll <- list(arg))
> n
[1] 1
>
> if (n == 0L)
+   return(invisible())
>
> for (i in 1L:n) {
+   print(is.logical(r <- ll[[i]]))
+   print(!anyNA(r))
+   print(all(r))
+   if (! (is.logical(r <- ll[[i]]) && !anyNA(r) &&  all(r)) ) {
+ print("stop")
+   }
+ }
[1] TRUE
[1] TRUE
[1] TRUE
>

See also help(all) and what its "Note" states about all(logical(0))
and consider that:

> is.logical(logical(0))
[1] TRUE


--
GG

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] stopifnot with logical(0)

2015-12-11 Thread David Winsemius

> On Dec 11, 2015, at 5:38 AM, Dario Beraldi  wrote:
> 
> Hi All,
> 
> I'd like to understand the reason why stopifnot(logical(0) == x) doesn't
> (never?) throw an exception, at least in these cases:

The usual way to test for a length-0 logical object is to use length():

x <- logical(0)

stopifnot( !length(x) & mode(x)=="logical" )


> 
> stopifnot(logical(0) == 1)
> stopifnot(logical(0) == TRUE)
> stopifnot(logical(0) == FALSE)
> 
> My understanding is that logical(0) is an empty set, so I would expect the
> above tests to fail.
> 
> (I got bitten by this in a piece of code where "x" happened to be
> logical(0) and stopifnot didn't catch it)
> 
> Thanks!
> Dario
-- 

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Updating Package Fails: Help on How to Fix Needed

2015-12-11 Thread Uwe Ligges
Just FYI: This one slipped through CRAN checks. We are in contact with 
the maintainer.


Best,
Uwe Ligges


On 11.12.2015 22:11, Marc Schwartz wrote:



On Dec 11, 2015, at 2:40 PM, Duncan Murdoch  wrote:

On 11/12/2015 2:36 PM, William Dunlap wrote:

stats::sigma was added to R recently.  It is is R-devel now, I don't know
about yesterday's R-3.2.3.


As Rich saw, it's not.  pbkrtest should have "Depends: R (>= 3.3.0)" instead of 
"Depends: R (>= 3.0.0)" in its DESCRIPTION.
You can see it failed tests on CRAN.

Duncan Murdoch



Just to confirm, having installed 3.2.3 this morning, stats::sigma is not 
present.

FWIW, it may, in some fashion, be related to the dependency of pbkrtest on lme4.

The ?sigma for lme4 shows the following in Examples:

   methods(sigma)# from R 3.3.0 on, shows methods from pkgs 'stats' *and* 'lme4'

So there may be a package namespace/export issue at play here...

Regards,

Marc Schwartz




Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Fri, Dec 11, 2015 at 11:05 AM, Duncan Murdoch
 wrote:

On 11/12/2015 1:44 PM, Rich Shepard wrote:


 Trying to update package pbkrtest failed because of a missing object
in
another namespace. Not having experienced this issue before now I don't
know
what to do to fix the problem. Here's the story:

* installing *source* package ‘pbkrtest’ ...
** package ‘pbkrtest’ successfully unpacked and MD5 sums checked
** R
** data
** inst
** preparing package for lazy loading
Warning: replacing previous import by ‘stats::sigma’ when loading
‘pbkrtest’
Error : object ‘sigma’ is not exported by 'namespace:stats'
ERROR: lazy loading failed for package ‘pbkrtest’
* removing ‘/usr/lib/R/library/pbkrtest’
* restoring previous ‘/usr/lib/R/library/pbkrtest’

The downloaded source packages are in
 ‘/tmp/RtmppHtiuJ/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages(update[instlib == l, "Package"], l, contriburl =
contriburl,  :
 installation of package ‘pbkrtest’ had non-zero exit status

 Advice needed.



I don't see that.  You need to give more details:  I'd start with
sessionInfo(), and the version number of the pbkrtest package that you're
trying to install.  (If R is downloading it for you,
available.packages()["pbkrtest",]  will give lots of useful information.)

Duncan Murdoch

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Question about a passage in R language

2015-12-11 Thread Bert Gunter
I think we need to consult a lawyer on this one ... :-)

?Extract says that an empty index is "most often used" ... . This is a
vague comment on use, **not** an exact specification of what x[] does.

The R language manual appears to be out of date or wrong: it specifies
that "irrelevant" attributes are anything but names and dimnames in
"Only names and in multi-dimensional arrays dim and dimnames
attributes are retained." As you noted, this is false:

> x <- matrix(1:6,3,2)
> x[]
 [,1] [,2]
[1,]14
[2,]25
[3,]36

> attr(x,"fy")<- "funny"
> x
 [,1] [,2]
[1,]14
[2,]25
[3,]36
attr(,"fy")
[1] "funny"

> x[]
 [,1] [,2]
[1,]14
[2,]25
[3,]36
attr(,"fy")
[1] "funny" ## this contradicts the Language definition manual passage above


Cheers,
Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Fri, Dec 11, 2015 at 1:09 PM, Sébastien Durier
 wrote:
> Hello,
>
> In ?Extract, one can read "An empty index selects all values: this is most
> often used to replace all the entries but keep the attributes"
> No example is given but if x a vector I interpret this sentence as "x[]".
> And in fact, all attributes seem to be preserved by this indexing.
> But in the R language manual
> (https://cran.r-project.org/doc/manuals/r-devel/R-lang.html#Indexing-by-vectors),
> the following passage puzzles me : "Empty. The expression x[] returns x, but
> drops “irrelevant” attributes from the result." I must misunderstand
> something because it sounds contradictory with the help page.
>
> Thank you
>
> SD
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] Question about a passage in R language

2015-12-11 Thread Sébastien Durier

Hello,

In ?Extract, one can read "An empty index selects all values: this is 
most often used to replace all the entries but keep the attributes"
No example is given but if x a vector I interpret this sentence as 
"x[]". And in fact, all attributes seem to be preserved by this indexing.
But in the R language manual 
(https://cran.r-project.org/doc/manuals/r-devel/R-lang.html#Indexing-by-vectors), 
the following passage puzzles me : "Empty. The expression x[] returns x, 
but drops “irrelevant” attributes from the result." I must misunderstand 
something because it sounds contradictory with the help page.


Thank you

SD

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Correct notation for functions, packages when using LaTex

2015-12-11 Thread Rolf Turner

On 12/12/15 09:26, Frank Harrell wrote:

Rolf I believe \textsf is the correct font to use for the symbol R but
not necessarily for the names of R variables and functions.  I'd like
more discussion about that.


I agree; the names of R variables and functions are *code* and should be 
rendered in "typewriter" font using \texttt{}.  (IMHO.)


cheers,

Rolf


--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Updating Package Fails: Help on How to Fix Needed

2015-12-11 Thread Marc Schwartz

> On Dec 11, 2015, at 2:40 PM, Duncan Murdoch  wrote:
> 
> On 11/12/2015 2:36 PM, William Dunlap wrote:
>> stats::sigma was added to R recently.  It is is R-devel now, I don't know
>> about yesterday's R-3.2.3.
> 
> As Rich saw, it's not.  pbkrtest should have "Depends: R (>= 3.3.0)" instead 
> of "Depends: R (>= 3.0.0)" in its DESCRIPTION.
> You can see it failed tests on CRAN.
> 
> Duncan Murdoch


Just to confirm, having installed 3.2.3 this morning, stats::sigma is not 
present.

FWIW, it may, in some fashion, be related to the dependency of pbkrtest on lme4.

The ?sigma for lme4 shows the following in Examples:

  methods(sigma)# from R 3.3.0 on, shows methods from pkgs 'stats' *and* 'lme4'
 
So there may be a package namespace/export issue at play here...

Regards,

Marc Schwartz



>> Bill Dunlap
>> TIBCO Software
>> wdunlap tibco.com
>> 
>> 
>> On Fri, Dec 11, 2015 at 11:05 AM, Duncan Murdoch
>>  wrote:
>> > On 11/12/2015 1:44 PM, Rich Shepard wrote:
>> >>
>> >> Trying to update package pbkrtest failed because of a missing object
>> >> in
>> >> another namespace. Not having experienced this issue before now I don't
>> >> know
>> >> what to do to fix the problem. Here's the story:
>> >>
>> >> * installing *source* package ‘pbkrtest’ ...
>> >> ** package ‘pbkrtest’ successfully unpacked and MD5 sums checked
>> >> ** R
>> >> ** data
>> >> ** inst
>> >> ** preparing package for lazy loading
>> >> Warning: replacing previous import by ‘stats::sigma’ when loading
>> >> ‘pbkrtest’
>> >> Error : object ‘sigma’ is not exported by 'namespace:stats'
>> >> ERROR: lazy loading failed for package ‘pbkrtest’
>> >> * removing ‘/usr/lib/R/library/pbkrtest’
>> >> * restoring previous ‘/usr/lib/R/library/pbkrtest’
>> >>
>> >> The downloaded source packages are in
>> >> ‘/tmp/RtmppHtiuJ/downloaded_packages’
>> >> Updating HTML index of packages in '.Library'
>> >> Making 'packages.html' ... done
>> >> Warning message:
>> >> In install.packages(update[instlib == l, "Package"], l, contriburl =
>> >> contriburl,  :
>> >> installation of package ‘pbkrtest’ had non-zero exit status
>> >>
>> >> Advice needed.
>> >
>> >
>> > I don't see that.  You need to give more details:  I'd start with
>> > sessionInfo(), and the version number of the pbkrtest package that you're
>> > trying to install.  (If R is downloading it for you,
>> > available.packages()["pbkrtest",]  will give lots of useful information.)
>> >
>> > Duncan Murdoch
>> >
>> > __
>> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide 
>> > http://www.R-project.org/posting-guide.html
>> > and provide commented, minimal, self-contained, reproducible code.
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] Revolutions blog: November 2015 roundup

2015-12-11 Thread David Smith
Since 2008, Revolution Analytics (and now Microsoft) staff and guests have 
written about R every weekday at the
Revolutions blog:
http://blog.revolutionanalytics.com
and every month I post a summary of articles from the previous month of 
particular interest to readers of r-help.

In case you missed them, here are some articles related to R from the month of 
November:

You can use emojis as plotting symbols in ggplot2 charts with the emoGG package:
http://blog.revolutionanalytics.com/2015/11/emojis-in-ggplot-graphics.html

A review of local R user group activity in 2015:
http://blog.revolutionanalytics.com/2015/11/r-user-group-activity-2015.html

Giving thanks to the R Core Group: 
http://blog.revolutionanalytics.com/2015/11/happy-thanksgiving.html

Some best practices for handling secret API keys in R scripts:
http://blog.revolutionanalytics.com/2015/11/how-to-store-and-use-authentication-details-with-r.html

An animated globe showing locations of Marriott and Starwood hotels using the 
rthreejs package:
http://blog.revolutionanalytics.com/2015/11/marriott.html

PowerBI has added support for R graphics in dashboards:
http://blog.revolutionanalytics.com/2015/11/powerbi-adds-support-for-r.html

A detailed R-based analysis of over a billion taxi rides in New York City:
http://blog.revolutionanalytics.com/2015/11/new-york-taxi-uber.html

Joseph Rickert recommends books for learning the R language and for data 
analysis in R:
http://blog.revolutionanalytics.com/2015/11/r-recommended-reading.html

The AzureML package has been updated to allow R functions to connect with 
workspaces, datasets, and experiments in Azure
ML Studio: http://blog.revolutionanalytics.com/2015/11/azureml-update.html

A simulation-based approach to explaining Simpson's Paradox:
http://blog.revolutionanalytics.com/2015/11/fun-with-simpsons-paradox-simulating-confounders.html

Two new surveys show that R continues to be the most popular language for data 
scientists:
http://blog.revolutionanalytics.com/2015/11/new-surveys-show-continued-popularity-of-r.html

R was featured in many presentations at this year's H2Oworld conference:
http://blog.revolutionanalytics.com/2015/11/h2o-world-2015.html

Some tips on handling packages when working with R projects: 
http://blog.revolutionanalytics.com/2015/11/r-projects.html

fluent-r, a new R integration library for JVM developers: 
http://blog.revolutionanalytics.com/2015/11/fluent-r.html

Online investing service Betterment uses R for modeling, analysis and reporting:
http://blog.revolutionanalytics.com/2015/11/betterment-uses-r.html

Applications of R were presented at the EARL conference by Verizon, Pfizer, 
Wikipedia, and many others:
http://blog.revolutionanalytics.com/2015/11/applications-of-r-at-earl-2015-boston.html

Simulating sample data reproducibly using the wakefield package:
http://blog.revolutionanalytics.com/2015/11/using-the-wakefield-package-to-easily-generate-reproducible-sample-data.html

Using the RJSONIO package to download Bitcoin exchange data:
http://blog.revolutionanalytics.com/2015/11/accessing-bitcoin-data-with-r.html

A series on using differential privacy for machine learning:
http://blog.revolutionanalytics.com/2015/11/differential-privacy-mini-series-from-win-vector.html

The R Consortium has funded its first community project, and is now accepting 
proposals for future projects:
http://blog.revolutionanalytics.com/2015/11/r-consortium-funds-first-community-project-accepting-proposals-for-more.html

General interest stories (not related to R) in the past month included: 
ball-moving contraptions in Lego
(http://blog.revolutionanalytics.com/2015/11/gbc.html), why you can't 
photograph propellers
(http://blog.revolutionanalytics.com/2015/11/because-its-friday-why-you-cant-take-photos-of-propellers.html),
 fun with
magnets 
(http://blog.revolutionanalytics.com/2015/11/because-its-friday-magnets.html), 
and a dangerous playground
(http://blog.revolutionanalytics.com/2015/11/because-its-friday-monash-playground.html).

Meeting times for local R user groups 
(http://blog.revolutionanalytics.com/local-r-groups.html) can be found on the
updated R Community Calendar at: 
http://blog.revolutionanalytics.com/calendar.html

If you're looking for more articles about R, you can find summaries from 
previous months at
http://blog.revolutionanalytics.com/roundups/. You can receive daily blog posts 
via email using services like
blogtrottr.com, or join the Revolution Analytics mailing list at 
http://revolutionanalytics.com/newsletter to be alerted
to new articles on a monthly basis.

As always, thanks for the comments and please keep sending suggestions to me at 
david...@microsoft.com or via Twitter
(I'm @revodavid).

Cheers,
# David

-- 
David M Smith 
R Community Lead, Microsoft  
Tel: +1 (312) 9205766 (Chicago IL, USA)
Twitter: @revodavid | Blog:  http://blog.revolutionanalytics.com

__
R-help@r-project.org 

[R] Dendrogram for k-modes

2015-12-11 Thread 이아름
 Hi.
I have two question!
 
1) Is there any way to draw a dendrogram for k-modes?


I used klaR pacakges for kmodes analysis to deal with categorical variables.
 
i heard about the "Clustergram"
Url = {http://www.schonlau.net/clustergram.html}  
 
but i only found the example of Clustergram for K-means..'
 
2)How can I found the result of weighted k-modes? 
​ 
​i did the cluster analysis with weighted kmodes(klaR packages)
like..
==
a-kmodes(data, 5, TRUE)
==
 
What i want to see is not only the result of clustering but the result of 
"weight for each attributes".
I found the code for 
kmodes(https://github.com/cran/klaR/blob/master/R/kmodes.R#L124)
and below codes seems to save the weights for each attribute..
but i do not know exactly how to extract this result by adding another R 
command... 



  if(weighted){## compute the frequencies of each category for each 
variableweights - vector("list", num_var)for (i in 
1:num_var) weights[[i]] - table(data[,i])} else {
weights - NULL} 
 
 
Thanks all!!

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] [klaR packages] Weighted kmodes (how to derive the weights?)

2015-12-11 Thread 이아름
 Hi.
 
How can I found the specific outcome of weighted k-modes? 
​ 
​i did the cluster analysis with weighted kmodes(klaR packages)
like..
==
a-kmodes(data, 5, TRUE)
==
 
What i want to see is not only the result of clustering but the result of 
"weight for each attributes".
I found the code for 
kmodes(https://github.com/cran/klaR/blob/master/R/kmodes.R#L124)
and below codes seems to save the weights for each attribute..
but i do not know exactly how to extract this result by adding another R 
command... 
 
  if(weighted){## compute the frequencies of each category for each 
variableweights - vector("list", num_var)for (i in 
1:num_var) weights[[i]] - table(data[,i])} else {
weights - NULL} 
 
 
Thanks all!!



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] stopifnot with logical(0)

2015-12-11 Thread William Dunlap
The reason is probably that
   any(logical())
and
   any(!logical())
return FALSE (there are no TRUEs in logical(0)).
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Fri, Dec 11, 2015 at 5:38 AM, Dario Beraldi  wrote:
> Hi All,
>
> I'd like to understand the reason why stopifnot(logical(0) == x) doesn't
> (never?) throw an exception, at least in these cases:
>
> stopifnot(logical(0) == 1)
> stopifnot(logical(0) == TRUE)
> stopifnot(logical(0) == FALSE)
>
> My understanding is that logical(0) is an empty set, so I would expect the
> above tests to fail.
>
> (I got bitten by this in a piece of code where "x" happened to be
> logical(0) and stopifnot didn't catch it)
>
> Thanks!
> Dario
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Help quadratic plateau

2015-12-11 Thread bruno higa
i need to do a quadratic plateau. I saw the code and try to put my datas, but i 
had some errors. 
This is my code , 
for (mun in 1:dm[1]){  # for (mun in 8:dm[1]){if(nu[mun]>= nmin) {  
  y1=arquivov[mun,ncv[mun]:27]  vy = as.numeric(y1)
x=seq(1:nu[mun])
  cr=lm(vy~x+I(x^2))  ca_q[mun]=cr$coefficients[[1]]  
cl_q[mun]=cr$coefficients[[2]]  cq_q[mun]=cr$coefficients[[3]]
alpha_q=as.numeric(ca_q[mun])  beta_q=as.numeric(cl_q[mun])  
gamma_q=as.numeric(cq_q[mun]) fm <- nls(vy ~ Mean(x, alpha, beta, 
gamma), start=list(alpha=alpha_q, beta=beta_q, gamma=gamma_q),control = 
list(maxiter = dm[1]))   fm  summary(fm)plot(vy ~ x)  
lines(fitted(fm) ~ x)  with(as.list(coef(fm)), abline(v = -beta/(2 * 
gamma)))
}else{  }}
> vy [1]  77.25989  58.0  58.0  58.0 109.68317  58.0  80.0  
> 80.0  71.3  69.7  68.0  65.3[13]  58.0  57.0  
> 57.0  57.0  57.0  67.0> alpha_q[1] 67.69373> beta_q[1] 
> 1.321098> gamma_q[1] -0.1129059



Error in nls(vy ~ Mean(x, alpha, beta, gamma), start = list(alpha = alpha_q,  : 
  singular gradient
  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Updating Package Fails: Help on How to Fix Needed

2015-12-11 Thread Rich Shepard

On Fri, 11 Dec 2015, William Dunlap wrote:


stats::sigma was added to R recently.  It is is R-devel now, I don't know
about yesterday's R-3.2.3.


Bill,

  Okay. I intended to update R after the packages. Will run version upgrade,
then see how the package update goes. Result will be reported here.

Thanks,

Rich

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Weird behaviour function args in ellipses

2015-12-11 Thread Mario José Marques-Azevedo
Dears,

I'm having a weird behaviours when setting arguments in functions.

fn <- function(x, st="mean", b=NULL, col.range="black", ...){
  dots <- list(...)
  cat("col.range =", col.range, "\n")
  cat("dots =\n")
  print(dots)
}

fn(1, b=2,col="red")

# Output
col.range = red
dots =
list()

Why 'col' arguments are not in ellipses, but setting col.range to 'red'?

If I change the position of ellipses

fn2 <- function(x, ..., st="mean", b=NULL, col.range="black"){
  dots <- list(...)
  cat("col.range =", col.range, "\n")
  cat("dots =\n")
  print(dots)
}

fn2(1, b=2, col="red")

# Output
col.range = black
dots =
$col
[1] "red"

It works! I'm using R version 3.2.2.

Best regards!

Mario

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Windows R 2.15.1 on Citrix

2015-12-11 Thread Duncan Murdoch

On 11/12/2015 11:49 AM, Tyler Auerbeck wrote:

We're currently having an odd issue on an installation of Windows R 2.15.1
over Citrix. Occasionally we will see the application dissapear. Sometimes
this will happen immediately, after a few minutes, etc. It's never after
the exact same action or same period of time. I've looked at the even logs,
but don't see anything that coordinates with that period of time. Has
anyone run across this issue before? Or can anyone point me to where the R
application may write some of its own logs?


I think you're on your own using such an old version (released June, 
2012).   It's not even the last patch release of the 2.15.x series, 
which was 2.15.3.  And even if you update to the most recent release 
(3.2.3), we probably can't help you with Citrix, though if you identify 
the problem we'll look into it.


Duncan Murdoch

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Weird behaviour function args in ellipses

2015-12-11 Thread David Winsemius

> On Dec 11, 2015, at 9:40 AM, Mario José Marques-Azevedo 
>  wrote:
> 
> Dears,
> 
> I'm having a weird behaviours when setting arguments in functions.
> 
> fn <- function(x, st="mean", b=NULL, col.range="black", ...){
>  dots <- list(...)
>  cat("col.range =", col.range, "\n")
>  cat("dots =\n")
>  print(dots)
> }
> 
> fn(1, b=2,col="red")
> 
> # Output
> col.range = red

Argument matching is done with `pmatch`. So "col" is a partial match to 
"col.range". 

See ?match.arg


> dots =
> list()
> 
> Why 'col' arguments are not in ellipses, but setting col.range to 'red'?
> 
> If I change the position of ellipses
> 
> fn2 <- function(x, ..., st="mean", b=NULL, col.range="black"){
>  dots <- list(...)
>  cat("col.range =", col.range, "\n")
>  cat("dots =\n")
>  print(dots)
> }
> 
> fn2(1, b=2, col="red")
> 
> # Output
> col.range = black
> dots =
> $col
> [1] "red"
> 
> It works! I'm using R version 3.2.2.

It's been that way 'forever'.

> 
> Best regards!
> 
> Mario
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] Windows R 2.15.1 on Citrix

2015-12-11 Thread Tyler Auerbeck
We're currently having an odd issue on an installation of Windows R 2.15.1
over Citrix. Occasionally we will see the application dissapear. Sometimes
this will happen immediately, after a few minutes, etc. It's never after
the exact same action or same period of time. I've looked at the even logs,
but don't see anything that coordinates with that period of time. Has
anyone run across this issue before? Or can anyone point me to where the R
application may write some of its own logs?

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Weird behaviour function args in ellipses

2015-12-11 Thread Duncan Murdoch

On 11/12/2015 12:40 PM, Mario José Marques-Azevedo wrote:

Dears,

I'm having a weird behaviours when setting arguments in functions.

fn <- function(x, st="mean", b=NULL, col.range="black", ...){
   dots <- list(...)
   cat("col.range =", col.range, "\n")
   cat("dots =\n")
   print(dots)
}

fn(1, b=2,col="red")

# Output
col.range = red
dots =
list()

Why 'col' arguments are not in ellipses, but setting col.range to 'red'?


See the R Language Definition manual, section 4.3.2.  Partial matching 
is used on arguments that precede ... in the function definition, exact 
matching on arguments that follow it.


Duncan Murdoch


If I change the position of ellipses

fn2 <- function(x, ..., st="mean", b=NULL, col.range="black"){
   dots <- list(...)
   cat("col.range =", col.range, "\n")
   cat("dots =\n")
   print(dots)
}

fn2(1, b=2, col="red")

# Output
col.range = black
dots =
$col
[1] "red"

It works! I'm using R version 3.2.2.

Best regards!

Mario

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] regexp inside and outside brackets

2015-12-11 Thread Adrian Dușa
For the regexp aficionados, out there:

I need a regular expression to extract either everything within some
brackets, or everything outside the brackets, in a string.

This would be the test string:
"A1{0}~B0{1} CO{a2}NN{12}"

Everything outside the brackets would be:

"A1 ~B0 CO NN"

and everything inside the brackets would be:

"0 1 a2 12"

I have a working solution involving strsplit(), but I wonder if there is a
more direct way.
Thanks in advance for any hint,
Adrian

-- 
Adrian Dusa
University of Bucharest
Romanian Social Data Archive
Soseaua Panduri nr.90
050663 Bucharest sector 5
Romania

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Weird behaviour function args in ellipses

2015-12-11 Thread Duncan Murdoch

On 11/12/2015 1:52 PM, Mario José Marques-Azevedo wrote:

Hi Duncan and David,

Thank you for explanation. I'm really disappointed with this R "resource".
I think that partial match, mainly in function args, must be optional and
not default. We can have many problems and lost hours find errors (it occur
with me). I tried to find a solution to disable partial match, but it seems
that is not possible. Program with hacks for this will be sad.


Nowadays with smart editors, I agree that partial matching isn't really 
necessary.  However, R has been around for 20 years, and lots of 
existing code depends on it.   Eventually you'll get to know the quirks 
of the design.


Duncan Murdoch


Best regards!

Mario



On 11 December 2015 at 15:55, David Winsemius 
wrote:

>
> > On Dec 11, 2015, at 9:40 AM, Mario José Marques-Azevedo <
> mariojm...@gmail.com> wrote:
> >
> > Dears,
> >
> > I'm having a weird behaviours when setting arguments in functions.
> >
> > fn <- function(x, st="mean", b=NULL, col.range="black", ...){
> >  dots <- list(...)
> >  cat("col.range =", col.range, "\n")
> >  cat("dots =\n")
> >  print(dots)
> > }
> >
> > fn(1, b=2,col="red")
> >
> > # Output
> > col.range = red
>
> Argument matching is done with `pmatch`. So "col" is a partial match to
> "col.range".
>
> See ?match.arg
>
>
> > dots =
> > list()
> >
> > Why 'col' arguments are not in ellipses, but setting col.range to 'red'?
> >
> > If I change the position of ellipses
> >
> > fn2 <- function(x, ..., st="mean", b=NULL, col.range="black"){
> >  dots <- list(...)
> >  cat("col.range =", col.range, "\n")
> >  cat("dots =\n")
> >  print(dots)
> > }
> >
> > fn2(1, b=2, col="red")
> >
> > # Output
> > col.range = black
> > dots =
> > $col
> > [1] "red"
> >
> > It works! I'm using R version 3.2.2.
>
> It's been that way 'forever'.
>
> >
> > Best regards!
> >
> > Mario
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> David Winsemius
> Alameda, CA, USA
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Weird behaviour function args in ellipses

2015-12-11 Thread Bert Gunter
I normally don't respond to this sort of rant, but I will here. Feel
free to ignore.

My response is: sour grapes! **I'm really disappointed** that you
failed to read (carefully) the documents (R language manual) or
tutorials (numerous and ubiquitous) that clearly explain this. IMO,
you are blaming others for your failings.

If you care to respond, yours will be the last word. I will not
comment further (and probably shouldn't have here).

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Fri, Dec 11, 2015 at 10:52 AM, Mario José Marques-Azevedo
 wrote:
> Hi Duncan and David,
>
> Thank you for explanation. I'm really disappointed with this R "resource".
> I think that partial match, mainly in function args, must be optional and
> not default. We can have many problems and lost hours find errors (it occur
> with me). I tried to find a solution to disable partial match, but it seems
> that is not possible. Program with hacks for this will be sad.
>
> Best regards!
>
> Mario
>
>
>
> On 11 December 2015 at 15:55, David Winsemius 
> wrote:
>
>>
>> > On Dec 11, 2015, at 9:40 AM, Mario José Marques-Azevedo <
>> mariojm...@gmail.com> wrote:
>> >
>> > Dears,
>> >
>> > I'm having a weird behaviours when setting arguments in functions.
>> >
>> > fn <- function(x, st="mean", b=NULL, col.range="black", ...){
>> >  dots <- list(...)
>> >  cat("col.range =", col.range, "\n")
>> >  cat("dots =\n")
>> >  print(dots)
>> > }
>> >
>> > fn(1, b=2,col="red")
>> >
>> > # Output
>> > col.range = red
>>
>> Argument matching is done with `pmatch`. So "col" is a partial match to
>> "col.range".
>>
>> See ?match.arg
>>
>>
>> > dots =
>> > list()
>> >
>> > Why 'col' arguments are not in ellipses, but setting col.range to 'red'?
>> >
>> > If I change the position of ellipses
>> >
>> > fn2 <- function(x, ..., st="mean", b=NULL, col.range="black"){
>> >  dots <- list(...)
>> >  cat("col.range =", col.range, "\n")
>> >  cat("dots =\n")
>> >  print(dots)
>> > }
>> >
>> > fn2(1, b=2, col="red")
>> >
>> > # Output
>> > col.range = black
>> > dots =
>> > $col
>> > [1] "red"
>> >
>> > It works! I'm using R version 3.2.2.
>>
>> It's been that way 'forever'.
>>
>> >
>> > Best regards!
>> >
>> > Mario
>> >
>> >   [[alternative HTML version deleted]]
>> >
>> > __
>> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> > and provide commented, minimal, self-contained, reproducible code.
>>
>> David Winsemius
>> Alameda, CA, USA
>>
>>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Updating Package Fails: Help on How to Fix Needed

2015-12-11 Thread Rich Shepard

On Fri, 11 Dec 2015, Duncan Murdoch wrote:


I don't see that.  You need to give more details:  I'd start with
sessionInfo(), and the version number of the pbkrtest package that you're
trying to install. (If R is downloading it for you,
available.packages()["pbkrtest",] will give lots of useful information.)


Duncan,

  Started R and the update.packages() function. Selected the Seattle, WA
one.

pbkrtest :
 Version 0.4-2 installed in /usr/lib/R/library
 Version 0.4-3 available at https://cran.fhcrc.org
Update (y/N/c)?  y
trying URL 'https://cran.fhcrc.org/src/contrib/pbkrtest_0.4-3.tar.gz'
Content type 'application/x-gzip' length 164415 bytes (160 KB)
==
downloaded 160 KB

* installing *source* package ‘pbkrtest’ ...
** package ‘pbkrtest’ successfully unpacked and MD5 sums checked
** R
** data
** inst
** preparing package for lazy loading
Warning: replacing previous import by ‘stats::sigma’ when loading ‘pbkrtest’
Error : object ‘sigma’ is not exported by 'namespace:stats'
ERROR: lazy loading failed for package ‘pbkrtest’
* removing ‘/usr/lib/R/library/pbkrtest’
* restoring previous ‘/usr/lib/R/library/pbkrtest’

The downloaded source packages are in
‘/tmp/RtmpQGb2HS/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages(update[instlib == l, "Package"], l, contriburl =
contriburl,  :
  installation of package ‘pbkrtest’ had non-zero exit status


sessionInfo()

R version 3.2.2 (2015-08-14)
Platform: i486-slackware-linux-gnu (32-bit)
Running under: Slackware 14.1

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8LC_COLLATE=C
 [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C 
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C


attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_3.2.2 tcltk_3.2.2


available.packages()["pbkrtest",]

 Package
  "pbkrtest"
 Version
 "0.4-3"
Priority
  NA
 Depends
"R (>= 3.0.2), lme4 (>= 1.1.10)"
 Imports 
"Matrix (>= 1.1.1), parallel, MASS, methods"

   LinkingTo
  NA
Suggests
"gplots"
Enhances
  NA
 License
"GPL (>= 2)"
 License_is_FOSS
  NA
   License_restricts_use
  NA
 OS_type
  NA
   Archs
  NA
  MD5sum
  NA
NeedsCompilation
"no"
File
  NA
  Repository
 "https://cran.fhcrc.org/src/contrib;

  Installed is lme4 Version: 1.1-10.

Rich

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Updating Package Fails: Help on How to Fix Needed

2015-12-11 Thread William Dunlap
stats::sigma was added to R recently.  It is is R-devel now, I don't know
about yesterday's R-3.2.3.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Fri, Dec 11, 2015 at 11:05 AM, Duncan Murdoch
 wrote:
> On 11/12/2015 1:44 PM, Rich Shepard wrote:
>>
>> Trying to update package pbkrtest failed because of a missing object
>> in
>> another namespace. Not having experienced this issue before now I don't
>> know
>> what to do to fix the problem. Here's the story:
>>
>> * installing *source* package ‘pbkrtest’ ...
>> ** package ‘pbkrtest’ successfully unpacked and MD5 sums checked
>> ** R
>> ** data
>> ** inst
>> ** preparing package for lazy loading
>> Warning: replacing previous import by ‘stats::sigma’ when loading
>> ‘pbkrtest’
>> Error : object ‘sigma’ is not exported by 'namespace:stats'
>> ERROR: lazy loading failed for package ‘pbkrtest’
>> * removing ‘/usr/lib/R/library/pbkrtest’
>> * restoring previous ‘/usr/lib/R/library/pbkrtest’
>>
>> The downloaded source packages are in
>> ‘/tmp/RtmppHtiuJ/downloaded_packages’
>> Updating HTML index of packages in '.Library'
>> Making 'packages.html' ... done
>> Warning message:
>> In install.packages(update[instlib == l, "Package"], l, contriburl =
>> contriburl,  :
>> installation of package ‘pbkrtest’ had non-zero exit status
>>
>> Advice needed.
>
>
> I don't see that.  You need to give more details:  I'd start with
> sessionInfo(), and the version number of the pbkrtest package that you're
> trying to install.  (If R is downloading it for you,
> available.packages()["pbkrtest",]  will give lots of useful information.)
>
> Duncan Murdoch
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Updating Package Fails: Help on How to Fix Needed

2015-12-11 Thread Rich Shepard

On Fri, 11 Dec 2015, Rich Shepard wrote:


On Fri, 11 Dec 2015, William Dunlap wrote:


stats::sigma was added to R recently.  It is is R-devel now, I don't know
about yesterday's R-3.2.3.



 Okay. I intended to update R after the packages. Will run version upgrade,
then see how the package update goes. Result will be reported here.


  Well, R-3.2.3 does not include stats::sigma. An upgraded version of stats
is apparently not yet released. I'll wait to upgrade pbkrtes until next
Friday.

Thanks Duncan and Bill,

Rich

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Updating Package Fails: Help on How to Fix Needed

2015-12-11 Thread Duncan Murdoch

On 11/12/2015 2:36 PM, William Dunlap wrote:

stats::sigma was added to R recently.  It is is R-devel now, I don't know
about yesterday's R-3.2.3.


As Rich saw, it's not.  pbkrtest should have "Depends: R (>= 3.3.0)" 
instead of "Depends: R (>= 3.0.0)" in its DESCRIPTION.

You can see it failed tests on CRAN.

Duncan Murdoch

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Fri, Dec 11, 2015 at 11:05 AM, Duncan Murdoch
 wrote:
> On 11/12/2015 1:44 PM, Rich Shepard wrote:
>>
>> Trying to update package pbkrtest failed because of a missing object
>> in
>> another namespace. Not having experienced this issue before now I don't
>> know
>> what to do to fix the problem. Here's the story:
>>
>> * installing *source* package ‘pbkrtest’ ...
>> ** package ‘pbkrtest’ successfully unpacked and MD5 sums checked
>> ** R
>> ** data
>> ** inst
>> ** preparing package for lazy loading
>> Warning: replacing previous import by ‘stats::sigma’ when loading
>> ‘pbkrtest’
>> Error : object ‘sigma’ is not exported by 'namespace:stats'
>> ERROR: lazy loading failed for package ‘pbkrtest’
>> * removing ‘/usr/lib/R/library/pbkrtest’
>> * restoring previous ‘/usr/lib/R/library/pbkrtest’
>>
>> The downloaded source packages are in
>> ‘/tmp/RtmppHtiuJ/downloaded_packages’
>> Updating HTML index of packages in '.Library'
>> Making 'packages.html' ... done
>> Warning message:
>> In install.packages(update[instlib == l, "Package"], l, contriburl =
>> contriburl,  :
>> installation of package ‘pbkrtest’ had non-zero exit status
>>
>> Advice needed.
>
>
> I don't see that.  You need to give more details:  I'd start with
> sessionInfo(), and the version number of the pbkrtest package that you're
> trying to install.  (If R is downloading it for you,
> available.packages()["pbkrtest",]  will give lots of useful information.)
>
> Duncan Murdoch
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Correct notation for functions, packages when using LaTex

2015-12-11 Thread Frank Harrell
Rolf I believe \textsf is the correct font to use for the symbol R but 
not necessarily for the names of R variables and functions.  I'd like 
more discussion about that.

Frank

-- 

Frank E Harrell Jr  Professor and Chairman  School of Medicine

Department of *Biostatistics*   *Vanderbilt University*


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Weird behaviour function args in ellipses

2015-12-11 Thread Hadley Wickham
On Fri, Dec 11, 2015 at 1:13 PM, Duncan Murdoch
 wrote:
> On 11/12/2015 1:52 PM, Mario José Marques-Azevedo wrote:
>>
>> Hi Duncan and David,
>>
>> Thank you for explanation. I'm really disappointed with this R "resource".
>> I think that partial match, mainly in function args, must be optional and
>> not default. We can have many problems and lost hours find errors (it
>> occur
>> with me). I tried to find a solution to disable partial match, but it
>> seems
>> that is not possible. Program with hacks for this will be sad.
>
>
> Nowadays with smart editors, I agree that partial matching isn't really
> necessary.  However, R has been around for 20 years, and lots of existing
> code depends on it.   Eventually you'll get to know the quirks of the
> design.

And if you really dislike this behavour, you can at least warn on it:

options(
  warnPartialMatchArgs = TRUE,
  warnPartialMatchAttr = TRUE,
  warnPartialMatchDollar = TRUE
)

Hadley

-- 
http://had.co.nz/

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] Updating Package Fails: Help on How to Fix Needed

2015-12-11 Thread Rich Shepard

  Trying to update package pbkrtest failed because of a missing object in
another namespace. Not having experienced this issue before now I don't know
what to do to fix the problem. Here's the story:

* installing *source* package ‘pbkrtest’ ...
** package ‘pbkrtest’ successfully unpacked and MD5 sums checked
** R
** data
** inst
** preparing package for lazy loading
Warning: replacing previous import by ‘stats::sigma’ when loading ‘pbkrtest’
Error : object ‘sigma’ is not exported by 'namespace:stats'
ERROR: lazy loading failed for package ‘pbkrtest’
* removing ‘/usr/lib/R/library/pbkrtest’
* restoring previous ‘/usr/lib/R/library/pbkrtest’

The downloaded source packages are in
‘/tmp/RtmppHtiuJ/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages(update[instlib == l, "Package"], l, contriburl =
contriburl,  :
  installation of package ‘pbkrtest’ had non-zero exit status

  Advice needed.

Rich

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Weird behaviour function args in ellipses

2015-12-11 Thread Mario José Marques-Azevedo
Hi Duncan and David,

Thank you for explanation. I'm really disappointed with this R "resource".
I think that partial match, mainly in function args, must be optional and
not default. We can have many problems and lost hours find errors (it occur
with me). I tried to find a solution to disable partial match, but it seems
that is not possible. Program with hacks for this will be sad.

Best regards!

Mario



On 11 December 2015 at 15:55, David Winsemius 
wrote:

>
> > On Dec 11, 2015, at 9:40 AM, Mario José Marques-Azevedo <
> mariojm...@gmail.com> wrote:
> >
> > Dears,
> >
> > I'm having a weird behaviours when setting arguments in functions.
> >
> > fn <- function(x, st="mean", b=NULL, col.range="black", ...){
> >  dots <- list(...)
> >  cat("col.range =", col.range, "\n")
> >  cat("dots =\n")
> >  print(dots)
> > }
> >
> > fn(1, b=2,col="red")
> >
> > # Output
> > col.range = red
>
> Argument matching is done with `pmatch`. So "col" is a partial match to
> "col.range".
>
> See ?match.arg
>
>
> > dots =
> > list()
> >
> > Why 'col' arguments are not in ellipses, but setting col.range to 'red'?
> >
> > If I change the position of ellipses
> >
> > fn2 <- function(x, ..., st="mean", b=NULL, col.range="black"){
> >  dots <- list(...)
> >  cat("col.range =", col.range, "\n")
> >  cat("dots =\n")
> >  print(dots)
> > }
> >
> > fn2(1, b=2, col="red")
> >
> > # Output
> > col.range = black
> > dots =
> > $col
> > [1] "red"
> >
> > It works! I'm using R version 3.2.2.
>
> It's been that way 'forever'.
>
> >
> > Best regards!
> >
> > Mario
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> David Winsemius
> Alameda, CA, USA
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Updating Package Fails: Help on How to Fix Needed

2015-12-11 Thread Duncan Murdoch

On 11/12/2015 1:44 PM, Rich Shepard wrote:

Trying to update package pbkrtest failed because of a missing object in
another namespace. Not having experienced this issue before now I don't know
what to do to fix the problem. Here's the story:

* installing *source* package ‘pbkrtest’ ...
** package ‘pbkrtest’ successfully unpacked and MD5 sums checked
** R
** data
** inst
** preparing package for lazy loading
Warning: replacing previous import by ‘stats::sigma’ when loading ‘pbkrtest’
Error : object ‘sigma’ is not exported by 'namespace:stats'
ERROR: lazy loading failed for package ‘pbkrtest’
* removing ‘/usr/lib/R/library/pbkrtest’
* restoring previous ‘/usr/lib/R/library/pbkrtest’

The downloaded source packages are in
‘/tmp/RtmppHtiuJ/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages(update[instlib == l, "Package"], l, contriburl =
contriburl,  :
installation of package ‘pbkrtest’ had non-zero exit status

Advice needed.


I don't see that.  You need to give more details:  I'd start with 
sessionInfo(), and the version number of the pbkrtest package that 
you're trying to install.  (If R is downloading it for you, 
available.packages()["pbkrtest",]  will give lots of useful information.)


Duncan Murdoch

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Weird behaviour function args in ellipses

2015-12-11 Thread Mario José Marques-Azevedo
Hi all,

Bert it's all ok! My disappointments are blame of my expectations and not
of R. I started with C and Php and learned to be explicit, 'computer do not
to guess what you want', but R do this 'favour' for us. I love work on R
and for my previous experiences I not expected this behaviour (again my
fault). I read others aspects of manual, but this that I supposed to know
(my fault).
But ok, we learn with our faults. And this is good!
Hadley, thank you for options!
Best regards,
Mario
On 11 Dec 2015 18:30, "Hadley Wickham"  wrote:

> On Fri, Dec 11, 2015 at 1:13 PM, Duncan Murdoch
>  wrote:
> > On 11/12/2015 1:52 PM, Mario José Marques-Azevedo wrote:
> >>
> >> Hi Duncan and David,
> >>
> >> Thank you for explanation. I'm really disappointed with this R
> "resource".
> >> I think that partial match, mainly in function args, must be optional
> and
> >> not default. We can have many problems and lost hours find errors (it
> >> occur
> >> with me). I tried to find a solution to disable partial match, but it
> >> seems
> >> that is not possible. Program with hacks for this will be sad.
> >
> >
> > Nowadays with smart editors, I agree that partial matching isn't really
> > necessary.  However, R has been around for 20 years, and lots of existing
> > code depends on it.   Eventually you'll get to know the quirks of the
> > design.
>
> And if you really dislike this behavour, you can at least warn on it:
>
> options(
>   warnPartialMatchArgs = TRUE,
>   warnPartialMatchAttr = TRUE,
>   warnPartialMatchDollar = TRUE
> )
>
> Hadley
>
> --
> http://had.co.nz/
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] regexp inside and outside brackets

2015-12-11 Thread Adrian Dușa
Actually, Marc, I think your solution might be more useful than it first
seemed.
The correct usage of a string would be for someone to provide complete
pairs of outside and inside brackets information, like:
A{1} B{0}

But if a user doesn't provide this "standard" notation, as in:
A{1} B

then your solution helps to trap this error and break the function.
It is of course a different problem than my initial email, but it just
struck me that such an error should ideally be trapped.

Many thanks for the useful insight,
Adrian

On Fri, Dec 11, 2015 at 5:29 PM, Marc Schwartz  wrote:

> Hi,
>
> Needless to say, Jeff's solution is easier than my second one. I was
> wrestling in dealing with the greedy nature of regex's and so shifted to
> thinking about the use of the functions that I proposed in the second
> scenario.
>
> Also, I was a bit hypo-caffeinated ... ;-)
>
> Regards,
>
> Marc
>
>
> > On Dec 11, 2015, at 9:12 AM, Adrian Dușa  wrote:
> >
> > Thanks very much, Marc and Jeff.
> > Jeff's solutions seem to be simple one liners. I really need to learn
> these
> > things, too powerful to ignore.
> >
> > Thank you very much,
> > Adrian
> >
> > On Fri, Dec 11, 2015 at 5:05 PM, Jeff Newmiller <
> jdnew...@dcn.davis.ca.us>
> > wrote:
> >
> >> The gsub function is your friend.
> >>
> >> s <- "A1{0}~B0{1} CO{a2}NN{12}"
> >> gsub( "([^{}]*)\\{([^{}]*)\\}", "\\1 ", s )
> >> gsub( "([^{}]*)\\{([^{}]*)\\}", "\\2 ", s )
> >>
> >> but keep in mind that there are many resources on the Internet for
> >> learning about regular expressions... they are hardly R-specific.
> >>
> >> --
> >> Sent from my phone. Please excuse my brevity.
> >>
> >> On December 11, 2015 5:50:28 AM PST, "Adrian Dușa" <
> dusa.adr...@unibuc.ro>
> >> wrote:
> >>>
> >>> For the regexp aficionados, out there:
> >>>
> >>> I need a regular expression to extract either everything within some
> >>> brackets, or everything outside the brackets, in a string.
> >>>
> >>> This would be the test string:
> >>> "A1{0}~B0{1} CO{a2}NN{12}"
> >>>
> >>> Everything outside the brackets would be:
> >>>
> >>> "A1 ~B0 CO NN"
> >>>
> >>> and everything inside the brackets would be:
> >>>
> >>> "0 1 a2 12"
> >>>
> >>> I have a working solution involving strsplit(), but I wonder if there
> is a
> >>> more direct way.
> >>> Thanks in advance for any hint,
> >>> Adrian
> >>>
> >>>
> >
> >
> > --
> > Adrian Dusa
> > University of Bucharest
> > Romanian Social Data Archive
> > Soseaua Panduri nr.90
> > 050663 Bucharest sector 5
> > Romania
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>


-- 
Adrian Dusa
University of Bucharest
Romanian Social Data Archive
Soseaua Panduri nr.90
050663 Bucharest sector 5
Romania

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.