Re: [R-es] (sin asunto)

2023-02-13 Thread Marcelino de la Cruz Rot

Buenos días:

BIOs<-
("BIO1”,”BIO2”,”BIO3","BIO4”,”BIO5”,”BIO6”,”BIO7”,”BIO8","BIO9”,”BIO10”)
for (j in BIOs) {
  excel <- paste(j,".xlsx", sep="")
  data <- read_excel(excel)
...


Un saludo,
Marcelino

El 14/02/2023 a las 6:07, Manuel Mendoza escribió:

Buenos días, tengo un conjunto de 10 bases de datos en excel cuyos nombres
van de BIO1 a BIO10. Quiero hacer un loop en el que me coja una cada vez.
He probado lo que os pongo abajo (y otras cosas parecidas) y obviamente no
funciona. ¿Conocéis alguna forma?
Gracias como siempre,
Manuel

BIOs<-
("BIO1”,”BIO2”,”BIO3","BIO4”,”BIO5”,”BIO6”,”BIO7”,”BIO8","BIO9”,”BIO10”)
for (j in 1:length(BIOs)) {
   data <- read_excel("BIOs[j].xlsx")
...

[[alternative HTML version deleted]]

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



--
Marcelino de la Cruz Rot
Depto. de Biología y Geología
Física y Química Inorgánica
Universidad Rey Juan Carlos
Móstoles España

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


Re: [R-es] Tomar dfs con for

2023-02-13 Thread Juan Abasolo
Hola, Manuel
El problema lo tnes en el nombre que le decis que lea. Tenes que poner un
paste0 y construirlo pasito a pasito.

Recomendacion: metele en el loop un print(i)  o tantos como hagan falta,
para qie veas que estas haciendo.
Segunda recomendacion: hace una variable que sea el_df_a_leer y que lea
eso, con un print antes.

Disculpa la explicacion torpe, desde el telefono en el bus
Suerte

Juan

Telefomotik, barkatu abilezi falta.

Manuel Mendoza  igorleak hau idatzi zuen (2023
ots. 14, ar. 07:38):

> Perdonad que se me olvidó el asunto. Repito:
>
> Buenos días, tengo un conjunto de 10 bases de datos en excel cuyos nombres
> van de BIO1 a BIO10. Quiero hacer un loop en el que me coja una cada vez.
> He probado lo que os pongo abajo (y otras cosas parecidas) y obviamente no
> funciona. ¿Conocéis alguna forma?
> Gracias como siempre,
> Manuel
>
>
> BIOs<-("BIO1”,”BIO2”,”BIO3","BIO4”,”BIO5”,”BIO6”,”BIO7”,”BIO8","BIO9”,”BIO10”)
> for (j in 1:length(BIOs)) {
>   data <- read_excel("BIOs[j].xlsx")
> ...
>
> [[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-es] Tomar dfs con for

2023-02-13 Thread Manuel Mendoza
Perdonad que se me olvidó el asunto. Repito:

Buenos días, tengo un conjunto de 10 bases de datos en excel cuyos nombres
van de BIO1 a BIO10. Quiero hacer un loop en el que me coja una cada vez.
He probado lo que os pongo abajo (y otras cosas parecidas) y obviamente no
funciona. ¿Conocéis alguna forma?
Gracias como siempre,
Manuel

BIOs<-("BIO1”,”BIO2”,”BIO3","BIO4”,”BIO5”,”BIO6”,”BIO7”,”BIO8","BIO9”,”BIO10”)
for (j in 1:length(BIOs)) {
  data <- read_excel("BIOs[j].xlsx")
...

[[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] (sin asunto)

2023-02-13 Thread Manuel Mendoza
Buenos días, tengo un conjunto de 10 bases de datos en excel cuyos nombres
van de BIO1 a BIO10. Quiero hacer un loop en el que me coja una cada vez.
He probado lo que os pongo abajo (y otras cosas parecidas) y obviamente no
funciona. ¿Conocéis alguna forma?
Gracias como siempre,
Manuel

BIOs<-
("BIO1”,”BIO2”,”BIO3","BIO4”,”BIO5”,”BIO6”,”BIO7”,”BIO8","BIO9”,”BIO10”)
for (j in 1:length(BIOs)) {
  data <- read_excel("BIOs[j].xlsx")
...

[[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] latticeExtra: how to use doubleYScale when we want to keep the groups of every lattice graph

2023-02-13 Thread Deepayan Sarkar
On Mon, Feb 13, 2023 at 3:48 AM Laurent Rhelp  wrote:
>
> Dear R-Help-list,
>
>   I want to use the doubleYScale function from latticeExtra to overlap two
> lattice graphs (cf. code below). The overlapping works but I lose the
> groups of
> every lattice, there are only two colors. Reading the documentation,
> the arguments style1 and style2 give me the impression that it is not
> possible to keep the groups of every lattice.

I'm mostly guessing from looking at the examples, but is this what you want?

gr_Gx_Tx <- latticeExtra::doubleYScale(gr_Gx, gr_Tx, style1 = 0, style2 = 0)

Best,
-Deepayan

> Is there any possibility to keep the groups of every lattice graph with
> the doubleYScale function ?
>
> Or, might you give me some orientations to realize the graph keeping the
> groups using the lattice package ?
>
> Thank you
>
> Best regards
>
> Laurent
>
> #-o<-->o-
> library(lattice)
> library(latticeExtra)
> ##
> ## creation of the first lattice graph gr_Gx with a group of two elements
> ##
> lattice.par <- trellis.par.get()
> my.superpose.line  <- lattice.par$superpose.line
> my.superpose.line$col[1:2] <- c("black","red")
> gr_Gx <- xyplot( value ~ time | region
>, data = df.m
>, subset = sensor %in% c("G2","G4")
>, group = sensor
>, type ="l"
>, scales = list( y = list(log=10)
> , x = list(relation="free", axs =
> "i", abbreviate=TRUE))
>, yscale.components = yscale.components.log10ticks
>, par.settings = list(
>  superpose.line = my.superpose.line
>)
> )
> print(gr_Gx)
> ##
> ## creation of the second lattice graph gr_Tx with a group of five elements
> ##
> lattice.par <- trellis.par.get()
> my.superpose.line  <- lattice.par$superpose.line
> my.superpose.line$col[1:5] <- c(1,2,3,4,5)
> gr_Tx <-  xyplot( value ~ time | region
> , group = sensor
> , subset = sensor %in% c("T1","T2","T3","T4","T5")
> , data= df.m
> , type = "l"
> , scales = list( x= list( axs = "i", relation = "free"
>   , abbreviate = TRUE))
> , par.settings = list( superpose.line =
> my.superpose.line )
> )
> print(gr_Tx)
> ##
> ## overlap the two lattice graphs
> ## We lost the groups of every lattice
> ##
> gr_Gx_Tx <- latticeExtra::doubleYScale(gr_Gx, gr_Tx)
> print(gr_Gx_Tx)
>
> #o<-->o-
>
> The data :
>
> df.m <- structure(list(time = c(0.000250101089477539, 0.000250101089477539,
>   0.000250101089477539, 0.000250101089477539, 0.000250101089477539,
>   0.000250101089477539, 0.000250101089477539, 0.000500202178955078,
>   0.000500202178955078, 0.000500202178955078, 0.000500202178955078,
>   0.000500202178955078, 0.000500202178955078, 0.000500202178955078,
>   0.000750064849853516, 0.000750064849853516, 0.000750064849853516,
>   0.000750064849853516, 0.000750064849853516, 0.000750064849853516,
>   0.000750064849853516, 0.00100016593933105, 0.00100016593933105,
>   0.00100016593933105, 0.00100016593933105, 0.00100016593933105,
>   0.00100016593933105, 0.00100016593933105, 0.00125002861022949,
>   0.00125002861022949, 0.00125002861022949, 0.00125002861022949,
>   0.00125002861022949, 0.00125002861022949, 0.00125002861022949,
>   0.00150012969970703, 0.00150012969970703, 0.00150012969970703,
>   0.00150012969970703, 0.00150012969970703, 0.00150012969970703,
>   0.00150012969970703, 0.00175023078918457, 0.00175023078918457,
>   0.00175023078918457, 0.00175023078918457, 0.00175023078918457,
>   0.00175023078918457, 0.00175023078918457, 0.0029346008301,
>   0.0029346008301, 0.0029346008301, 0.0029346008301,
>   0.0029346008301, 0.0029346008301, 0.0029346008301,
>   0.00225019454956055, 0.00225019454956055, 0.00225019454956055,
>   0.00225019454956055, 0.00225019454956055, 0.00225019454956055,
>   0.00225019454956055, 0.00250005722045898, 0.00250005722045898,
>   0.00250005722045898, 0.00250005722045898, 0.00250005722045898,
>   0.00250005722045898, 0.00250005722045898, 0.00275015830993652,
>   0.00275015830993652, 0.00275015830993652, 0.00275015830993652,
>   0.00275015830993652, 0.00275015830993652, 0.00275015830993652,
>   0.0032098083496, 0.0032098083496, 0.0032098083496,
>   0.0032098083496, 0.0032098083496, 0.0032098083496,
>   0.0032098083496, 0.0032501220703125, 0.0032501220703125,
>   0.0032501220703125, 0.0032501220703125, 0.0032501220703125,
> 0.0032501220703125,
>   0.0032501220703125, 0.00350022315979004, 0.00350022315979004,
>   0.00350022315979004, 0.00350022315979004, 0.00350022315979004,
>