Re: [R-es] líneas sobre un mapa

2020-06-06 Thread Carlos Ortega
Hola,
¿Por qué no incluyes directamente la línea vertical en cada iteración?.

world<-map_data('world')
pyt<-  ggplot(data, aes(x = longitud, y = latitud, color =
ptyrup,size=ptyrup)) +
  geom_point()+
 *geom_vline(xintercept = i)*
  scale_color_manual(values = c('lightslateblue','black')) +
  scale_size_manual(values=c(1,2))+
  theme(legend.position="top")
windows();pyt

Si luego vuelves a llamar a "pyt" efectivamente vuelve a reproducir todo el
mapa.

Gracias,
Carlos Ortega
www.qualityexcellence.es

El sáb., 6 jun. 2020 a las 20:41, Manuel Mendoza (<
mmend...@fulbrightmail.org>) escribió:

> Gracias Emilio, no sé cómo ponerte un ejemplo reproducible. El mapa es un
> ggplot como el que te pongo abajo, y el análisis que se hace en cada vuelta
> del loop (que tienes abajo, del anterior email) es un árbol de
> clasificación que se entrena con una parte del mapa, dada por la longitud
> (lon), y se testa con la otra. Los resultados se almacenan en Preds. Como
> puedes ver, la i del loop/for determina lon, una de las variables de la
> base de datos del mapa, y a cada iteración del loop (valor de lon) me
> indica por qué valor va (print(i)). En vez de eso, o además de, me gustaría
> que me representase un linea sobre el mapa que se hizo previamente con
> ggplot, que se corresponda con el valor de lon.
> Este es el mapa (sigo abajo):
>
> world<-map_data('world')
> pyt<-  ggplot(data, aes(x = longitud, y = latitud, color =
> ptyrup,size=ptyrup)) +
>   geom_point()+
>   scale_color_manual(values = c('lightslateblue','black')) +
>   scale_size_manual(values=c(1,2))+
>   theme(legend.position="top")
> windows();pyt
>
> Si en el loop incluyo esto:
>   pyt<-pyt+geom_vline(xintercept = i)
>   print(pyt)
>
> a cada iteración me representa en el mapa la línea que yo quiero, pero lo
> hace representando el mapa de nuevo cada vez. La idea es que me añada la
> línea, cada vez, pero sin tener que representar el mapa, es decir, sobre el
> que ya estaba. Es por el efecto visual. Parece una tontería, pero frente a
> una audiencia esos detalles importan (hasta cierto punto).
>
> Gracias,
> Manuel
>
>
>
>
>
>
>
>
>
>
>
>
> El sáb., 6 jun. 2020 a las 12:01, Emilio L. Cano ( >)
> escribió:
>
> > Hola,
> >
> > Como ggplot son gráficos tipo “grid” seguramente puedas añadir las líneas
> > como un objeto “grob” sin tener que recargar el mapa.
> >
> > Con un ejemplo reproducible lo podría confirmar.
> >
> > Un saludo,
> >
> > Emilio L. Cano
> > http://emilio.lcano.com
> >
> >
> >
> > El 5 jun 2020, a las 17:48, Manuel Mendoza 
> > escribió:
> >
> > Gracias Emilio y Jorge. Tengo que explicarlo mejor. Mostrando a una
> > audiencia cómo hacer un tipo de análisis, se hace un loop (abajo) que
> > analiza un mapa por regiones longitudinales. Tal y como está el script,
> > print(i) te indica la longitud por la que va (de 10º en 10º) pero me
> > gustaría que en vez de eso te fuese representando una línea vertical
> sobre
> > el mapa, que he representado previamente con ggplot. No es
> imprescindible,
> > pero quedaría bien.
> >
> > Preds <- data.frame()
> >
> > for (i in seq(from = -180, to = 170, by = 10)){
> >   traindata <- subset(data, lon < i|lon>= i+10)
> >   testdata <- subset(data,(lon> i & lon<= i+10))
> >
> >   fitrp <- rpart(Clst ~ .- lon - lat, data=traindata,method = "class")
> >   print(i)
> >
> >   prd <- predict(fitrp, testdata, type="class") # se aplica el modelo a
> > las muestras test
> >   testdata$prd<-prd
> >   Preds<-rbind(Preds,testdata)
> > }
> >
> > El vie., 5 jun. 2020 a las 16:18, Emilio L. Cano (<
> emilopezc...@gmail.com>)
> > escribió:
> >
> >> Hola Manuel,
> >> Al ser ggplot supongo que será como en cualquier gráfico en ejes
> >> coordenados, añade una capa:
> >>
> >> ggplot(…..) + geom_vline(xintercept = vector_de_valores_x)
> >>
> >> Un saludo,
> >>
> >> Emilio L. Cano
> >> http://emilio.lcano.com
> >>
> >>
> >>
> >> > El 5 jun 2020, a las 13:48, Manuel Mendoza <
> mmend...@fulbrightmail.org>
> >> escribió:
> >> >
> >> > Buenos días ¿sabéis si hay alguna forma de añadir una recta vertical
> >> sobre
> >> > un mapa hecho previamente con ggplot? Lo que hago ahora es cargar
> >> > nuevamente el mapa con la línea añadida (una serie de líneas añadidas
> >> > secuencialmente en un loop) pero me gustaría que añadiese las líneas
> sin
> >> > cargar nuevamente el mapa.
> >> > Gracias,
> >> > Manuel
> >> >
> >> >   [[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
>


-- 
Saludos,
Carlos Ortega
www.qualityexcellence.es

[[alternative HTML version deleted]]

___
R-help-es mailing list

Re: [R-es] líneas sobre un mapa

2020-06-06 Thread Emilio L . Cano
Sigo pensando que la solución es añadir un objeto grid, he intentado crear un 
ejemplo pero no termino de ligar las coordenadas del gráfico base con las 
unidades de grid (igual no se puede). Esto es un ejemplo reproducible (aunque 
sin control sobre las coordenadas de la línea:

library(ggplot2)
library(grid)

p <- ggplot(data.frame(x=rnorm(1000), y = rnorm(1000)),
   aes(x, y)) +
  geom_point()

print(p)
y0 <- -10
y1 <- 10
for (i in 1:5)){
  Sys.sleep(time = 1)
  x0 <- x1 <- runif(1, 0, 1)
  grid.segments(x0, y0, x1, y1)
}


Un saludo,

Emilio L. Cano
http://emilio.lcano.com



> El 6 jun 2020, a las 20:40, Manuel Mendoza  
> escribió:
> 
> Gracias Emilio, no sé cómo ponerte un ejemplo reproducible. El mapa es un 
> ggplot como el que te pongo abajo, y el análisis que se hace en cada vuelta 
> del loop (que tienes abajo, del anterior email) es un árbol de clasificación 
> que se entrena con una parte del mapa, dada por la longitud (lon), y se testa 
> con la otra. Los resultados se almacenan en Preds. Como puedes ver, la i del 
> loop/for determina lon, una de las variables de la base de datos del mapa, y 
> a cada iteración del loop (valor de lon) me indica por qué valor va 
> (print(i)). En vez de eso, o además de, me gustaría que me representase un 
> linea sobre el mapa que se hizo previamente con ggplot, que se corresponda 
> con el valor de lon.
> Este es el mapa (sigo abajo):
> 
> world<-map_data('world')
> pyt<-  ggplot(data, aes(x = longitud, y = latitud, color = 
> ptyrup,size=ptyrup)) +
>   geom_point()+
>   scale_color_manual(values = c('lightslateblue','black')) + 
>   scale_size_manual(values=c(1,2))+
>   theme(legend.position="top")
> windows();pyt
> 
> Si en el loop incluyo esto:
>   pyt<-pyt+geom_vline(xintercept = i)
>   print(pyt)
> 
> a cada iteración me representa en el mapa la línea que yo quiero, pero lo 
> hace representando el mapa de nuevo cada vez. La idea es que me añada la 
> línea, cada vez, pero sin tener que representar el mapa, es decir, sobre el 
> que ya estaba. Es por el efecto visual. Parece una tontería, pero frente a 
> una audiencia esos detalles importan (hasta cierto punto).
> 
> Gracias,
> Manuel
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> El sáb., 6 jun. 2020 a las 12:01, Emilio L. Cano ( >) escribió:
> Hola,
> 
> Como ggplot son gráficos tipo “grid” seguramente puedas añadir las líneas 
> como un objeto “grob” sin tener que recargar el mapa. 
> 
> Con un ejemplo reproducible lo podría confirmar.
> 
> Un saludo,
> 
> Emilio L. Cano
> http://emilio.lcano.com 
> 
> 
> 
>> El 5 jun 2020, a las 17:48, Manuel Mendoza > > escribió:
>> 
>> Gracias Emilio y Jorge. Tengo que explicarlo mejor. Mostrando a una 
>> audiencia cómo hacer un tipo de análisis, se hace un loop (abajo) que 
>> analiza un mapa por regiones longitudinales. Tal y como está el script, 
>> print(i) te indica la longitud por la que va (de 10º en 10º) pero me 
>> gustaría que en vez de eso te fuese representando una línea vertical sobre 
>> el mapa, que he representado previamente con ggplot. No es imprescindible, 
>> pero quedaría bien.
>> 
>> Preds <- data.frame()
>> 
>> for (i in seq(from = -180, to = 170, by = 10)){
>>   traindata <- subset(data, lon < i|lon>= i+10)
>>   testdata <- subset(data,(lon> i & lon<= i+10))
>>   
>>   fitrp <- rpart(Clst ~ .- lon - lat, data=traindata,method = "class")
>>   print(i)
>>   
>>   prd <- predict(fitrp, testdata, type="class") # se aplica el modelo a las 
>> muestras test
>>   testdata$prd<-prd
>>   Preds<-rbind(Preds,testdata)
>> }
>> 
>> El vie., 5 jun. 2020 a las 16:18, Emilio L. Cano (> >) escribió:
>> Hola Manuel,
>> Al ser ggplot supongo que será como en cualquier gráfico en ejes 
>> coordenados, añade una capa:
>> 
>> ggplot(…..) + geom_vline(xintercept = vector_de_valores_x)
>> 
>> Un saludo,
>> 
>> Emilio L. Cano
>> http://emilio.lcano.com 
>> 
>> 
>> 
>> > El 5 jun 2020, a las 13:48, Manuel Mendoza > > > escribió:
>> > 
>> > Buenos días ¿sabéis si hay alguna forma de añadir una recta vertical sobre
>> > un mapa hecho previamente con ggplot? Lo que hago ahora es cargar
>> > nuevamente el mapa con la línea añadida (una serie de líneas añadidas
>> > secuencialmente en un loop) pero me gustaría que añadiese las líneas sin
>> > cargar nuevamente el mapa.
>> > Gracias,
>> > Manuel
>> > 
>> >   [[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

Re: [R-es] líneas sobre un mapa

2020-06-06 Thread Manuel Mendoza
Gracias Emilio, no sé cómo ponerte un ejemplo reproducible. El mapa es un
ggplot como el que te pongo abajo, y el análisis que se hace en cada vuelta
del loop (que tienes abajo, del anterior email) es un árbol de
clasificación que se entrena con una parte del mapa, dada por la longitud
(lon), y se testa con la otra. Los resultados se almacenan en Preds. Como
puedes ver, la i del loop/for determina lon, una de las variables de la
base de datos del mapa, y a cada iteración del loop (valor de lon) me
indica por qué valor va (print(i)). En vez de eso, o además de, me gustaría
que me representase un linea sobre el mapa que se hizo previamente con
ggplot, que se corresponda con el valor de lon.
Este es el mapa (sigo abajo):

world<-map_data('world')
pyt<-  ggplot(data, aes(x = longitud, y = latitud, color =
ptyrup,size=ptyrup)) +
  geom_point()+
  scale_color_manual(values = c('lightslateblue','black')) +
  scale_size_manual(values=c(1,2))+
  theme(legend.position="top")
windows();pyt

Si en el loop incluyo esto:
  pyt<-pyt+geom_vline(xintercept = i)
  print(pyt)

a cada iteración me representa en el mapa la línea que yo quiero, pero lo
hace representando el mapa de nuevo cada vez. La idea es que me añada la
línea, cada vez, pero sin tener que representar el mapa, es decir, sobre el
que ya estaba. Es por el efecto visual. Parece una tontería, pero frente a
una audiencia esos detalles importan (hasta cierto punto).

Gracias,
Manuel












El sáb., 6 jun. 2020 a las 12:01, Emilio L. Cano ()
escribió:

> Hola,
>
> Como ggplot son gráficos tipo “grid” seguramente puedas añadir las líneas
> como un objeto “grob” sin tener que recargar el mapa.
>
> Con un ejemplo reproducible lo podría confirmar.
>
> Un saludo,
>
> Emilio L. Cano
> http://emilio.lcano.com
>
>
>
> El 5 jun 2020, a las 17:48, Manuel Mendoza 
> escribió:
>
> Gracias Emilio y Jorge. Tengo que explicarlo mejor. Mostrando a una
> audiencia cómo hacer un tipo de análisis, se hace un loop (abajo) que
> analiza un mapa por regiones longitudinales. Tal y como está el script,
> print(i) te indica la longitud por la que va (de 10º en 10º) pero me
> gustaría que en vez de eso te fuese representando una línea vertical sobre
> el mapa, que he representado previamente con ggplot. No es imprescindible,
> pero quedaría bien.
>
> Preds <- data.frame()
>
> for (i in seq(from = -180, to = 170, by = 10)){
>   traindata <- subset(data, lon < i|lon>= i+10)
>   testdata <- subset(data,(lon> i & lon<= i+10))
>
>   fitrp <- rpart(Clst ~ .- lon - lat, data=traindata,method = "class")
>   print(i)
>
>   prd <- predict(fitrp, testdata, type="class") # se aplica el modelo a
> las muestras test
>   testdata$prd<-prd
>   Preds<-rbind(Preds,testdata)
> }
>
> El vie., 5 jun. 2020 a las 16:18, Emilio L. Cano ()
> escribió:
>
>> Hola Manuel,
>> Al ser ggplot supongo que será como en cualquier gráfico en ejes
>> coordenados, añade una capa:
>>
>> ggplot(…..) + geom_vline(xintercept = vector_de_valores_x)
>>
>> Un saludo,
>>
>> Emilio L. Cano
>> http://emilio.lcano.com
>>
>>
>>
>> > El 5 jun 2020, a las 13:48, Manuel Mendoza 
>> escribió:
>> >
>> > Buenos días ¿sabéis si hay alguna forma de añadir una recta vertical
>> sobre
>> > un mapa hecho previamente con ggplot? Lo que hago ahora es cargar
>> > nuevamente el mapa con la línea añadida (una serie de líneas añadidas
>> > secuencialmente en un loop) pero me gustaría que añadiese las líneas sin
>> > cargar nuevamente el mapa.
>> > Gracias,
>> > Manuel
>> >
>> >   [[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


Re: [R-es] líneas sobre un mapa

2020-06-06 Thread Javier Marcuzzi
Estimado

Si no comprendo mal, una idea media loca. Entendí que es un mapa, algo
geográfico, pues si es así se podría colocar el valor de algo de análisis
como si fuese la altura de las montañas.

Javier Marcuzzi

El sáb., 6 jun. 2020 a las 7:02, Emilio L. Cano ()
escribió:

> Hola,
>
> Como ggplot son gráficos tipo “grid” seguramente puedas añadir las líneas
> como un objeto “grob” sin tener que recargar el mapa.
>
> Con un ejemplo reproducible lo podría confirmar.
>
> Un saludo,
>
> Emilio L. Cano
> http://emilio.lcano.com
>
>
>
> > El 5 jun 2020, a las 17:48, Manuel Mendoza 
> escribió:
> >
> > Gracias Emilio y Jorge. Tengo que explicarlo mejor. Mostrando a una
> audiencia cómo hacer un tipo de análisis, se hace un loop (abajo) que
> analiza un mapa por regiones longitudinales. Tal y como está el script,
> print(i) te indica la longitud por la que va (de 10º en 10º) pero me
> gustaría que en vez de eso te fuese representando una línea vertical sobre
> el mapa, que he representado previamente con ggplot. No es imprescindible,
> pero quedaría bien.
> >
> > Preds <- data.frame()
> >
> > for (i in seq(from = -180, to = 170, by = 10)){
> >   traindata <- subset(data, lon < i|lon>= i+10)
> >   testdata <- subset(data,(lon> i & lon<= i+10))
> >
> >   fitrp <- rpart(Clst ~ .- lon - lat, data=traindata,method = "class")
> >   print(i)
> >
> >   prd <- predict(fitrp, testdata, type="class") # se aplica el modelo a
> las muestras test
> >   testdata$prd<-prd
> >   Preds<-rbind(Preds,testdata)
> > }
> >
> > El vie., 5 jun. 2020 a las 16:18, Emilio L. Cano (<
> emilopezc...@gmail.com >) escribió:
> > Hola Manuel,
> > Al ser ggplot supongo que será como en cualquier gráfico en ejes
> coordenados, añade una capa:
> >
> > ggplot(…..) + geom_vline(xintercept = vector_de_valores_x)
> >
> > Un saludo,
> >
> > Emilio L. Cano
> > http://emilio.lcano.com 
> >
> >
> >
> > > El 5 jun 2020, a las 13:48, Manuel Mendoza  > escribió:
> > >
> > > Buenos días ¿sabéis si hay alguna forma de añadir una recta vertical
> sobre
> > > un mapa hecho previamente con ggplot? Lo que hago ahora es cargar
> > > nuevamente el mapa con la línea añadida (una serie de líneas añadidas
> > > secuencialmente en un loop) pero me gustaría que añadiese las líneas
> sin
> > > cargar nuevamente el mapa.
> > > Gracias,
> > > Manuel
> > >
> > >   [[alternative HTML version deleted]]
> > >
> > > ___
> > > R-help-es mailing list
> > > R-help-es@r-project.org 
> > > https://stat.ethz.ch/mailman/listinfo/r-help-es <
> 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
>

[[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] Dependent data validation in R

2020-06-06 Thread Jeff Newmiller
Why are you telling us all of this? Do you have a question about the R 
language? Dragging in stuff about Excel makes it seem like you just want us to 
do your work for you.

Try to be more specific about what your difficulty is with R. Here are some 
links that may help:

[1] 
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

[2] http://adv-r.had.co.nz/Reproducibility.html

[3] https://cran.r-project.org/web/packages/reprex/index.html (read the 
vignette) 


On June 6, 2020 2:42:49 AM PDT, Manish Mukherjee  
wrote:
>Hi All ,
>I need help in creating dependent data validation in R while creating
>an excel workbook
>So i have two columns one has country and other states . I have to
>create the excel workbook in such a way that when i select the one
>specific country , the corresponding states appear in the next column .
>Something similar to dependent input in shiny ,
>Here is the code what i have written
>
>wb <- createWorkbook()
>addWorksheet(wb, "Input")
>addWorksheet(wb, "list")
>
>df = data.frame("Country"=c("India","US"))
>df1=data.frame("IndiaStates"=c("tamilnadu","Andhra pradesh"))
>df2=data.frame("USStates"=c("Texas","California"))
>
># Add drop-down values "
>writeData(wb, sheet = "list", x = df, startCol = 1)
>writeData(wb, sheet = "list", x = df1, startCol = 2)
>writeData(wb, sheet = "list", x = df2, startCol = 3)
>#Add drop-downs to the column
>dataValidation(wb, "input", col = 1, rows = 2:5, type = "list", value =
> "'db'!$A$2:$A$3")
>
>dataValidation(wb, "input", col = 2, rows = 2:5, type = "list", value =
> "'db'!$b$2:$b$3")
>
>dataValidation(wb, "input", col = 3, rows = 2:5, type = "list", value =
> "'db'!$c$2:$c$3")
>
>saveWorkbook(wb, "dataValidationExample.xlsx", overwrite = TRUE)
>
>
>The states should be in single column in exported excel workbook with
>dependent data validation
>
>
>Thanks, and Regards
>
>Manish Mukherjee
>
>
>
>   [[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.

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

__
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] líneas sobre un mapa

2020-06-06 Thread Emilio L . Cano
Hola,

Como ggplot son gráficos tipo “grid” seguramente puedas añadir las líneas como 
un objeto “grob” sin tener que recargar el mapa. 

Con un ejemplo reproducible lo podría confirmar.

Un saludo,

Emilio L. Cano
http://emilio.lcano.com



> El 5 jun 2020, a las 17:48, Manuel Mendoza  
> escribió:
> 
> Gracias Emilio y Jorge. Tengo que explicarlo mejor. Mostrando a una audiencia 
> cómo hacer un tipo de análisis, se hace un loop (abajo) que analiza un mapa 
> por regiones longitudinales. Tal y como está el script, print(i) te indica la 
> longitud por la que va (de 10º en 10º) pero me gustaría que en vez de eso te 
> fuese representando una línea vertical sobre el mapa, que he representado 
> previamente con ggplot. No es imprescindible, pero quedaría bien.
> 
> Preds <- data.frame()
> 
> for (i in seq(from = -180, to = 170, by = 10)){
>   traindata <- subset(data, lon < i|lon>= i+10)
>   testdata <- subset(data,(lon> i & lon<= i+10))
>   
>   fitrp <- rpart(Clst ~ .- lon - lat, data=traindata,method = "class")
>   print(i)
>   
>   prd <- predict(fitrp, testdata, type="class") # se aplica el modelo a las 
> muestras test
>   testdata$prd<-prd
>   Preds<-rbind(Preds,testdata)
> }
> 
> El vie., 5 jun. 2020 a las 16:18, Emilio L. Cano ( >) escribió:
> Hola Manuel,
> Al ser ggplot supongo que será como en cualquier gráfico en ejes coordenados, 
> añade una capa:
> 
> ggplot(…..) + geom_vline(xintercept = vector_de_valores_x)
> 
> Un saludo,
> 
> Emilio L. Cano
> http://emilio.lcano.com 
> 
> 
> 
> > El 5 jun 2020, a las 13:48, Manuel Mendoza  > > escribió:
> > 
> > Buenos días ¿sabéis si hay alguna forma de añadir una recta vertical sobre
> > un mapa hecho previamente con ggplot? Lo que hago ahora es cargar
> > nuevamente el mapa con la línea añadida (una serie de líneas añadidas
> > secuencialmente en un loop) pero me gustaría que añadiese las líneas sin
> > cargar nuevamente el mapa.
> > Gracias,
> > Manuel
> > 
> >   [[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] Dependent data validation in R

2020-06-06 Thread Manish Mukherjee
Hi All ,
I need help in creating dependent data validation in R while creating an excel 
workbook
So i have two columns one has country and other states . I have to create the 
excel workbook in such a way that when i select the one specific country , the 
corresponding states appear in the next column . Something similar to dependent 
input in shiny ,
Here is the code what i have written

wb <- createWorkbook()
addWorksheet(wb, "Input")
addWorksheet(wb, "list")

df = data.frame("Country"=c("India","US"))
df1=data.frame("IndiaStates"=c("tamilnadu","Andhra pradesh"))
df2=data.frame("USStates"=c("Texas","California"))

# Add drop-down values "
writeData(wb, sheet = "list", x = df, startCol = 1)
writeData(wb, sheet = "list", x = df1, startCol = 2)
writeData(wb, sheet = "list", x = df2, startCol = 3)
#Add drop-downs to the column
dataValidation(wb, "input", col = 1, rows = 2:5, type = "list", value =
 "'db'!$A$2:$A$3")

dataValidation(wb, "input", col = 2, rows = 2:5, type = "list", value =
 "'db'!$b$2:$b$3")

dataValidation(wb, "input", col = 3, rows = 2:5, type = "list", value =
 "'db'!$c$2:$c$3")

saveWorkbook(wb, "dataValidationExample.xlsx", overwrite = TRUE)


The states should be in single column in exported excel workbook with dependent 
data validation


Thanks, and Regards

Manish Mukherjee



[[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] R 4.0.1 is released

2020-06-06 Thread Peter Dalgaard via R-help
The build system rolled up R-4.0.1.tar.gz (codename "See Things Now") this 
morning.

The list below details the changes in this release.

You can get the source code from

http://cran.r-project.org/src/base/R-4/R-4.0.1.tar.gz

or wait for it to be mirrored at a CRAN site nearer to you.

Binaries for various platforms will appear in due course.


For the R Core Team,

Peter Dalgaard

These are the checksums (md5 and SHA-256) for the freshly created files, in 
case you wish
to check that they are uncorrupted:

MD5 (AUTHORS) = b9c44f9f78cab3184ad9898bebc854b4
MD5 (COPYING) = eb723b61539feef013de476e68b5c50a
MD5 (COPYING.LIB) = a6f89e2100d9b6cdffcea4f398e37343
MD5 (FAQ) = 4afa171cd982aaa60f0ba92e2e7bc5d6
MD5 (INSTALL) = 7893f754308ca31f1ccf62055090ad7b
MD5 (NEWS) = 425fd186ac71e462e66af7fb33f86ab4
MD5 (NEWS.0) = bfcd7c147251b5474d96848c6f57e5a8
MD5 (NEWS.1) = eb78c4d053ec9c32b815cf0c2ebea801
MD5 (NEWS.2) = 496062c138e2def06cebccddfb814ac6
MD5 (NEWS.3) = 012e7f4a80cc8ec947bf3f0ff6117ec8
MD5 (R-latest.tar.gz) = 8d199d11865c202cf2bd006e7f32dab7
MD5 (README) = f468f281c919665e276a1b691decbbe6
MD5 (RESOURCES) = 529223fd3ffef95731d0a87353108435
MD5 (THANKS) = 251d20510bfc3cc93b82c5a99f7efcc6
MD5 (VERSION-INFO.dcf) = 7d8af8c338a1e146f9471744d092078a
MD5 (R-4/R-4.0.1.tar.gz) = 8d199d11865c202cf2bd006e7f32dab7

2cde824a7b18958e5f06b391c801c8288be0f84fa8934b7ddefef23c67e60c09  AUTHORS
e6d6a009505e345fe949e1310334fcb0747f28dae2856759de102ab66b722cb4  COPYING
6095e9ffa777dd22839f7801aa845b31c9ed07f3d6bf8a26dc5d2dec8ccc0ef3  COPYING.LIB
eddf87b12197c7b3b19cbc9b11c1beab95b14e3dcd715bf37d2f6a8b2a72c2a1  FAQ
f87461be6cbaecc4dce44ac58e5bd52364b0491ccdadaf846cb9b452e9550f31  INSTALL
1dfd76a990f2a1b11ee4ff17284d18c2177179ee7bbaef51b32e1e7a58719596  NEWS
4e21b62f515b749f80997063fceab626d7258c7d650e81a662ba8e0640f12f62  NEWS.0
12b30c724117b1b2b11484673906a6dcd48a361f69fc420b36194f9218692d01  NEWS.1
e80de410c77f05ff2012fa70051b89119845f734a7fa5c55857e61e4ed7d5f6e  NEWS.2
7201d139947afa52b5e09d26dc01445edf444506264355b2185122bc1ed3dce0  NEWS.3
95fe24a4d8d8f8f888460c8f5fe4311cec656e7a1722d233218bc03861bc6f32  
R-latest.tar.gz
2fdd3e90f23f32692d4b3a0c0452f2c219a10882033d1774f8cadf25886c3ddc  README
408737572ecc6e1135fdb2cf7a9dbb1a6cb27967c757f1771b8c39d1fd2f1ab9  RESOURCES
c9c7cb32308b4e560a22c858819ade9de524a602abd4e92d1c328c89f8037d73  THANKS
d3cdccb1b1645fce356d08892baa0587aa2aef2e851ad552d47cce856137d9b3  
VERSION-INFO.dcf
95fe24a4d8d8f8f888460c8f5fe4311cec656e7a1722d233218bc03861bc6f32  
R-4/R-4.0.1.tar.gz

This is the relevant part of the NEWS file

CHANGES IN R 4.0.1:

  NEW FEATURES:

* paste() and paste0() gain a new optional argument recycle0.  When
  set to true, zero-length arguments are recycled leading to
  character(0) after the sep-concatenation, i.e., to the empty
  string "" if collapse is a string and to the zero-length value
  character(0) when collapse = NULL.

  A package whose code uses this should depend on R (>= 4.0.1).

* The summary() method now maps the counts correctly to
  the warning messages.

  BUG FIXES:

* aov(frml, ...) now also works where the formula deparses to more
  than 500 characters, thanks to a report and patch proposal by Jan
  Hauffa.

* Fix a dozen places (code, examples) as Sys.setlocale() returns
  the new rather than the previous setting.

* Fix for adding two complex grid units via sum().  Thanks to Gu
  Zuguang for the report and Thomas Lin Pedersen for the patch.

* Fix parallel::mclapply(..., mc.preschedule=FALSE) to handle raw
  vector results correctly. PR#17779

* Computing the base value, i.e., 2, "everywhere", now uses
  FLT_RADIX, as the original machar code looped indefinitely on the
  ppc64 architecture for the longdouble case.

* In R 4.0.0, sort.list(x) when is.object(x) was true, e.g., for x
  <- I(letters), was accidentally using method = "radix".
  Consequently, e.g., merge() was much slower than
  previously; reported in PR#17794.

* plot(y ~ x, ylab = quote(y[i])) now works, as e.g., for xlab;
  related to PR#10525.

* parallel::detect.cores(all.tests = TRUE) tries a matching OS name
  before the other tests (which were intended only for unknown
  OSes).

* Parse data for raw strings is now recorded correctly. Reported by
  Gabor Csardi.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

___
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,