Re: [R] ggplot and boxplots

2018-03-12 Thread Richard M. Heiberger
It looks like your V3 is a factor. testing_ggplot <- data.frame( V1=factor(c(256, 256, 256, 272, 272, 272)), V2=c("Disabled", "Disabled", "Enabled", "Disabled", "Enabled", "Enabled"), V3=681:686) library(ggplot2) ggplot(testing_ggplot, aes(V2,V3 )) + geom_boxplot() + facet_wrap( ~

Re: [R] Bug report: override stopifnot() ?

2018-03-12 Thread Duncan Murdoch
On 12/03/2018 2:43 PM, Bert Gunter wrote: Please stop this line of queries/"suggestions/speculations and read the relevant docs **carefully**. For example, from ?"==" "Note Do not use == and != for tests, such as in if expressions, where you must get a single TRUE or FALSE. Unless you are

[R] ggplot and boxplots

2018-03-12 Thread Yectli Huerta via R-help
Hi, I was wondering if someone could give me a hint or two. I'm having problems generating ggplot2 boxplots . The plot that is has dots but no boxplots. Below is the dataset > testing_ggplot V1V2 V3 1 256 Disabled 688.61 2 256 Disabled 698.63 3 256 Disabled 700.02 4 256

Re: [R] Equivalent of gtools::mixedsort in R base

2018-03-12 Thread Gabor Grothendieck
split any mixed columns into letter and number columns and then order can be used on that: DF <- data.frame(x = c("a10", "a2", "a1")) o <- do.call("order", transform(DF, let = gsub("\\d", "", x), no = as.numeric(gsub("\\D", "", x)),

Re: [R-es] Alternativa a rrefine

2018-03-12 Thread Javier Marcuzzi
Estimado Freddy Omar López Quintero Me llama la atención que google deje su producto, hay dos posibilidades, un problema serio o solo ofrecen la solución dentro de sus herramientas para bigdata, habría que explorar lo que ofrecen como producto pago o de prueba. Mi experiencia es estar un mes

[R] Error - PMML Conversion of a Random-Forest Model using the randomForest Package

2018-03-12 Thread Karthiko S
Hi All, I am trying to convert random forest model developed into a pmml file. randomForest package was used to build the model. The input to the model is in the form of a matrix (term frequency matrix used for text analytics). While i try to convert the model into a pmml file an error pops.

Re: [R] Bug report: override stopifnot() ?

2018-03-12 Thread Bert Gunter
Please stop this line of queries/"suggestions/speculations and read the relevant docs **carefully**. For example, from ?"==" "Note Do not use == and != for tests, such as in if expressions, where you must get a single TRUE or FALSE. Unless you are absolutely sure that nothing unusual can

Re: [R] Bug report: override stopifnot() ?

2018-03-12 Thread Stepan Kasal
Hello, I'm sorry that I aswer to my own mail; I forgot to attach the patch. Patch below, Stepan Kasal On Mon, Mar 12, 2018 at 06:53:00PM +0100, Stepan Kasal wrote: > When thinking about it, stopifnot() should really issue a better error > message in this case. Patch attached. But I should

Re: [R] Bug report: override stopifnot() ?

2018-03-12 Thread Stepan Kasal
Hello, On Mon, Mar 12, 2018 at 09:30:59AM -0700, William Dunlap wrote: > Why don't you use >stopifnot( all(m1 == m2) ) > ? good question. Even though I use aseert np.all(m1 == m2) when working with NumPy, I got accustomed to the "handy shortcut" that I can omit all() with R vectors and

Re: [R] Equivalent of gtools::mixedsort in R base

2018-03-12 Thread Sebastien Bihorel
Thanks for your reply. I take this is also a no to my question and appreciated the suggested mixedrank function and its usage with do.call. Thanks - Original Message - From: "Jeff Newmiller" To: "Bert Gunter" Cc: "Sebastien Bihorel"

Re: [R] Equivalent of gtools::mixedsort in R base

2018-03-12 Thread Sebastien Bihorel
Hi, Point taken... although this error is not returned in older version of R (3.1.2 does not have any issue with your test case... not sure when the added layer of check was introduced). From: "William Dunlap" To: "Sebastien Bihorel"

Re: [R] Equivalent of gtools::mixedsort in R base

2018-03-12 Thread Sebastien Bihorel
So I take this is a no to my initial question. Cheers too. PS: some users just ask questions to get straight answers not to get a solution to their problem :D From: "Bert Gunter" To: "Sebastien Bihorel" Cc: "R-help"

Re: [R] Bug report: override stopifnot() ?

2018-03-12 Thread William Dunlap via R-help
Why don't you use stopifnot( all(m1 == m2) ) ? Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Mar 12, 2018 at 8:15 AM, Stepan Kasal wrote: > Hello, > I stumbled over a problem: >stopifnot(m1 == m2) > > It works with vector or matrix, but does not work for classes

[R] Bug report: override stopifnot() ?

2018-03-12 Thread Stepan Kasal
Hello, I stumbled over a problem: stopifnot(m1 == m2) It works with vector or matrix, but does not work for classes from Matrix package. In the source of stopifnot(), there is all(m1 == m2) that would just work, but there is also is.logical(m1 == m2) that id FALSE. Would it be possible if

Re: [R-es] Contar categorías después de ciertos valores

2018-03-12 Thread Guillermo.Vinue
Muchas gracias Carlos y Javier por la ayuda. Saludos, Guillermo > Hola, > > Esta es una forma... > > #- > > x <- c(3, "A", "B", 5, "A", 4, 5, "A", "A", 3) > x_n <- as.numeric(x) > > cat_val <- unique(x[is.na(x_n)]) > num_val <- x_n[!is.na(x_n)] > > df <- data.frame( >

Re: [R] Equivalent of gtools::mixedsort in R base

2018-03-12 Thread William Dunlap via R-help
1- mixedorder does not work in a "do.call(mixedorder, mydataframe)" call like the order function does This is tangential, but do.call(order, mydataframe) is not safe to use in a general purpose function either - you need to remove the names from the second argument: > d <-

[R-es] Alternativa a rrefine

2018-03-12 Thread Freddy Omar López Quintero
¡Hola! Espero que estén muy bien. Consulta: ¿alguno tiene experiencia (y que la pueda compartir) utilizando alguna alternativa a rrefine ( https://cran.r-project.org/web/packages/rrefine/vignettes/rrefine-vignette.html )? He utilizado rrefine y open refine (http://openrefine.org/) en general

[R] Package gamlss used inside foreach() and %dopar% fails to find an object

2018-03-12 Thread Nik Tuzov
Hello Mikis: Thanks a lot, it worked. Could you tell me what the problem was? Regards, Nik - Original Message - From: r-help-requ...@r-project.org To: "r-help" Sent: Sunday, March 11, 2018 6:00:02 AM Subject: R-help Digest, Vol 181, Issue 11 Send R-help mailing list submissions to

Re: [R] Help on Aggregation

2018-03-12 Thread PIKAL Petr
Hi The first question is simple. You should use aggregate and cut but first you need to transfer your data to date/time format by strptime. test<-read.table("clipboard", header=T) test$cas<-strptime(paste(test$Date, test$Time), format="%Y/%m/%d %H:%M:%S") Below is the data.

[R] Help on Aggregation

2018-03-12 Thread Emeka Don
Dear All, 1.I have been trying to aggregate my data but I have not been getting it correctly. In the data I want to convert hourly data into daily averages. Here is a sample of the data: Neph_no Date Time Temp_C Pressure_kPa RH 9 2014/03/28 10:00:00 38.4 95.9 29.7 9 2014/03/28 11:00:00

Re: [R] Equivalent of gtools::mixedsort in R base

2018-03-12 Thread Jeff Newmiller
x <- c( "a1", "a10", "a2" ) y <- c( "b10", "b2", "a12", "ca1" ) DF <- expand.grid( x = x, y = y ) # randomize set.seed( 42 ) DF <- DF[ sample( nrow( DF ) ), ] # missing from gtools mixedrank <- function( x ) { seq.int( length( x ) )[ gtools::mixedorder(x) ] } o <- do.call( order, lapply( DF,