Re: [R] R plot split screen in uneven panels

2018-12-12 Thread Bert Gunter
?layout Please read the Help file **carefully** and work through the **examples**. I cannot explain better than they. Here is code using layout() that I think does what you want: m <- matrix(1:2, nrow =1) layout(m, widths = c(1,2)) plot(1:10, type = "p",main = "The First Plot") plot(10:1, type =

[R] R plot split screen in uneven panels

2018-12-12 Thread Luigi Marongiu
Dear all, I would like to draw two plots in the same device so that there is a single row and two columns, with the first column being 1/3 of the device's width. I am creating a PNG object with width = 30 and height = 20 cm. I know that I should use split.screen or layout but I am lost with the

Re: [R] R and factorytalk historian

2018-12-12 Thread PIKAL Petr
Hi Well, the final answer is that data from FTH could be transfered to other software **only** through Excel. Regarding RetroEncabulator, readings could be enahanced by extensive and elaborate use of nanoputian molecules chained together. Cheers Petr > -Original Message- > From:

Re: [R] R plot split screen in uneven panels

2018-12-12 Thread Franklin Bretschneider
Dear Luigi Marongiu, Re: > Dear all, > I would like to draw two plots in the same device so that there is a > single row and two columns, with the first column being 1/3 of the > device's width. > I am creating a PNG object with width = 30 and height = 20 cm. > I know that I should use

Re: [R] Different performance with different R versions

2018-12-12 Thread MacQueen, Don via R-help
Probably more appropriate for R-SIG-Mac -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 12/11/18, 12:22 AM, "R-help on behalf of cowan robin" wrote: I am running a small simulation, and getting

Re: [R] R plot split screen in uneven panels

2018-12-12 Thread Bert Gunter
Incidentally, here is another way to do what (I think) you asked using layout(): m <- matrix(c(1,2,2), nrow =1) layout(m) plot(1:10, type = "p",main = "The First Plot") plot(10:1, type = "l", main ="The Second Plot") On my device, the plots use different size fonts, point sizes, etc. and so

Re: [R] Width of a text

2018-12-12 Thread Duncan Murdoch
On 12/12/2018 6:55 AM, Christofer Bogaso wrote: Hi, In HTML there is a way to measure the width of a Text before printing it on screen as in https://www.w3schools.com/tags/canvas_measuretext.asp In R we have nchar() function which just measures the number of letters in a Text, but I wonder if

Re: [R] R and factorytalk historian

2018-12-12 Thread Hasan Diwan
Could you not script Excel to export automatically to CSV -- https://stackoverflow.com/a/10803229/783412, for example -- and import the result into R? -- H On Wed, 12 Dec 2018 at 07:17, PIKAL Petr wrote: > Hi > > Well, the final answer is that data from FTH could be transfered to other >

Re: [R] R and factorytalk historian

2018-12-12 Thread PIKAL Petr
Hi Jeff, FactoryTalk Historian should be system for operation data management. I am aware of some R capabilities in transfering data and during our training I will ask about the way FTH can export data. From my current knowledge export to Excel via integrated module is possible. My question

Re: [R] R and factorytalk historian

2018-12-12 Thread Viechtbauer, Wolfgang (SP)
Dear Petr, Sorry, no experience with the FTH, but related to this, has anybody gotten R to interface nicely with the Retro Encabulator, providing live read outs of the synchronizing cardinal grammeters? (my apologies, I just couldn't resist) Best, Wolfgang >-Original Message- >From:

Re: [R] CRAN package NlcOptim query

2018-12-12 Thread aveek via R-help
Hello Eric, Thanks for your response and suggestions.  I have used dput() on the R objects - sharing below so that it is possible for anyone to recreate the situation. I have still kept it as a 9*9 matrix but for simplicity we now only have 2 equality and 2 non equality constraints. Thanks

[R] Width of a text

2018-12-12 Thread Christofer Bogaso
Hi, In HTML there is a way to measure the width of a Text before printing it on screen as in https://www.w3schools.com/tags/canvas_measuretext.asp In R we have nchar() function which just measures the number of letters in a Text, but I wonder if we can measure the width of text as well. I have

Re: [R] CRAN package NlcOptim query

2018-12-12 Thread Hans W Borchers
This is still not complete: `x_than0` is missing. `Constr_new` is written with a capital 'C'. And aeq2 is a list of column vectors, not a matrix. Setting the tolerance to 0 does not seem to be a good idea. Making aeq2 a matrix and adding `x_than0 <- matrix(c(1, 1))`, then aeq2 <-

Re: [R] Width of a text

2018-12-12 Thread Ben Tupper
Hi, Does strwidth() do the trick? https://www.rdocumentation.org/packages/graphics/versions/3.5.1/topics/strwidth Ben > On Dec 12, 2018, at 6:55 AM, Christofer Bogaso > wrote: > > Hi, > > In HTML there is a

Re: [R-es] Subset dentro de un for

2018-12-12 Thread Manuel Mendoza
Gracias a los tres, Raúl, Marcelino y Carlos. Lo del "get" de Marcelino me da la respuesta a lo que yo exactamente preguntaba, y funciona, pero ahora tengo problemas con el for, por lo que probablemente recurra al eval parse de Raúl o Carlos, que ya tienen el for. Aún así, lo intento 1º

Re: [R-es] Subset dentro de un for

2018-12-12 Thread Marcelino De La Cruz Rot
Ten cuidado, porque empiezas el for como: for(i in GT) y luego el color del aes lo defines como: color= GT[i] Lo que, por ejemplo para el primer caso, se traduciría  en GT["var1"], que, a no ser que GT tenga names , debería dar un error. Yo creo que quieres decir for(i in 1:length(GT))

Re: [R-es] Subset dentro de un for

2018-12-12 Thread Marcelino De La Cruz Rot
Ese error suena a que alguna de las variables fuese no numérica (factor o character). El 12/12/2018 a las 19:32, Manuel Mendoza escribió: > > Gracias Marcelino. Si, (i in 1:length(GT)), lo he utilizado mil veces, > pero se me sigue olvidando de una vez a otra. Lo iba a mirar, pero me > centré

[R-es] Donde obtener tablas de datos ejemplo

2018-12-12 Thread jorge della gaspera
Buenas tardes, donde puedo encontrar tablas de datos para trabajar con R las funciones de correlación de variables. [[alternative HTML version deleted]] ___ R-help-es mailing list R-help-es@r-project.org

Re: [R-es] Donde obtener tablas de datos ejemplo

2018-12-12 Thread Jorge I Velez
?cor El El mié, 12 de dic. de 2018 a las 3:51 p. m., jorge della gaspera < jara...@gmail.com> escribió: > Buenas tardes, donde puedo encontrar tablas de datos para trabajar con R > las funciones de correlación de variables. > > [[alternative HTML version deleted]] > >

Re: [R-es] Subset dentro de un for

2018-12-12 Thread Manuel Mendoza
Si, es lo primero que pensé, pero lo he comprobado y las 20 utilizadas para hacer el gradiente son numéricas. De hecho, si las pongo con su nombre, en vez de get(GT[i]), me hace bien el mapa. Quoting Marcelino De La Cruz Rot : Ese error suena a que alguna de las variables fuese no

Re: [R-es] Subset dentro de un for

2018-12-12 Thread Manuel Mendoza
Gracias Marcelino. Si, (i in 1:length(GT)), lo he utilizado mil veces, pero se me sigue olvidando de una vez a otra. Lo iba a mirar, pero me centré primero en que me hiciera bien el mapa. He probado el for y me da este error: Error in aes(x = lon, y = lat, color = get(GT[i]), size = 2) +

Re: [R-es] Subset dentro de un for

2018-12-12 Thread Raúl Vaquerizo
Hola, Puedes hacer el mítico eval parse paste: for (i in seq(1,maximo)){ eval(parse(text=paste('df',i,'<-subset(df, subset = var',i,'>0)',sep=''))) } Saludos. El 12/12/2018 14:08, Manuel Mendoza escribió: Muy buenas. Quiero hacer un loop en el que en cada iteración se hace un subset con

Re: [R-es] Subset dentro de un for

2018-12-12 Thread Carlos Ortega
Esta es una forma... > for(i in c('Ozone', 'Solar.R')) { + print(i) + sub_data <- subset(airquality, eval(parse(text=i)) < 100) + res_ult <- mean(sub_data$Temp, na.rm = TRUE) + print(res_ult) + } [1] "Ozone" [1] 77.34862 [1] "Solar.R" [1] 71.85294 Y otra forma à la dplyr...: >

Re: [R-es] Subset dentro de un for

2018-12-12 Thread Marcelino De La Cruz Rot
Hola, Manuel: Tienes que usar get: subset(df, subset=get(GT[1])>0) El 12/12/2018 a las 14:08, Manuel Mendoza escribió: > Muy buenas.  Quiero hacer un loop en el que en cada iteración se hace > un subset con el que se queda con las muestras para la que cierta > variable es positiva. > > Si

[R-es] Subset dentro de un for

2018-12-12 Thread Manuel Mendoza
Muy buenas. Quiero hacer un loop en el que en cada iteración se hace un subset con el que se queda con las muestras para la que cierta variable es positiva. Si hago esto, sale bien: df2<-subset(df, subset = var1>0) Pero he probado así (y de no sé cuantas formas más), antes de hacer el