Re: [ESS] Advice on setting up ESS to edit and knit Rmarkdown files

2021-09-22 Thread Joshua Wiley via ESS-help
Are the bugs something that could be helped if there was small funding for
a student internship?
If potentially useful, any of the ESS developers can contact me directly.

On Thu, Sep 23, 2021 at 3:53 AM Martin Maechler via ESS-help <
ess-help@r-project.org> wrote:

> > Lionel Henry via ESS-help
> > on Wed, 22 Sep 2021 15:15:42 +0200 writes:
>
> > We'd love to do a release but ESS is not in a good place
> > right now.
>
> Definitely.  The reason is that there have been too many bugs
> introduced with the new features, so we could/should not
> release.
>
> This has been the real reason for not releasing formally.
>
> In addition, another important goal for the release has been to
> create an ESS+ "package" (not mainly an ELPA package, but also a
> traditional  tarball / zip file) which will contain
> ESS plus relevant parts of polymode even though the latter is
> only maintained by one of us; the use of both *and* correct
> interplay between polymode and ESS is really crucial for parts
> modern R using ESS, notably as we had decided to declare the ess
> noweb-mode (for editing *.Rnw, i.e., Sweave & (tex-based) knitr)
> as obsolete.
>
> > Recent versions of Emacs interrupt background
> > commands (essential to completion and contextual help like
> > eldoc) when the user starts typing, which causes hard to
> > solve problems.
>
> > The dev branch is mostly working but not 100%
> > correctly. Unfortunately none of us seem to have the time
> > to work on ESS at the moment.
>
> > That said, while Martin, Vitalie and I notice issues here
> > and there, we haven't had serious bug reports in a while,
> > despite the dev branch being used by many Melpa users. So
> > maybe releasing in the current state is better than  nothing.
>
> Well...
> It would be the first ESS release with serious (for some / in
> some use case situaitons) known bugs ..
>
> > Best, Lionel
>
>
> > On 9/22/21, Dirk Eddelbuettel via ESS-help
> >  wrote:
> >>
> >> On 20 September 2021 at 13:59, Sparapani, Rodney via
> >> ESS-help wrote: | Generally, this stuff should just work
> >> out-of-the-box.
> >>
> >> Understood.
> >>
> >> | And we are not a company like RStudio so this FOSS
> >> setup works for us as | developers and hopefully it still
> >> serves the users well.
> >>
> >> But legal structure has nothing to with 'calling a
> >> release'. Which is done by authors (who should know the
> >> code better than users) saying "yep what we have at HEAD
> >> right now is good" and then cut a tarball.  That is a
> >> _marker_.  Which some less-informed people like me can
> >> take (and then ship downstream to Debian, and with that
> >> Ubuntu etc).
> >>
> >> Without a marker, no shipment. Less ideal to me and
> >> others.
> >>
> >> So pretty-please if someone would: could a release one of
> >> these moons. It does not have to be frequent or regularly
> >> schedule or anything.  But maybe more often than once
> >> every few years?  Maybe when you sync with upstream Emacs
> >> (assuming you do now)?
> >>
> >> Dirk
> >>
> >> --
> >> https://dirk.eddelbuettel.com | @eddelbuettel |
> >> e...@debian.org
> >>
> >> __
> >> ESS-help@r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/ess-help
> >>
>
> > __
> > ESS-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/ess-help
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>

[[alternative HTML version deleted]]

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R] Trying to Learn Details of Grid Graphics, Help Page Errors

2021-09-22 Thread Paul Murrell

Hi

The first place you should probably start (given where you are right 
now) is this R Journal article ...


https://journal.r-project.org/archive/2013/RJ-2013-035/RJ-2013-035.pdf

In brief, the drawDetails() function has been (almost entirely) 
superceded by the makeContent() function.


The best overall reference is probably the "R Graphics" book (3rd 
edition, chapts 6, 7, & 8).  Unfortunately, because the first edition 
came out in 2005, that is an Olde Worlde pay-for-a-print-version book 
(and probably will be until something stupid like 50 years after I have 
gone).  Or maybe you are lucky and work for a first-world university 
that has purchased access to an electronic version.


Thanks for pointing out the problems with the drawDetails() help page; I 
will need to fix that.


Paul

On 9/23/2021 2:21 AM, b...@denney.ws wrote:

Hello,



I'm trying to learn the details of grid graphics. Specifically, I'm trying
to create a check that will give a warning or error if text goes outside of
the visible plot area. (See
https://github.com/tidyverse/ggplot2/issues/3282 
 
for an example of what I

mean.)



In my digging, I think that the right way to do this will be to add either a
drawDetails, preDrawDetails, or postDrawDetails method for the "text" class.
My questions are: Is that the right way to do it or should I be looking
elsewhere? Or, is there already a way to do this?



As I was digging in and trying to learn how to do it, I tried to follow some
of the examples from the help page for drawDetails (?drawDetails). But, the
suggested functions to review do not exist. Specifically, I wanted to look
at grid:::preDrawDetails.frame mentioned in the second paragraph of the
Details section of the help page, and it doesn't exist.
grid:::drawDetails.xaxis and grid:::postDrawDetails.frame also do not exist
(mentioned in the next two paragraphs).



I would try to make patch, but there is no preDrawDetails or postDrawDetails
method in grid that has any content. For drawDetails, there are many
choices, and since I'm learning, I'm not sure which would be the best to use
as an example.



Thanks,



Bill


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


--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
p...@stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/

__
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] POTENTIAL PHISHING E-MAIL: Codes of Fourier Transformation

2021-09-22 Thread Stephen Ellison
> I wanted to know the codes of Fourier Transformation of time series
> data.
The location of complete source code for all versions of R is given at 
https://cran.r-project.org/sources.html

fft is in the stats package and is implemented as a call to C code, so you'll 
need to look in the C source code after unpacking the tar.gz archive; you can 
find the called function name by typing 'fft' at the R command line.

For code specific to time series you'll have to identify the R package you're 
using and find the source code repository for that. R is open source so the 
code for packages should be publicly available.



***
This email and any attachments are confidential. Any use...{{dropped:8}}

__
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] Improve my plot

2021-09-22 Thread varin sacha via R-help
Hi,

Many thanks to all of you for your precious help.

Best,



Le mardi 21 septembre 2021, 00:12:02 UTC+2, Jim Lemon  a 
écrit : 





Hi varin,
Not too difficult:

par(mar=c(5,13,4,1))
barplot(height=c(574,557,544,535,534,532,531,527,526,525,524,520,518,
512,507,504,504,489,488,488,487,484,484,474,472,455,444,420),
names.arg=c("Fribourg(f)","Valais(d)",
"Appenzell Rhodes Intérieures","Fribourg(d)","Jura","Schwyz",
"Schaffhouse","Berne(f)","Thurgovie","Valais(f)","Argovie",
"Appenzell Rhodes Extérieures","Genève","Zoug","Tessin",
"Neuchâtel","Vaud","Uri","Nidwald","Berne(d)","Zurich","Obwald",
"Saint-Gall","Soleure","Lucerne","Glaris","Bâle-Campagne","Bâle-Ville"),
horiz=TRUE,col="deepskyblue2",las=2,xlim=c(0,650),font.axis=4)

With regard to Bert's objection to barplots, you can do the same thing there.

Jim

On Tue, Sep 21, 2021 at 5:24 AM varin sacha via R-help
 wrote:
>
> Dear R-experts,
>
> Here below my R code. I would need your help to improve my graph/plot.
>
> - The x-axis to be longer not to stop at 500 value
> - All the name on the y-axis to appear not only a few of them and the name 
> (Fribourg(f), Appenzell Rhodes Intérieures,...) to appear entire, not to be 
> cut
>
> Many thanks.
>
> ##
> barplot(height=c(574,557,544,535,534,532,531,527,526,525,524,520,518,512,507,504,504,489,488,488,487,484,484,474,472,455,444,420),names.arg=c("Fribourg(f)","Valais(d)","Appenzell
>  Rhodes 
> Intérieures","Fribourg(d)","Jura","Schwyz","Schaffhouse","Berne(f)","Thurgovie","Valais(f)","Argovie","Appenzell
>  Rhodes 
> Extérieures","Genève","Zoug","Tessin","Neuchâtel","Vaud","Uri","Nidwald","Berne(d)","Zurich","Obwald","Saint-Gall","Soleure","Lucerne","Glaris","Bâle-Campagne","Bâle-Ville"),font.axis=4,
>  horiz=T,col="deepskyblue2",las=2)

> ##
>
>
>
>
> __
> 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: [ESS] Advice on setting up ESS to edit and knit Rmarkdown files

2021-09-22 Thread Martin Maechler via ESS-help
> Lionel Henry via ESS-help 
> on Wed, 22 Sep 2021 15:15:42 +0200 writes:

> We'd love to do a release but ESS is not in a good place
> right now.  

Definitely.  The reason is that there have been too many bugs
introduced with the new features, so we could/should not
release.

This has been the real reason for not releasing formally.

In addition, another important goal for the release has been to
create an ESS+ "package" (not mainly an ELPA package, but also a
traditional  tarball / zip file) which will contain
ESS plus relevant parts of polymode even though the latter is
only maintained by one of us; the use of both *and* correct
interplay between polymode and ESS is really crucial for parts
modern R using ESS, notably as we had decided to declare the ess
noweb-mode (for editing *.Rnw, i.e., Sweave & (tex-based) knitr)
as obsolete. 

> Recent versions of Emacs interrupt background
> commands (essential to completion and contextual help like
> eldoc) when the user starts typing, which causes hard to
> solve problems.

> The dev branch is mostly working but not 100%
> correctly. Unfortunately none of us seem to have the time
> to work on ESS at the moment.

> That said, while Martin, Vitalie and I notice issues here
> and there, we haven't had serious bug reports in a while,
> despite the dev branch being used by many Melpa users. So
> maybe releasing in the current state is better than  nothing.

Well...
It would be the first ESS release with serious (for some / in
some use case situaitons) known bugs ..

> Best, Lionel


> On 9/22/21, Dirk Eddelbuettel via ESS-help
>  wrote:
>> 
>> On 20 September 2021 at 13:59, Sparapani, Rodney via
>> ESS-help wrote: | Generally, this stuff should just work
>> out-of-the-box.
>> 
>> Understood.
>> 
>> | And we are not a company like RStudio so this FOSS
>> setup works for us as | developers and hopefully it still
>> serves the users well.
>> 
>> But legal structure has nothing to with 'calling a
>> release'. Which is done by authors (who should know the
>> code better than users) saying "yep what we have at HEAD
>> right now is good" and then cut a tarball.  That is a
>> _marker_.  Which some less-informed people like me can
>> take (and then ship downstream to Debian, and with that
>> Ubuntu etc).
>> 
>> Without a marker, no shipment. Less ideal to me and
>> others.
>> 
>> So pretty-please if someone would: could a release one of
>> these moons. It does not have to be frequent or regularly
>> schedule or anything.  But maybe more often than once
>> every few years?  Maybe when you sync with upstream Emacs
>> (assuming you do now)?
>> 
>> Dirk
>> 
>> --
>> https://dirk.eddelbuettel.com | @eddelbuettel |
>> e...@debian.org
>> 
>> __
>> ESS-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/ess-help
>> 

> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R-es] problema de tiempo de ejecución con una rutina dentro de un programa de R

2021-09-22 Thread Carlos Santos
Perdón he puesto 2000 columnas pero quería decir 2000 filas

El mié., 22 sept. 2021 18:34, Carlos Santos 
escribió:

> ok Carlos, pongo un ejemplo con pocos registros a ver si puedo explicarlo
> mejor:
>
> Datos:
> V0 V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
> 1 63 1 1 145 A 233 1 2 3 0
> 2 67 1 4 160 A 286 0 2 2 3
> 3 67 2 4 120 B 229 0 2 2 2
> 4 37 1 3 130 C 250 0 0 3 0
> 5 41 1 2 130 C 204 0 2 1 0
> 6 56 2 2 120 A 236 0 0 1 0
> 7 62 1 4 140 B 268 0 2 3 2
> 8 57 2 4 120 C 354 0 0 1 0
> 9 63 2 4 130 A 254 0 2 2 1
> 10 53 1 4 140 B 203 1 2 3 0
> 11 57 2 4 140 B 192 0 0 2 0
> 12 56 1 2 140 A 294 0 2 2 0
> 13 56 2 3 130 C 256 1 2 2 1
> 14 44 2 2 120 B 263 0 0 1 0
> 15 52 2 3 172 B 199 1 0 1 0
>
> tengo la matriz que sale de V5:
> A
> B
> C
>
> junto las filas de A con B, y obtengo el punto respecto de V2, y me da
> (0.33, 0.67), puesto que V2 tiene dos valores, es un porcentaje en
> definitiva
> junto las filas de A con C, y se obtiene el punto (0.5, 0.5)
> obtengo la distancia euclidea de dichos puntos sobre el punto definido,
> supongamos (0.34, 066),  lo que significa que la menor distancia se obtiene
> entre A y B, por lo tanto las filas que tienen A en V5 se cambia su valor a
> C, y se obtiene la siguiente matriz, donde V5 ya no tiene la A
> V0 V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
> 1 63 1 1 145 C 233 1 2 3 0
> 2 67 1 4 160 C 286 0 2 2 3
> 3 67 2 4 120 B 229 0 2 2 2
> 4 37 1 3 130 C 250 0 0 3 0
> 5 41 1 2 130 C 204 0 2 1 0
> 6 56 2 2 120 C 236 0 0 1 0
> 7 62 1 4 140 B 268 0 2 3 2
> 8 57 2 4 120 C 354 0 0 1 0
> 9 63 2 4 130 C 254 0 2 2 1
> 10 53 1 4 140 B 203 1 2 3 0
> 11 57 2 4 140 B 192 0 0 2 0
> 12 56 1 2 140 C 294 0 2 2 0
> 13 56 2 3 130
>

[[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-es] problema de tiempo de ejecución con una rutina dentro de un programa de R

2021-09-22 Thread Carlos Santos
ok Carlos, pongo un ejemplo con pocos registros a ver si puedo explicarlo
mejor:

Datos:
V0 V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
1 63 1 1 145 A 233 1 2 3 0
2 67 1 4 160 A 286 0 2 2 3
3 67 2 4 120 B 229 0 2 2 2
4 37 1 3 130 C 250 0 0 3 0
5 41 1 2 130 C 204 0 2 1 0
6 56 2 2 120 A 236 0 0 1 0
7 62 1 4 140 B 268 0 2 3 2
8 57 2 4 120 C 354 0 0 1 0
9 63 2 4 130 A 254 0 2 2 1
10 53 1 4 140 B 203 1 2 3 0
11 57 2 4 140 B 192 0 0 2 0
12 56 1 2 140 A 294 0 2 2 0
13 56 2 3 130 C 256 1 2 2 1
14 44 2 2 120 B 263 0 0 1 0
15 52 2 3 172 B 199 1 0 1 0

tengo la matriz que sale de V5:
A
B
C

junto las filas de A con B, y obtengo el punto respecto de V2, y me da
(0.33, 0.67), puesto que V2 tiene dos valores, es un porcentaje en
definitiva
junto las filas de A con C, y se obtiene el punto (0.5, 0.5)
obtengo la distancia euclidea de dichos puntos sobre el punto definido,
supongamos (0.34, 066),  lo que significa que la menor distancia se obtiene
entre A y B, por lo tanto las filas que tienen A en V5 se cambia su valor a
C, y se obtiene la siguiente matriz, donde V5 ya no tiene la A
V0 V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
1 63 1 1 145 C 233 1 2 3 0
2 67 1 4 160 C 286 0 2 2 3
3 67 2 4 120 B 229 0 2 2 2
4 37 1 3 130 C 250 0 0 3 0
5 41 1 2 130 C 204 0 2 1 0
6 56 2 2 120 C 236 0 0 1 0
7 62 1 4 140 B 268 0 2 3 2
8 57 2 4 120 C 354 0 0 1 0
9 63 2 4 130 C 254 0 2 2 1
10 53 1 4 140 B 203 1 2 3 0
11 57 2 4 140 B 192 0 0 2 0
12 56 1 2 140 C 294 0 2 2 0
13 56 2 3 130 C 256 1 2 2 1
14 44 2 2 120 B 263 0 0 1 0
15 52 2 3 172 B 199 1 0 1 0
en este ejemplo el while seria 2, es decir que se pararía puesto que solo
tengo dos valore en V5

Evidentemente cuando tengo 100.000 filas con 100 columnas y tengo la matriz
intermedia que he puesto en este ejemplo con letras de 2000 columnas,
puesto no veo como consumir menos tiempo de ejecucion.

espero que lo haya podido explicar mejor con este ejemplo.

gracias de antemano Carlos

El mié, 22 sept 2021 a las 17:48, Carlos Ortega ()
escribió:

> Vaya me cuesta verlo... :-)...
>
> ¿Puedes poner un ejemplo con números con los diferentes vectores con los
> que partes y cómo vas rellenando esa matriz?
> Y cómo quedaría al final..
>
> Gracias!
> Carlos.
>
> El mié, 22 sept 2021 a las 16:01, Carlos Santos (<
> carlossantos@gmail.com>) escribió:
>
>> jajajaja, perdón no te había entendido, lo siento
>>
>> a ver, de esta forma y para que sea fácil, supongamos esta matriz,
>> evidentemente el problema lo tengo cuando esta matriz es muy grande claro.
>> G1
>> G2
>> G3
>> G4
>> G5
>> G6
>> G7
>> G8
>> G9
>> G10
>> El while lo puse porque quite el for que tenia al principio para no poner
>> muchos FOR anidados, por lo tanto el while va a ejecutar el FOR siguiente 7
>> veces
>>
>> El FOR lo que hace es ejecutarse 9 veces la primera vez, y agrupa los
>> registros de G1 con cada uno de los otros grupos individualmente, calcula
>> el porcentaje de elementos de cada nuevo grupo respecto a una de las
>> variables del registro, por ejemplo supongamos que la variable tiene 2
>> valores, obtenemos un punto (X,Y) que representa el porcentaje de cada
>> valor que tiene la variable dentro de su nuevo grupo
>> Lo mismo para el resto de nuevos grupos, y se calcula la distancia
>> euclidea entre cada nuevo punto respecto de un punto predefinido.
>>
>> a continuación se haría tomando G2 con el resto descendente, y así
>> sucesivamente hasta que el while ejecute en este ejemplo 7 veces = 10-3
>>
>> Quizas asi este mas claro, Carlos
>>
>>
>>
>>
>>
>> El mié, 22 sept 2021 a las 15:43, Carlos Ortega (<
>> c...@qualityexcellence.es>) escribió:
>>
>>> Hola Carlos,
>>>
>>> Sí, si lo he entendido así.
>>>
>>> Lo que te propongo es que nos cuentes qué quieres hacer con esos dos
>>> bucles o un bucle y un while. Porque a lo mejor se puede plantear otra
>>> aproximación para actualizar cada elemento de la matriz.
>>>
>>> Gracias,
>>> Carlos.
>>>
>>> El mié, 22 sept 2021 a las 15:31, Carlos Santos (<
>>> carlossantos@gmail.com>) escribió:
>>>
 Gracias Carlos,

 Si, quizas no lo explique bien, lo fundamental y es donde se tarda
 mucho tiempod e cpu, es el bucle FOR, que tiene que recorrer una matriz
 desde 1 hasta totcluy, entendiendo que la variable totclu puede ser por
 ejemplo 10.000, lo que quiere decir que por cada fila tiene que realizar el
 calculo que he puesto en el FOR que tampoco es demasiado pero logicamente
 tiene que recorrer por ejemplo en este caso 10.000 columnas
 A su vez el while tiene que hacerlo otras 1 veces menos 3, lo que
 significa que el tiempo empleado hasta completar cada fila de la matriz es
 enorme

 no se si he podido explicarlo mejor, es por eso que entiendo que el
 bucle FOR es muy costoso, y aunque he puesto un while bien podia ser un FOR
 dentro de otro FOR, en donde el primero controla las filas y el segundo las
 columnas, pero no se como hacer que el tiempo de cpu sea lo menor posible

 El mié, 22 sept 2021 a las 14:56, Carlos Ortega (<

[R] Codes of Fourier Transformation

2021-09-22 Thread Shweta Singh
Dear Sir/Madam
  I wanted to know the codes of Fourier Transformation of
time series data.

[[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] Trying to Learn Details of Grid Graphics, Help Page Errors

2021-09-22 Thread bill
Hello,

 

I'm trying to learn the details of grid graphics.  Specifically, I'm trying
to create a check that will give a warning or error if text goes outside of
the visible plot area.  (See
https://github.com/tidyverse/ggplot2/issues/3282 for an example of what I
mean.)

 

In my digging, I think that the right way to do this will be to add either a
drawDetails, preDrawDetails, or postDrawDetails method for the "text" class.
My questions are:  Is that the right way to do it or should I be looking
elsewhere?  Or, is there already a way to do this?

 

As I was digging in and trying to learn how to do it, I tried to follow some
of the examples from the help page for drawDetails (?drawDetails).  But, the
suggested functions to review do not exist.  Specifically, I wanted to look
at grid:::preDrawDetails.frame mentioned in the second paragraph of the
Details section of the help page, and it doesn't exist.
grid:::drawDetails.xaxis and grid:::postDrawDetails.frame also do not exist
(mentioned in the next two paragraphs).

 

I would try to make patch, but there is no preDrawDetails or postDrawDetails
method in grid that has any content.  For drawDetails, there are many
choices, and since I'm learning, I'm not sure which would be the best to use
as an example.

 

Thanks,

 

Bill


[[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] problema de tiempo de ejecución con una rutina dentro de un programa de R

2021-09-22 Thread Carlos Santos
jajajaja, perdón no te había entendido, lo siento

a ver, de esta forma y para que sea fácil, supongamos esta matriz,
evidentemente el problema lo tengo cuando esta matriz es muy grande claro.
G1
G2
G3
G4
G5
G6
G7
G8
G9
G10
El while lo puse porque quite el for que tenia al principio para no poner
muchos FOR anidados, por lo tanto el while va a ejecutar el FOR siguiente 7
veces

El FOR lo que hace es ejecutarse 9 veces la primera vez, y agrupa los
registros de G1 con cada uno de los otros grupos individualmente, calcula
el porcentaje de elementos de cada nuevo grupo respecto a una de las
variables del registro, por ejemplo supongamos que la variable tiene 2
valores, obtenemos un punto (X,Y) que representa el porcentaje de cada
valor que tiene la variable dentro de su nuevo grupo
Lo mismo para el resto de nuevos grupos, y se calcula la distancia euclidea
entre cada nuevo punto respecto de un punto predefinido.

a continuación se haría tomando G2 con el resto descendente, y así
sucesivamente hasta que el while ejecute en este ejemplo 7 veces = 10-3

Quizas asi este mas claro, Carlos





El mié, 22 sept 2021 a las 15:43, Carlos Ortega ()
escribió:

> Hola Carlos,
>
> Sí, si lo he entendido así.
>
> Lo que te propongo es que nos cuentes qué quieres hacer con esos dos
> bucles o un bucle y un while. Porque a lo mejor se puede plantear otra
> aproximación para actualizar cada elemento de la matriz.
>
> Gracias,
> Carlos.
>
> El mié, 22 sept 2021 a las 15:31, Carlos Santos (<
> carlossantos@gmail.com>) escribió:
>
>> Gracias Carlos,
>>
>> Si, quizas no lo explique bien, lo fundamental y es donde se tarda mucho
>> tiempod e cpu, es el bucle FOR, que tiene que recorrer una matriz desde 1
>> hasta totcluy, entendiendo que la variable totclu puede ser por ejemplo
>> 10.000, lo que quiere decir que por cada fila tiene que realizar el calculo
>> que he puesto en el FOR que tampoco es demasiado pero logicamente tiene que
>> recorrer por ejemplo en este caso 10.000 columnas
>> A su vez el while tiene que hacerlo otras 1 veces menos 3, lo que
>> significa que el tiempo empleado hasta completar cada fila de la matriz es
>> enorme
>>
>> no se si he podido explicarlo mejor, es por eso que entiendo que el bucle
>> FOR es muy costoso, y aunque he puesto un while bien podia ser un FOR
>> dentro de otro FOR, en donde el primero controla las filas y el segundo las
>> columnas, pero no se como hacer que el tiempo de cpu sea lo menor posible
>>
>> El mié, 22 sept 2021 a las 14:56, Carlos Ortega (<
>> c...@qualityexcellence.es>) escribió:
>>
>>> Hola,
>>>
>>> ¿Por qué no nos dices mejor el problema qué quieres resolver con tus
>>> datos/matriz/matrices inicial?
>>> Seguramente podamos ver una forma alternativa a utilizar un bucle...
>>>
>>> En cualquier caso, por si quieres ir viendo como correr ese bucle en
>>> paralelo..:
>>>
>>>-
>>>
>>> https://stackoverflow.com/questions/53054366/how-can-i-run-a-for-loop-in-parallel-in-r
>>>
>>> Saludos,
>>> Carlos Ortega
>>> www.qualityexcellence.es
>>>
>>> El mié, 22 sept 2021 a las 13:18, Carlos Santos (<
>>> carlossantos@gmail.com>) escribió:
>>>
 Hola a todos, familia de R

 Tengo un pequeño problema de tiempo de ejecución con una rutina, a ver
 si
 me pueden echar una mano y ayudarme si es posible, claro.

 La rutina es la siguiente:

 while(totclu != 3){
   matrizF <- matrix(0, nrow = 1, ncol = totclu)
   for (j in 1:totclu) {
 q1 <- c(which(data1$Clus.Multi.FAIRNESS == k2A$Var1[1]),
 which(data1$Clus.Multi.FAIRNESS == k2A$Var1[j]))
 q2 <- nrow(as.data.frame(c(which(data1$Clus.Multi.FAIRNESS ==
 k2A$Var1[1]),
which(data1$Clus.Multi.FAIRNESS ==
 k2A$Var1[j]
 observado <- table(data1$VarFC[q1])/q2
 matrizF[i] <- dist(rbind(observado,propuesto),method = "euclidean")
   }
   matrizF[1] <- 99
   min_observado <- which.min(matrizF)
   q4 <- which(data1$Clus.Multi.FAIRNESS == k2A$Var1[1])
   data1$Clus.Multi.FAIRNESS[q4] <-
 as.character(k2A$Var1[min_observado])
   k2A$Freq[min_observado] <- k2A$Freq[min_observado] + k2A$Freq[1]
   k2A <- as.data.frame(table(as.character(data1$Clus.Multi.FAIRNESS)))
 %>%
 arrange(Freq)
   totclu=nrow(k2A)
 }

 El problema fundamental es que la matriz que aparece como k2A es una
 matriz
 (nxn) lo que significa que puede ser muy grande, por ejemplo 1000x1000,
 y
 el tiempo que tarda es enorme y no veo como disminuir el tiempo de
 ejecución del "for" que pienso que es lo mas duro.

 No se si se puede poner como procesamiento en paralelo en r, pero
 tampoco
 ser como ponerlo

 Si me pueden echar una mano, les estaré muy agradecido

 muchas gracias de antemano

 Carlos Santos

 [[alternative HTML version deleted]]

 ___
 

Re: [ESS] Advice on setting up ESS to edit and knit Rmarkdown files

2021-09-22 Thread Dirk Eddelbuettel via ESS-help


On 22 September 2021 at 15:15, Lionel Henry wrote:
| We'd love to do a release but ESS is not in a good place right now.
| Recent versions of Emacs interrupt background commands (essential to
| completion and contextual help like eldoc) when the user starts
| typing, which causes hard to solve problems.

Yes :-/ I guess that was the state of affairs last time this came up.
 
| The dev branch is mostly working but not 100% correctly. Unfortunately
| none of us seem to have the time to work on ESS at the moment.
| 
| That said, while Martin, Vitalie and I notice issues here and there,
| we haven't had serious bug reports in a while, despite the dev branch
| being used by many Melpa users. So maybe releasing in the current
| state is better than nothing.

Noted. It's a trade-off. Nobody wants unhappy users from not-quite-baked code
but the staleness is also an issue. And I trust you all to make the right
call. It will, as always, sort itself out eventually.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R-es] problema de tiempo de ejecución con una rutina dentro de un programa de R

2021-09-22 Thread Carlos Santos
Gracias Carlos,

Si, quizas no lo explique bien, lo fundamental y es donde se tarda mucho
tiempod e cpu, es el bucle FOR, que tiene que recorrer una matriz desde 1
hasta totcluy, entendiendo que la variable totclu puede ser por ejemplo
10.000, lo que quiere decir que por cada fila tiene que realizar el calculo
que he puesto en el FOR que tampoco es demasiado pero logicamente tiene que
recorrer por ejemplo en este caso 10.000 columnas
A su vez el while tiene que hacerlo otras 1 veces menos 3, lo que
significa que el tiempo empleado hasta completar cada fila de la matriz es
enorme

no se si he podido explicarlo mejor, es por eso que entiendo que el bucle
FOR es muy costoso, y aunque he puesto un while bien podia ser un FOR
dentro de otro FOR, en donde el primero controla las filas y el segundo las
columnas, pero no se como hacer que el tiempo de cpu sea lo menor posible

El mié, 22 sept 2021 a las 14:56, Carlos Ortega ()
escribió:

> Hola,
>
> ¿Por qué no nos dices mejor el problema qué quieres resolver con tus
> datos/matriz/matrices inicial?
> Seguramente podamos ver una forma alternativa a utilizar un bucle...
>
> En cualquier caso, por si quieres ir viendo como correr ese bucle en
> paralelo..:
>
>-
>
> https://stackoverflow.com/questions/53054366/how-can-i-run-a-for-loop-in-parallel-in-r
>
> Saludos,
> Carlos Ortega
> www.qualityexcellence.es
>
> El mié, 22 sept 2021 a las 13:18, Carlos Santos (<
> carlossantos@gmail.com>) escribió:
>
>> Hola a todos, familia de R
>>
>> Tengo un pequeño problema de tiempo de ejecución con una rutina, a ver si
>> me pueden echar una mano y ayudarme si es posible, claro.
>>
>> La rutina es la siguiente:
>>
>> while(totclu != 3){
>>   matrizF <- matrix(0, nrow = 1, ncol = totclu)
>>   for (j in 1:totclu) {
>> q1 <- c(which(data1$Clus.Multi.FAIRNESS == k2A$Var1[1]),
>> which(data1$Clus.Multi.FAIRNESS == k2A$Var1[j]))
>> q2 <- nrow(as.data.frame(c(which(data1$Clus.Multi.FAIRNESS ==
>> k2A$Var1[1]),
>>which(data1$Clus.Multi.FAIRNESS ==
>> k2A$Var1[j]
>> observado <- table(data1$VarFC[q1])/q2
>> matrizF[i] <- dist(rbind(observado,propuesto),method = "euclidean")
>>   }
>>   matrizF[1] <- 99
>>   min_observado <- which.min(matrizF)
>>   q4 <- which(data1$Clus.Multi.FAIRNESS == k2A$Var1[1])
>>   data1$Clus.Multi.FAIRNESS[q4] <-  as.character(k2A$Var1[min_observado])
>>   k2A$Freq[min_observado] <- k2A$Freq[min_observado] + k2A$Freq[1]
>>   k2A <- as.data.frame(table(as.character(data1$Clus.Multi.FAIRNESS))) %>%
>> arrange(Freq)
>>   totclu=nrow(k2A)
>> }
>>
>> El problema fundamental es que la matriz que aparece como k2A es una
>> matriz
>> (nxn) lo que significa que puede ser muy grande, por ejemplo 1000x1000, y
>> el tiempo que tarda es enorme y no veo como disminuir el tiempo de
>> ejecución del "for" que pienso que es lo mas duro.
>>
>> No se si se puede poner como procesamiento en paralelo en r, pero tampoco
>> ser como ponerlo
>>
>> Si me pueden echar una mano, les estaré muy agradecido
>>
>> muchas gracias de antemano
>>
>> Carlos Santos
>>
>> [[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


Re: [ESS] Advice on setting up ESS to edit and knit Rmarkdown files

2021-09-22 Thread Lionel Henry via ESS-help
We'd love to do a release but ESS is not in a good place right now.
Recent versions of Emacs interrupt background commands (essential to
completion and contextual help like eldoc) when the user starts
typing, which causes hard to solve problems.

The dev branch is mostly working but not 100% correctly. Unfortunately
none of us seem to have the time to work on ESS at the moment.

That said, while Martin, Vitalie and I notice issues here and there,
we haven't had serious bug reports in a while, despite the dev branch
being used by many Melpa users. So maybe releasing in the current
state is better than nothing.

Best,
Lionel


On 9/22/21, Dirk Eddelbuettel via ESS-help  wrote:
>
> On 20 September 2021 at 13:59, Sparapani, Rodney via ESS-help wrote:
> | Generally, this stuff should just work out-of-the-box.
>
> Understood.
>
> | And we are not a company like RStudio so this FOSS setup works for us as
> | developers and hopefully it still serves the users well.
>
> But legal structure has nothing to with 'calling a release'. Which is done
> by
> authors (who should know the code better than users) saying "yep what we
> have
> at HEAD right now is good" and then cut a tarball.  That is a _marker_.
> Which some less-informed people like me can take (and then ship downstream
> to
> Debian, and with that Ubuntu etc).
>
> Without a marker, no shipment. Less ideal to me and others.
>
> So pretty-please if someone would: could a release one of these moons. It
> does not have to be frequent or regularly schedule or anything.  But maybe
> more often than once every few years?  Maybe when you sync with upstream
> Emacs (assuming you do now)?
>
> Dirk
>
> --
> https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Advice on setting up ESS to edit and knit Rmarkdown files

2021-09-22 Thread Dirk Eddelbuettel via ESS-help


On 20 September 2021 at 13:59, Sparapani, Rodney via ESS-help wrote:
| Generally, this stuff should just work out-of-the-box.

Understood.

| And we are not a company like RStudio so this FOSS setup works for us as
| developers and hopefully it still serves the users well.

But legal structure has nothing to with 'calling a release'. Which is done by
authors (who should know the code better than users) saying "yep what we have
at HEAD right now is good" and then cut a tarball.  That is a _marker_.
Which some less-informed people like me can take (and then ship downstream to
Debian, and with that Ubuntu etc).

Without a marker, no shipment. Less ideal to me and others.

So pretty-please if someone would: could a release one of these moons. It
does not have to be frequent or regularly schedule or anything.  But maybe
more often than once every few years?  Maybe when you sync with upstream
Emacs (assuming you do now)?

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[R-es] problema de tiempo de ejecución con una rutina dentro de un programa de R

2021-09-22 Thread Carlos Santos
Hola a todos, familia de R

Tengo un pequeño problema de tiempo de ejecución con una rutina, a ver si
me pueden echar una mano y ayudarme si es posible, claro.

La rutina es la siguiente:

while(totclu != 3){
  matrizF <- matrix(0, nrow = 1, ncol = totclu)
  for (j in 1:totclu) {
q1 <- c(which(data1$Clus.Multi.FAIRNESS == k2A$Var1[1]),
which(data1$Clus.Multi.FAIRNESS == k2A$Var1[j]))
q2 <- nrow(as.data.frame(c(which(data1$Clus.Multi.FAIRNESS ==
k2A$Var1[1]),
   which(data1$Clus.Multi.FAIRNESS ==
k2A$Var1[j]
observado <- table(data1$VarFC[q1])/q2
matrizF[i] <- dist(rbind(observado,propuesto),method = "euclidean")
  }
  matrizF[1] <- 99
  min_observado <- which.min(matrizF)
  q4 <- which(data1$Clus.Multi.FAIRNESS == k2A$Var1[1])
  data1$Clus.Multi.FAIRNESS[q4] <-  as.character(k2A$Var1[min_observado])
  k2A$Freq[min_observado] <- k2A$Freq[min_observado] + k2A$Freq[1]
  k2A <- as.data.frame(table(as.character(data1$Clus.Multi.FAIRNESS))) %>%
arrange(Freq)
  totclu=nrow(k2A)
}

El problema fundamental es que la matriz que aparece como k2A es una matriz
(nxn) lo que significa que puede ser muy grande, por ejemplo 1000x1000, y
el tiempo que tarda es enorme y no veo como disminuir el tiempo de
ejecución del "for" que pienso que es lo mas duro.

No se si se puede poner como procesamiento en paralelo en r, pero tampoco
ser como ponerlo

Si me pueden echar una mano, les estaré muy agradecido

muchas gracias de antemano

Carlos Santos

[[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: [ESS] Advice on setting up ESS to edit and knit Rmarkdown files

2021-09-22 Thread Greg Minshall via ESS-help
hi, Rodney,

thanks for this message, which i found very informative.

i wonder about a few things.

i'm installing ESS via straight.el.  the recipe is
> (ess :type git :flavor melpa :files ("*.el" "lisp/*.el" "doc/ess.texi"
> ("etc" "etc/*") ("obsolete" "lisp/obsolete/*") (:exclude "etc/other")
> "ess-pkg.el") :host github :repo "emacs-ess/ESS")

the info pages say:

> 1.2 New features in ESS
> ===
>
> Changes and New Features in 19.04 (unreleased):

given your message, should this maybe be changed to list "what has
changed recently"?  or a log of changes?  or, some such?

also, =ess-version= reports
> ess-version: 18.10.3snapshot [] (loaded from
> /home/minshall/.emacs.d/straight/build/ess/)

and, i always wonder to what extent i'm running more 18.10.3, to what
extent i'm running "19.04-delta".  i'm not sure what one might do if one
is basically following the tip of the git repo (especially via something
like straight.el?).  but, something might be nice?

thanks much for the package.  it's a great help.

cheers, Greg

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R] Windows: start script but keep being in R-shell after finish

2021-09-22 Thread Martin Maechler
> Duncan Murdoch 
> on Tue, 21 Sep 2021 09:09:40 -0400 writes:

> On 21/09/2021 3:12 a.m., c.bu...@posteo.jp wrote:
>> Hello together,
>> 
>> I was using R some years ago and I am sorry for asking such a dumb
>> question. I found some help instructions about commandline interface but
>> I still miss the piece of information I need. I assume it depends on my
>> non-nativ English that I am not able to ask the correct (worded)
>> question to the search engines.
>> 
>> I use R-for-windows on the shell. No GUI, IDE or anything else.
>> When I am in windows shell ("command prompt"?) I wan't to run an
>> R-script (filename *.R). But when the script is finished or interrupted
>> the R-prompt should do not close.
>> 
>> In python I would do
>> 
>> python3 -i -m myscript

> I don't think R supports this, but the following almost works:

> cat myscript.R - | Rterm --ess

Inside R, we use

  source("mycript.R")

where source() has several optional arguments in addition,
such as 'echo=TRUE' 

Probably Duncan did not mention it here, because indeed, it's
not quite equivalent to running the above semi-"batch mode"...

Martin


> This copies your file followed by stdin into the stdin of R.  The --ess 
> option tells R to act as if input is interactive, despite what it sees.

> This comes kind of close, but there are a couple of problems.

> - If I type really fast, the characters appear in the wrong order in R.
> - At the end when I quit, it sits there for a while until I hit enter, 
> then gives the error message "cat: write error: no more space on device".

> Perhaps these problems can be fixed.

> Another approach would be to set an environment variable specifying that 
> myscript.R is a user profile file, set via environment variable

> R_PROFILE_USER=myscript.R

> This has the disadvantage of overriding a pre-existing user profile 
> file, but if this is just for you, I guess you know if you have one.

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