Re: [R-es] separadores de miles.

2021-10-14 Thread JCMld
Quizás podrías tener 2 columnas, una numérica sobre la que se base el gráfico y 
otra tipo carácter, con los separadores para cuando necesites usar esa 
presentación.

Saludos,

Juan

 

 

De: juan manuel dias  
Enviado el: jueves, 14 de octubre de 2021 20:45
Para: JCMld 
CC: Lista R 
Asunto: Re: [R-es] separadores de miles.

 

Claro entiendo! ...en algunos casos pude guardar como character y mostrar la 
los números con los separadores, pero hay tablas donde necesito además de 
mostrar el número hacer un gráfico con esa misma variable...pero cuándo 
modifico a character "monto total de la factura" me arroja error porque no 
puede hacer el gráfico de barras al no ser numérica!

Alguien sabe como resolver esto? 

 

 



 

El jue, 14 oct 2021 a las 13:51, JCMld (mailto:jc...@carmonarocha.com> >) escribió:

Hola Juan Manuel,

Si el dato es numérico no puede guardarse con separadores, a no ser que lo
convirtieras a character, ya que el separador es un tema de formato de
salida.

Entonces tienes 2 opciones, o lo guardas como numérico, pero a la hora de
presentarlo lo imprimes con la función format, o bien lo conviertes a
character con la misma función.

Me explico:

> a<-10023.2
> a
[1] 10023.2
> format(a,decimal.mark = ",",big.mark = ".")
[1] "10.023,2"
> 
> b<-123691353
> 
> format(b,decimal.mark = ",",big.mark = ".")
[1] "123.691.353"


Saludos,
Juan

-Mensaje original-
De: R-help-es mailto:r-help-es-boun...@r-project.org> > En nombre de juan manuel
dias
Enviado el: jueves, 14 de octubre de 2021 18:40
Para: Lista R mailto:r-help-es@r-project.org> >
Asunto: [R-es] separadores de miles.

Hola. Como andan!
Consulta, del siguiente data frame la columna "importe $" es de tipo
numérico y querría que siga siendo numérica pero agregando separadores de
miles.

Proveedores`Importe en $` Porcentaje
   
1 ORIEN SA  336970003  14
2 JANSSEN CILAG  1117313805
3 MANFREY COOP 1236913535
4 Otros  1816210357.72

Por ejemplo, que 123691353 pase a 123.691.353.

Cuándo hago esto:

tabla.prov.sort$`Importe en $` <- format(tabla.prov.sort$`Importe en $`,
big.mark = ".") class(tabla.prov.sort$`Importe en $`) [1] "character"

Y si hago esto:

tabla.prov.sort$`Importe en $` <-
as.numeric(format(tabla.prov.sort$`Importe en $`, big.mark = "."))

Warning message:
NAs introducidos por coerción

Se les ocurre como hacer?

Muchas gracias!

Saludos, Juan.

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org  
https://stat.ethz.ch/mailman/listinfo/r-help-es

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] how to do inverse log of every value in every column in data frame

2021-10-14 Thread Bert Gunter
This was already clear from Rich Heiberger's reply. But my point was not
that the as.matrix() coercion was necessary, but that it would be wise, as
operations with matrices are generally (often much) more efficient than
with data frames. Of course, other considerations may exist, but that was
my point, which I should evidently have made clearer.

Cheers,
Bert
On Thu, Oct 14, 2021 at 11:19 AM Rui Barradas  wrote:

> Hello,
>
> The answer is given but there is no need to coerce to matrix first, as
> long as the columns are numeric.
>  From ?exp, right at the beginning of section Details:
>
> Details
> All except logb are generic functions: methods can be defined for them
> individually or via the Math group generic.
>
>
> Follow the link Math:
>
>
> Details
> There are four groups for which S3 methods can be written, namely the
> "Math", "Ops", "Summary" and "Complex" groups. These are not R objects
> in base R, but methods can be supplied for them and base R contains
> factor, data.frame and difftime methods for the first three groups.
>
>
> And exp is the group "Math", 2nd bullet.
>
> class(mtcars)
> #[1] "data.frame"
> exp(mtcars)
> # output omitted
>
>
> But if a column is not numeric the method Math.data.frame throws an error.
>
>
> exp(iris)
> #Error in Math.data.frame(iris) :
> #  non-numeric-alike variable(s) in data frame: Species
>
> exp(iris[-5]) # remove the offending column
> # output omitted
>
>
> Hope this helps,
>
> Rui Barradas
>
>
> Às 18:23 de 14/10/21, Ana Marija escreveu:
> > Thank you so much!
> >
> > On Thu, Oct 14, 2021 at 12:17 PM Bert Gunter 
> wrote:
> >
> >> As all of your columns are numeric, you should probably convert your df
> to
> >> a matrix. Then use exp() on that, of course:
> >> exp(as.matrix(b))
> >>
> >> see ?exp
> >>
> >> 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 Thu, Oct 14, 2021 at 10:10 AM Ana Marija <
> sokovic.anamar...@gmail.com>
> >> wrote:
> >>
> >>> Hi All,
> >>>
> >>> I have a data frame like this:
> >>>
>  head(b)
> >>>   LRET02LRET04LRET06LRET08LRET10LRET12
> LRET14
> >>> 1 0 0.6931472 . 1.0986123 1.0986123 1.0986123 0.6931472
> >>> 2 2.1972246 2.4849066 2.4849066 . 2.5649494 2.6390573 2.6390573
> >>> 3 1.6094379 1.7917595 1.6094379 1.7917595 2.0794415 1.9459101 2.0794415
> >>> 4 0 0 0 0 0 0 0
> >>> 5 0.6931472 0 1.0986123 1.0986123 0.6931472 0.6931472 0.6931472
> >>> 6 1.0986123 1.0986123 1.0986123 0.6931472 1.0986123 1.3862944 1.0986123
> >>>
> >>> All values in this data frame are product of natural log. I have to do
> >>> inverse of it.
> >>> So for example do do inverse of 0.6931472 I would do:
>  2.718281828^0.6931472
> >>> [1] 2
> >>>
> >>> How do I perform this operation for every single value in this data
> frame?
> >>>
> >>> The original data frame is this dimension:
>  dim(b)
> >>> [1] 1441   18
> >>>
> >>> Thanks
> >>> Ana
> >>>
> >>>  [[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.
> >
>

[[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-es] separadores de miles.

2021-10-14 Thread juan manuel dias
Claro entiendo! ...en algunos casos pude guardar como character y mostrar
la los números con los separadores, pero hay tablas donde necesito además
de mostrar el número hacer un gráfico con esa misma variable...pero cuándo
modifico a character "monto total de la factura" me arroja error porque no
puede hacer el gráfico de barras al no ser numérica!
Alguien sabe como resolver esto?


[image: image.png]

El jue, 14 oct 2021 a las 13:51, JCMld () escribió:

> Hola Juan Manuel,
>
> Si el dato es numérico no puede guardarse con separadores, a no ser que lo
> convirtieras a character, ya que el separador es un tema de formato de
> salida.
>
> Entonces tienes 2 opciones, o lo guardas como numérico, pero a la hora de
> presentarlo lo imprimes con la función format, o bien lo conviertes a
> character con la misma función.
>
> Me explico:
>
> > a<-10023.2
> > a
> [1] 10023.2
> > format(a,decimal.mark = ",",big.mark = ".")
> [1] "10.023,2"
> >
> > b<-123691353
> >
> > format(b,decimal.mark = ",",big.mark = ".")
> [1] "123.691.353"
>
>
> Saludos,
> Juan
>
> -Mensaje original-
> De: R-help-es  En nombre de juan manuel
> dias
> Enviado el: jueves, 14 de octubre de 2021 18:40
> Para: Lista R 
> Asunto: [R-es] separadores de miles.
>
> Hola. Como andan!
> Consulta, del siguiente data frame la columna "importe $" es de tipo
> numérico y querría que siga siendo numérica pero agregando separadores de
> miles.
>
> Proveedores`Importe en $` Porcentaje
>
> 1 ORIEN SA  336970003  14
> 2 JANSSEN CILAG  1117313805
> 3 MANFREY COOP 1236913535
> 4 Otros  1816210357.72
>
> Por ejemplo, que 123691353 pase a 123.691.353.
>
> Cuándo hago esto:
>
> tabla.prov.sort$`Importe en $` <- format(tabla.prov.sort$`Importe en $`,
> big.mark = ".") class(tabla.prov.sort$`Importe en $`) [1] "character"
>
> Y si hago esto:
>
> tabla.prov.sort$`Importe en $` <-
> as.numeric(format(tabla.prov.sort$`Importe en $`, big.mark = "."))
>
> Warning message:
> NAs introducidos por coerción
>
> Se les ocurre como hacer?
>
> Muchas gracias!
>
> Saludos, Juan.
>
> [[alternative HTML version deleted]]
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>
>
___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] how to do inverse log of every value in every column in data frame

2021-10-14 Thread Rui Barradas

Hello,

The answer is given but there is no need to coerce to matrix first, as 
long as the columns are numeric.

From ?exp, right at the beginning of section Details:

Details
All except logb are generic functions: methods can be defined for them 
individually or via the Math group generic.



Follow the link Math:


Details
There are four groups for which S3 methods can be written, namely the 
"Math", "Ops", "Summary" and "Complex" groups. These are not R objects 
in base R, but methods can be supplied for them and base R contains 
factor, data.frame and difftime methods for the first three groups.



And exp is the group "Math", 2nd bullet.

class(mtcars)
#[1] "data.frame"
exp(mtcars)
# output omitted


But if a column is not numeric the method Math.data.frame throws an error.


exp(iris)
#Error in Math.data.frame(iris) :
#  non-numeric-alike variable(s) in data frame: Species

exp(iris[-5]) # remove the offending column
# output omitted


Hope this helps,

Rui Barradas


Às 18:23 de 14/10/21, Ana Marija escreveu:

Thank you so much!

On Thu, Oct 14, 2021 at 12:17 PM Bert Gunter  wrote:


As all of your columns are numeric, you should probably convert your df to
a matrix. Then use exp() on that, of course:
exp(as.matrix(b))

see ?exp

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 Thu, Oct 14, 2021 at 10:10 AM Ana Marija 
wrote:


Hi All,

I have a data frame like this:


head(b)

  LRET02LRET04LRET06LRET08LRET10LRET12LRET14
1 0 0.6931472 . 1.0986123 1.0986123 1.0986123 0.6931472
2 2.1972246 2.4849066 2.4849066 . 2.5649494 2.6390573 2.6390573
3 1.6094379 1.7917595 1.6094379 1.7917595 2.0794415 1.9459101 2.0794415
4 0 0 0 0 0 0 0
5 0.6931472 0 1.0986123 1.0986123 0.6931472 0.6931472 0.6931472
6 1.0986123 1.0986123 1.0986123 0.6931472 1.0986123 1.3862944 1.0986123

All values in this data frame are product of natural log. I have to do
inverse of it.
So for example do do inverse of 0.6931472 I would do:

2.718281828^0.6931472

[1] 2

How do I perform this operation for every single value in this data frame?

The original data frame is this dimension:

dim(b)

[1] 1441   18

Thanks
Ana

 [[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.



__
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] [External] how to do inverse log of every value in every column in data frame

2021-10-14 Thread Rui Barradas

Hello,

exp() is better, see the 2nd identical:


identical(
  exp(tmp),
  2.718281828^tmp
)
#[1] FALSE
identical(
  exp(tmp),
  exp(1)^tmp
)
#[1] FALSE

all.equal(
  exp(tmp),
  2.718281828^tmp
)
#[1] TRUE
all.equal(
  exp(tmp),
  exp(1)^tmp
)
#[1] TRUE





Às 18:16 de 14/10/21, Richard M. Heiberger escreveu:

tmp <- data.frame(a=1:3,b=4:6)
exp(tmp)

   a b
1  2.718282  54.59815
2  7.389056 148.41316
3 20.085537 403.42879

2.718281828^tmp

   a b
1  2.718282  54.59815
2  7.389056 148.41316
3 20.085537 403.42879



On Oct 14, 2021, at 13:10, Ana Marija  wrote:


2.718281828^


__
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] how to do inverse log of every value in every column in data frame

2021-10-14 Thread Ana Marija
Thank you so much!

On Thu, Oct 14, 2021 at 12:17 PM Bert Gunter  wrote:

> As all of your columns are numeric, you should probably convert your df to
> a matrix. Then use exp() on that, of course:
> exp(as.matrix(b))
>
> see ?exp
>
> 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 Thu, Oct 14, 2021 at 10:10 AM Ana Marija 
> wrote:
>
>> Hi All,
>>
>> I have a data frame like this:
>>
>> > head(b)
>>  LRET02LRET04LRET06LRET08LRET10LRET12LRET14
>> 1 0 0.6931472 . 1.0986123 1.0986123 1.0986123 0.6931472
>> 2 2.1972246 2.4849066 2.4849066 . 2.5649494 2.6390573 2.6390573
>> 3 1.6094379 1.7917595 1.6094379 1.7917595 2.0794415 1.9459101 2.0794415
>> 4 0 0 0 0 0 0 0
>> 5 0.6931472 0 1.0986123 1.0986123 0.6931472 0.6931472 0.6931472
>> 6 1.0986123 1.0986123 1.0986123 0.6931472 1.0986123 1.3862944 1.0986123
>>
>> All values in this data frame are product of natural log. I have to do
>> inverse of it.
>> So for example do do inverse of 0.6931472 I would do:
>> > 2.718281828^0.6931472
>> [1] 2
>>
>> How do I perform this operation for every single value in this data frame?
>>
>> The original data frame is this dimension:
>> > dim(b)
>> [1] 1441   18
>>
>> Thanks
>> Ana
>>
>> [[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] how to do inverse log of every value in every column in data frame

2021-10-14 Thread Bert Gunter
As all of your columns are numeric, you should probably convert your df to
a matrix. Then use exp() on that, of course:
exp(as.matrix(b))

see ?exp

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 Thu, Oct 14, 2021 at 10:10 AM Ana Marija 
wrote:

> Hi All,
>
> I have a data frame like this:
>
> > head(b)
>  LRET02LRET04LRET06LRET08LRET10LRET12LRET14
> 1 0 0.6931472 . 1.0986123 1.0986123 1.0986123 0.6931472
> 2 2.1972246 2.4849066 2.4849066 . 2.5649494 2.6390573 2.6390573
> 3 1.6094379 1.7917595 1.6094379 1.7917595 2.0794415 1.9459101 2.0794415
> 4 0 0 0 0 0 0 0
> 5 0.6931472 0 1.0986123 1.0986123 0.6931472 0.6931472 0.6931472
> 6 1.0986123 1.0986123 1.0986123 0.6931472 1.0986123 1.3862944 1.0986123
>
> All values in this data frame are product of natural log. I have to do
> inverse of it.
> So for example do do inverse of 0.6931472 I would do:
> > 2.718281828^0.6931472
> [1] 2
>
> How do I perform this operation for every single value in this data frame?
>
> The original data frame is this dimension:
> > dim(b)
> [1] 1441   18
>
> Thanks
> Ana
>
> [[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] [External] how to do inverse log of every value in every column in data frame

2021-10-14 Thread Richard M. Heiberger
> tmp <- data.frame(a=1:3,b=4:6)
> exp(tmp)
  a b
1  2.718282  54.59815
2  7.389056 148.41316
3 20.085537 403.42879
> 2.718281828^tmp
  a b
1  2.718282  54.59815
2  7.389056 148.41316
3 20.085537 403.42879


> On Oct 14, 2021, at 13:10, Ana Marija  wrote:
> 
>> 2.718281828^

__
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] how to do inverse log of every value in every column in data frame

2021-10-14 Thread Ana Marija
Hi All,

I have a data frame like this:

> head(b)
 LRET02LRET04LRET06LRET08LRET10LRET12LRET14
1 0 0.6931472 . 1.0986123 1.0986123 1.0986123 0.6931472
2 2.1972246 2.4849066 2.4849066 . 2.5649494 2.6390573 2.6390573
3 1.6094379 1.7917595 1.6094379 1.7917595 2.0794415 1.9459101 2.0794415
4 0 0 0 0 0 0 0
5 0.6931472 0 1.0986123 1.0986123 0.6931472 0.6931472 0.6931472
6 1.0986123 1.0986123 1.0986123 0.6931472 1.0986123 1.3862944 1.0986123

All values in this data frame are product of natural log. I have to do
inverse of it.
So for example do do inverse of 0.6931472 I would do:
> 2.718281828^0.6931472
[1] 2

How do I perform this operation for every single value in this data frame?

The original data frame is this dimension:
> dim(b)
[1] 1441   18

Thanks
Ana

[[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] Sebastian Meyer joins the R core team

2021-10-14 Thread Martin Maechler


We are very happy to announce that

Sebastian Meyer (http://www.imbe.med.uni-erlangen.de/ma/S.Meyer ;
 Twitter @bastistician; also https://github.com/bastistician/)

has joined the R core team yesterday (Oct 13).  He has been an
active contributor notably in handling and fixing R bugzilla issues in
dozens of contributions and also by direct communication,
mainly during the last 2 years but starting considerably earlier.

The R Core team

___
r-annou...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-announce

__
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-es] separadores de miles.

2021-10-14 Thread JCMld
Hola Juan Manuel,

Si el dato es numérico no puede guardarse con separadores, a no ser que lo
convirtieras a character, ya que el separador es un tema de formato de
salida.

Entonces tienes 2 opciones, o lo guardas como numérico, pero a la hora de
presentarlo lo imprimes con la función format, o bien lo conviertes a
character con la misma función.

Me explico:

> a<-10023.2
> a
[1] 10023.2
> format(a,decimal.mark = ",",big.mark = ".")
[1] "10.023,2"
> 
> b<-123691353
> 
> format(b,decimal.mark = ",",big.mark = ".")
[1] "123.691.353"


Saludos,
Juan

-Mensaje original-
De: R-help-es  En nombre de juan manuel
dias
Enviado el: jueves, 14 de octubre de 2021 18:40
Para: Lista R 
Asunto: [R-es] separadores de miles.

Hola. Como andan!
Consulta, del siguiente data frame la columna "importe $" es de tipo
numérico y querría que siga siendo numérica pero agregando separadores de
miles.

Proveedores`Importe en $` Porcentaje
   
1 ORIEN SA  336970003  14
2 JANSSEN CILAG  1117313805
3 MANFREY COOP 1236913535
4 Otros  1816210357.72

Por ejemplo, que 123691353 pase a 123.691.353.

Cuándo hago esto:

tabla.prov.sort$`Importe en $` <- format(tabla.prov.sort$`Importe en $`,
big.mark = ".") class(tabla.prov.sort$`Importe en $`) [1] "character"

Y si hago esto:

tabla.prov.sort$`Importe en $` <-
as.numeric(format(tabla.prov.sort$`Importe en $`, big.mark = "."))

Warning message:
NAs introducidos por coerción

Se les ocurre como hacer?

Muchas gracias!

Saludos, Juan.

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] Eliminar todos los caracteres después de un espacio en blanco

2021-10-14 Thread juan manuel dias
Muy buena también! gracias Carlos!

El mié, 13 oct 2021 a las 3:58, Carlos Ortega ()
escribió:

> Hola,
>
> Aún cerrada la duda, dejo aquí otra posible alternativa:
>
> #---
>
> > library(stringr)
> > a <- c("7/6/2020 7:55:38 p.m.", "7/3/2020 1:08:36 p.m.", "7/3/2020
> 6:08:35 p.m.")
> > mis_fechas <- word(a, 1, sep = fixed(" "))
> > mis_fechas
> [1] "7/6/2020" "7/3/2020" "7/3/2020"
> >
>
> #---
>
> Gracias,
> Carlos Ortega
> www.qualityexcellence.es
>
> El mar, 12 oct 2021 a las 20:07, juan manuel dias ()
> escribió:
>
>> Hola, muchas gracias!
>> Funcionó perfecto!
>> Saludos, Juan.
>>
>> El mar, 12 oct 2021 a las 13:48, Proyecto R-UCA ()
>> escribió:
>>
>> > Buenas, Juan:
>> >
>> > A ver si esto te sirve:
>> > a <- c("7/6/2020 7:55:38 p.m.", "7/3/2020 1:08:36 p.m.", "7/3/2020
>> > 6:08:35 p.m.")
>> > f <- function(x) {
>> > strsplit(x, " ")[[1]][1]
>> > }
>> > unlist(lapply(a, f))
>> >
>> > [1] "7/6/2020" "7/3/2020" "7/3/2020"
>> >
>> > Un saludo
>> >
>> > El mar, 12-10-2021 a las 13:19 -0300, juan manuel dias escribió:
>> > > Hola José, como andas!
>> > >
>> > > Por alguna razón me trae algún problema hacerlo de ese modolo que
>> > > venía
>> > > haciendo es dejar las cadenas en
>> > >
>> > > 7/6/2020
>> > > 7/3/2020
>> > >
>> > > Y luego con lubridate resolvía de este modo...
>> > >
>> > > movimientos.exp$`Fecha de caratulación`<-
>> > > lubridate::mdy(movimientos.exp$`Fecha de caratulación`)
>> > >
>> > > Por eso necesito primero limpiar la cadena...sacando todo lo que
>> > > sigue al
>> > > espacio.
>> > >
>> > > Muchas gracias!
>> > >
>> > > El mar, 12 oct 2021 a las 12:44, jose luis ()
>> > > escribió:
>> > >
>> > > > ¿asi te valdria?
>> > > >
>> > > > datos$FECHA <- as.Date(datos$FECHA, format = "%d/%m/%Y")
>> > > >
>> > > > En martes, 12 de octubre de 2021 17:28:28 CEST, juan manuel dias <
>> > > > juamad...@gmail.com> escribió:
>> > > >
>> > > >
>> > > > Hola, como andan!
>> > > > Tengo una variable con fechas que están en formato cadena y se me
>> > > > complica
>> > > > para trabajarlas directamente con lubridate, antes tengo que
>> > > > hacerle unos
>> > > > retoques y necesitaría eliminar todo lo que aparece después del
>> > > > espacio en
>> > > > blancoes decir eliminar horas minutos segundos y p.m. am.
>> > > > Se les ocurre como hacer?
>> > > > Muchas gracias! Juan.
>> > > >
>> > > > 7/6/2020 7:55:38 p.m.
>> > > > 7/3/2020 1:08:36 p.m.
>> > > > 7/3/2020 6:08:35 p.m.
>> > > > 6/1/2020 1:15:19 p.m.
>> > > > 7/8/2020 7:18:26 p.m.
>> > > > 8/6/2020 5:59:32 p.m.
>> > > > 9/1/2020 5:40:57 p.m.
>> > > >
>> > > > [[alternative HTML version deleted]]
>> > > >
>> > > > ___
>> > > > R-help-es mailing list
>> > > > R-help-es@r-project.org
>> > > > https://stat.ethz.ch/mailman/listinfo/r-help-es
>> > > >
>> > >
>> > > [[alternative HTML version deleted]]
>> > >
>> > > ___
>> > > R-help-es mailing list
>> > > R-help-es@r-project.org
>> > > https://stat.ethz.ch/mailman/listinfo/r-help-es
>> >
>> > ___
>> > R-help-es mailing list
>> > R-help-es@r-project.org
>> > https://stat.ethz.ch/mailman/listinfo/r-help-es
>> >
>>
>> [[alternative HTML version deleted]]
>>
>> ___
>> R-help-es mailing list
>> R-help-es@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-help-es
>>
>
>
> --
> Saludos,
> Carlos Ortega
> www.qualityexcellence.es
>

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


[R-es] separadores de miles.

2021-10-14 Thread juan manuel dias
Hola. Como andan!
Consulta, del siguiente data frame la columna "importe $" es de tipo
numérico y querría que siga siendo numérica pero agregando separadores de
miles.

Proveedores`Importe en $` Porcentaje
   
1 ORIEN SA  336970003  14
2 JANSSEN CILAG  1117313805
3 MANFREY COOP 1236913535
4 Otros  1816210357.72

Por ejemplo, que 123691353 pase a 123.691.353.

Cuándo hago esto:

tabla.prov.sort$`Importe en $` <- format(tabla.prov.sort$`Importe en $`,
big.mark = ".")
class(tabla.prov.sort$`Importe en $`)
[1] "character"

Y si hago esto:

tabla.prov.sort$`Importe en $` <-
as.numeric(format(tabla.prov.sort$`Importe en $`, big.mark = "."))

Warning message:
NAs introducidos por coerción

Se les ocurre como hacer?

Muchas gracias!

Saludos, Juan.

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] How to find local minimum between distributions using mixtools?

2021-10-14 Thread Richard O'Keefe
I presumed there was some reason why the 'optimise' function did not suit you.

optimize(function (x) a*dnorm(x, x1, s1) + (1-a)*dnorm(x, x2, s2),
range(c(x1, x2)))

should do the trick.

On Thu, 14 Oct 2021 at 23:42, Luigi Marongiu  wrote:
>
> Thank you, I hoped there might be an automatic method more than
> function analysis...
>
> On Thu, Oct 14, 2021 at 9:06 AM Richard O'Keefe  wrote:
> >
> > Do you really want the minimum?
> > It sounds as though your model is a*N(x1,s1) + (1-a)*N(x2,s2) where
> > you use mixtools to estimate
> > the parameters.  Finding the derivative of that is fairly
> > straightforward calculus, and solving for the
> > derivative being zero gives you extrema (you want the one between x1 and 
> > x2).
> >
> > In practice I might start with a quick and dirty hack like
> > x <- seq(from min(x1,x2), to=max(x1,x2), length=399)
> > p <- a*dnorm(x, x1, s1) + (1-a)*dnorm(x, x2, s2)
> > m <- min(p)
> > x[x == m]
> >
> > On Wed, 13 Oct 2021 at 22:12, Luigi Marongiu  
> > wrote:
> > >
> > > Hello,
> > > I have two peaks distributions (and some noise values in between), and
> > > I used mixtools to characterize the two overlapping data. How can I
> > > find the minimum between the peak distributions?
> > > The sigma value of the second population is close to that value, but I
> > > am not sure if this is really the cut-off point between the two
> > > distributions (by eye, I would say the value is 0.125 against 0.1 of
> > > the sigma value). Is there a better approach?
> > > Thanks
> > >
> > > ```
> > > set.seed(10)
> > > negative_mr <- runif(50, 0, 0.099)
> > > negative_fcn <- runif(50, 1, 40)
> > > positive_mr <- c(runif(30, 0.2, 0.5), runif(20, 0.4, 0.5))
> > > positive_fcn <- c(runif(30, 25, 40), runif(20, 10, 25))
> > > uncertain_mr <- runif(10, 0.099, 0.2)
> > > uncertain_fcn <- runif(10, 2, 40)
> > > df <- data.frame(Y=c(negative_mr, uncertain_mr, positive_mr),
> > > X=c(negative_fcn, uncertain_fcn, positive_fcn),
> > > GROUP=c(rep("negative", length(negative_mr)),
> > > rep("uncertain", length(uncertain_mr)),
> > > rep("positive", length(positive_mr
> > > library(mixtools)
> > > model = normalmixEM((x = df$Y))
> > > summary(model)
> > > # plot
> > > plot(model, which=2)
> > > Cut_off <- model$sigma[2]
> > > Cut_offE <- 0.125
> > > abline(v=Cut_off, col="blue", lwd=2)
> > > abline(v=Cut_offE, col="blue", lwd=2, lty=2)
> > > plot(df$Y[df$GROUP=="negative"]~df$X[df$GROUP=="negative"],
> > > pch=1, ylim=c(0,0.5), xlim=c(0,41), cex=1.5,
> > > xlab=expression(bold("X")),
> > > ylab=expression(bold("Y")))
> > > points(df$Y[df$GROUP=="positive"]~df$X[df$GROUP=="positive"],
> > > pch=16, cex=1.5)
> > > points(df$Y[df$GROUP=="uncertain"]~df$X[df$GROUP=="uncertain"],
> > > pch=16, cex=1.5, col="grey")
> > > abline(h=Cut_off, col="blue", lwd=2)
> > > abline(h=Cut_offE, col="blue", lwd=2, lty=2)
> > > ```
> > >
> > >
> > > --
> > > Best regards,
> > > Luigi
> > >
> > > __
> > > 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.
>
>
>
> --
> Best regards,
> Luigi

__
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] How to find local minimum between distributions using mixtools?

2021-10-14 Thread Luigi Marongiu
Thank you, I hoped there might be an automatic method more than
function analysis...

On Thu, Oct 14, 2021 at 9:06 AM Richard O'Keefe  wrote:
>
> Do you really want the minimum?
> It sounds as though your model is a*N(x1,s1) + (1-a)*N(x2,s2) where
> you use mixtools to estimate
> the parameters.  Finding the derivative of that is fairly
> straightforward calculus, and solving for the
> derivative being zero gives you extrema (you want the one between x1 and x2).
>
> In practice I might start with a quick and dirty hack like
> x <- seq(from min(x1,x2), to=max(x1,x2), length=399)
> p <- a*dnorm(x, x1, s1) + (1-a)*dnorm(x, x2, s2)
> m <- min(p)
> x[x == m]
>
> On Wed, 13 Oct 2021 at 22:12, Luigi Marongiu  wrote:
> >
> > Hello,
> > I have two peaks distributions (and some noise values in between), and
> > I used mixtools to characterize the two overlapping data. How can I
> > find the minimum between the peak distributions?
> > The sigma value of the second population is close to that value, but I
> > am not sure if this is really the cut-off point between the two
> > distributions (by eye, I would say the value is 0.125 against 0.1 of
> > the sigma value). Is there a better approach?
> > Thanks
> >
> > ```
> > set.seed(10)
> > negative_mr <- runif(50, 0, 0.099)
> > negative_fcn <- runif(50, 1, 40)
> > positive_mr <- c(runif(30, 0.2, 0.5), runif(20, 0.4, 0.5))
> > positive_fcn <- c(runif(30, 25, 40), runif(20, 10, 25))
> > uncertain_mr <- runif(10, 0.099, 0.2)
> > uncertain_fcn <- runif(10, 2, 40)
> > df <- data.frame(Y=c(negative_mr, uncertain_mr, positive_mr),
> > X=c(negative_fcn, uncertain_fcn, positive_fcn),
> > GROUP=c(rep("negative", length(negative_mr)),
> > rep("uncertain", length(uncertain_mr)),
> > rep("positive", length(positive_mr
> > library(mixtools)
> > model = normalmixEM((x = df$Y))
> > summary(model)
> > # plot
> > plot(model, which=2)
> > Cut_off <- model$sigma[2]
> > Cut_offE <- 0.125
> > abline(v=Cut_off, col="blue", lwd=2)
> > abline(v=Cut_offE, col="blue", lwd=2, lty=2)
> > plot(df$Y[df$GROUP=="negative"]~df$X[df$GROUP=="negative"],
> > pch=1, ylim=c(0,0.5), xlim=c(0,41), cex=1.5,
> > xlab=expression(bold("X")),
> > ylab=expression(bold("Y")))
> > points(df$Y[df$GROUP=="positive"]~df$X[df$GROUP=="positive"],
> > pch=16, cex=1.5)
> > points(df$Y[df$GROUP=="uncertain"]~df$X[df$GROUP=="uncertain"],
> > pch=16, cex=1.5, col="grey")
> > abline(h=Cut_off, col="blue", lwd=2)
> > abline(h=Cut_offE, col="blue", lwd=2, lty=2)
> > ```
> >
> >
> > --
> > Best regards,
> > Luigi
> >
> > __
> > 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.



-- 
Best regards,
Luigi

__
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] How to select given row of conditionally subsetted dataframe?

2021-10-14 Thread Rui Barradas

Hello,

If the sub-df has more than 2 rows,


tail(df[(df$Y>0.2) & (df$X<10),], 1)


Hope this helps,

Rui Barradas

Às 08:51 de 14/10/21, Luigi Marongiu escreveu:

Hello,
I have selected a subset of a dataframe with the vector syntax (if
this is the name):
```

df[(df$Y>0.2) & (df$X<10),]

  YX
10 0.2200642 1.591589
13 0.2941828 1.485951
```
How can I select only the second row? I only managed to get the whole
of whole columns:
```

df[(df$Y>0.2) & (df$X<10),2]

[1] 1.591589 1.485951

df[(df$Y>0.2) & (df$X<10),][2]

  X
10 1.591589
13 1.485951

df[(df$Y>0.2) & (df$X<10),][1]

  Y
10 0.2200642
13 0.2941828
```
Thank you

__
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] How to select given row of conditionally subsetted dataframe?

2021-10-14 Thread Luigi Marongiu
Got it, thanks!

On Thu, Oct 14, 2021 at 9:59 AM Eric Berger  wrote:
>
> df[(df$Y>0.2) & (df$X<10),][2,]
>
> On Thu, Oct 14, 2021 at 10:52 AM Luigi Marongiu  
> wrote:
>>
>> Hello,
>> I have selected a subset of a dataframe with the vector syntax (if
>> this is the name):
>> ```
>> > df[(df$Y>0.2) & (df$X<10),]
>>  YX
>> 10 0.2200642 1.591589
>> 13 0.2941828 1.485951
>> ```
>> How can I select only the second row? I only managed to get the whole
>> of whole columns:
>> ```
>> > df[(df$Y>0.2) & (df$X<10),2]
>> [1] 1.591589 1.485951
>> > df[(df$Y>0.2) & (df$X<10),][2]
>>  X
>> 10 1.591589
>> 13 1.485951
>> > df[(df$Y>0.2) & (df$X<10),][1]
>>  Y
>> 10 0.2200642
>> 13 0.2941828
>> ```
>> Thank you
>>
>> __
>> 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.



-- 
Best regards,
Luigi

__
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] How to select given row of conditionally subsetted dataframe?

2021-10-14 Thread Eric Berger
df[(df$Y>0.2) & (df$X<10),][2,]

On Thu, Oct 14, 2021 at 10:52 AM Luigi Marongiu 
wrote:

> Hello,
> I have selected a subset of a dataframe with the vector syntax (if
> this is the name):
> ```
> > df[(df$Y>0.2) & (df$X<10),]
>  YX
> 10 0.2200642 1.591589
> 13 0.2941828 1.485951
> ```
> How can I select only the second row? I only managed to get the whole
> of whole columns:
> ```
> > df[(df$Y>0.2) & (df$X<10),2]
> [1] 1.591589 1.485951
> > df[(df$Y>0.2) & (df$X<10),][2]
>  X
> 10 1.591589
> 13 1.485951
> > df[(df$Y>0.2) & (df$X<10),][1]
>  Y
> 10 0.2200642
> 13 0.2941828
> ```
> Thank you
>
> __
> 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] How to select given row of conditionally subsetted dataframe?

2021-10-14 Thread Andrew Simmons
You're missing a comma, this should fix it

df[(df$Y>0.2) & (df$X<10),][2, ]

On Thu, Oct 14, 2021, 03:51 Luigi Marongiu  wrote:

> Hello,
> I have selected a subset of a dataframe with the vector syntax (if
> this is the name):
> ```
> > df[(df$Y>0.2) & (df$X<10),]
>  YX
> 10 0.2200642 1.591589
> 13 0.2941828 1.485951
> ```
> How can I select only the second row? I only managed to get the whole
> of whole columns:
> ```
> > df[(df$Y>0.2) & (df$X<10),2]
> [1] 1.591589 1.485951
> > df[(df$Y>0.2) & (df$X<10),][2]
>  X
> 10 1.591589
> 13 1.485951
> > df[(df$Y>0.2) & (df$X<10),][1]
>  Y
> 10 0.2200642
> 13 0.2941828
> ```
> Thank you
>
> __
> 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.


[R] How to select given row of conditionally subsetted dataframe?

2021-10-14 Thread Luigi Marongiu
Hello,
I have selected a subset of a dataframe with the vector syntax (if
this is the name):
```
> df[(df$Y>0.2) & (df$X<10),]
 YX
10 0.2200642 1.591589
13 0.2941828 1.485951
```
How can I select only the second row? I only managed to get the whole
of whole columns:
```
> df[(df$Y>0.2) & (df$X<10),2]
[1] 1.591589 1.485951
> df[(df$Y>0.2) & (df$X<10),][2]
 X
10 1.591589
13 1.485951
> df[(df$Y>0.2) & (df$X<10),][1]
 Y
10 0.2200642
13 0.2941828
```
Thank you

__
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] How to find local minimum between distributions using mixtools?

2021-10-14 Thread Richard O'Keefe
Do you really want the minimum?
It sounds as though your model is a*N(x1,s1) + (1-a)*N(x2,s2) where
you use mixtools to estimate
the parameters.  Finding the derivative of that is fairly
straightforward calculus, and solving for the
derivative being zero gives you extrema (you want the one between x1 and x2).

In practice I might start with a quick and dirty hack like
x <- seq(from min(x1,x2), to=max(x1,x2), length=399)
p <- a*dnorm(x, x1, s1) + (1-a)*dnorm(x, x2, s2)
m <- min(p)
x[x == m]

On Wed, 13 Oct 2021 at 22:12, Luigi Marongiu  wrote:
>
> Hello,
> I have two peaks distributions (and some noise values in between), and
> I used mixtools to characterize the two overlapping data. How can I
> find the minimum between the peak distributions?
> The sigma value of the second population is close to that value, but I
> am not sure if this is really the cut-off point between the two
> distributions (by eye, I would say the value is 0.125 against 0.1 of
> the sigma value). Is there a better approach?
> Thanks
>
> ```
> set.seed(10)
> negative_mr <- runif(50, 0, 0.099)
> negative_fcn <- runif(50, 1, 40)
> positive_mr <- c(runif(30, 0.2, 0.5), runif(20, 0.4, 0.5))
> positive_fcn <- c(runif(30, 25, 40), runif(20, 10, 25))
> uncertain_mr <- runif(10, 0.099, 0.2)
> uncertain_fcn <- runif(10, 2, 40)
> df <- data.frame(Y=c(negative_mr, uncertain_mr, positive_mr),
> X=c(negative_fcn, uncertain_fcn, positive_fcn),
> GROUP=c(rep("negative", length(negative_mr)),
> rep("uncertain", length(uncertain_mr)),
> rep("positive", length(positive_mr
> library(mixtools)
> model = normalmixEM((x = df$Y))
> summary(model)
> # plot
> plot(model, which=2)
> Cut_off <- model$sigma[2]
> Cut_offE <- 0.125
> abline(v=Cut_off, col="blue", lwd=2)
> abline(v=Cut_offE, col="blue", lwd=2, lty=2)
> plot(df$Y[df$GROUP=="negative"]~df$X[df$GROUP=="negative"],
> pch=1, ylim=c(0,0.5), xlim=c(0,41), cex=1.5,
> xlab=expression(bold("X")),
> ylab=expression(bold("Y")))
> points(df$Y[df$GROUP=="positive"]~df$X[df$GROUP=="positive"],
> pch=16, cex=1.5)
> points(df$Y[df$GROUP=="uncertain"]~df$X[df$GROUP=="uncertain"],
> pch=16, cex=1.5, col="grey")
> abline(h=Cut_off, col="blue", lwd=2)
> abline(h=Cut_offE, col="blue", lwd=2, lty=2)
> ```
>
>
> --
> Best regards,
> Luigi
>
> __
> 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.