Re: [R] Gradient plots in ggplot2

2021-03-09 Thread phil
Thank you for your suggestions. I found, after much experimentation, that scale_fill_gradientn did indeed provide a good solution, as below. library(ggplot2) a <- c(rep(1,6),rep(2,6),rep(3,6),rep(4,6)) b <- c(0.1, 0.5,-0.3, 1.2,-0.4,-1.2, 0.7, 0.8,-1.2,-0.5,10.0, 0.3, 0.2,-0.4,-15.

Re: [R] Gradient plots in ggplot2

2021-03-08 Thread PIKAL Petr
gt; -Original Message- > From: R-help On Behalf Of > p...@philipsmith.ca > Sent: Tuesday, March 9, 2021 5:06 AM > To: r-help@r-project.org > Subject: [R] Gradient plots in ggplot2 > > I am having trouble with a gradient fill application in ggplot2, caused > by outlier values. In m

Re: [R] Gradient plots in ggplot2

2021-03-08 Thread Jeff Newmiller
Perhaps scale_fill_gradientn() would be useful. On March 8, 2021 8:05:52 PM PST, p...@philipsmith.ca wrote: >I am having trouble with a gradient fill application in ggplot2, caused > >by outlier values. In my reprex, most of the values are between 2 and >-2, but there are two outliers, 10 and -15

[R] Gradient plots in ggplot2

2021-03-08 Thread phil
I am having trouble with a gradient fill application in ggplot2, caused by outlier values. In my reprex, most of the values are between 2 and -2, but there are two outliers, 10 and -15. The outliers stand out well, which is good, but all the other numbers show almost no colour variation. I woul

Re: [R] Gradient color to a line graph

2017-02-05 Thread Riyas MJ
Thank you so much. Both worked well. Thanks On Sun, Feb 5, 2017 at 2:27 AM, Jeff Newmiller wrote: > You haven't indicated what information you want to convey with this > gradient. > > You also are using arrays where you should be using vectors, usually > stored in a data frame. > > Here is one w

Re: [R] Gradient color to a line graph

2017-02-04 Thread Jeff Newmiller
You haven't indicated what information you want to convey with this gradient. You also are using arrays where you should be using vectors, usually stored in a data frame. Here is one way using the contributed package ggplot2: library(ggplot2) DF <- data.frame( V1=1:10, V2=11:20, C=21:30 ) p <-

Re: [R] Gradient color to a line graph

2017-02-04 Thread David Winsemius
> On Feb 4, 2017, at 9:14 AM, Riyas MJ wrote: > > Hi all, > > I am a new user of R. I just did my first real program. > I would like to know how to put a gradient (like rainbow() or topo.colors, > etc) to a* line* graph. > > Example: > ar1=array(data=1:10,dim=9) > ar2=array(data=11:20,dim=9) >

[R] Gradient color to a line graph

2017-02-04 Thread Riyas MJ
Hi all, I am a new user of R. I just did my first real program. I would like to know how to put a gradient (like rainbow() or topo.colors, etc) to a* line* graph. Example: ar1=array(data=1:10,dim=9) ar2=array(data=11:20,dim=9) plot(ar1,ar2,type="l",col="red",lwd=3) Instead of a red color, I woul

Re: [R] gradient

2012-11-25 Thread izymaths
Come on man ! I have to make the algorithm CG-Steihaug it's not easy. And I need the gradient of this function to make my algorithm works for functions f : R^2 -> R (my algorithm already works for functions f : R -> R) Please. -- View this message in context: http://r.789695.n4.nabble.com/gra

Re: [R] gradient

2012-11-25 Thread Uwe Ligges
On 25.11.2012 15:21, izymaths wrote: Hi, I'm a french student and I need some help for my project. I have to calcul the gradient of the function : f <- function(x,y) { (1 - x^2) + (y - x^2)^2 } This list does not answer homework problems. And even if we would, your problem is school level

[R] gradient

2012-11-25 Thread izymaths
Hi, I'm a french student and I need some help for my project. I have to calcul the gradient of the function : f <- function(x,y) { (1 - x^2) + (y - x^2)^2 } Thanks ! :) -- View this message in context: http://r.789695.n4.nabble.com/gradient-tp4650734.html Sent from the R help mailing list

Re: [R] gradient

2012-03-31 Thread David Winsemius
On Mar 31, 2012, at 3:58 PM, mariam behboudi wrote: Hello In matlab we have " gradient(F,h) " where h is a scalar uses h as the spacing between points in each direction. Now I need to use this function in R. and I dont know how can I should define my function that I haave "h" in R?

Re: [R] gradient

2012-03-31 Thread Joshua Wiley
Hi, Have you looked at: ?grad in the numDeriv package? It works very similarly and there are examples. Hope this helps, Josh On Sat, Mar 31, 2012 at 12:58 PM, mariam behboudi wrote: > Hello > In matlab we have "   gradient(F,h)   "  where h is a scalar uses h as the > spacing between points

[R] gradient

2012-03-31 Thread mariam behboudi
Hello In matlab we have " gradient(F,h) " where h is a scalar uses h as the spacing between points in each direction. Now I need to use this function in R. and I dont know how can I should define my function that I haave "h" in R? thanks [[alternative HTML version deleted]]

Re: [R] gradient function in OPTIMX

2011-08-30 Thread John C Nash
ent Google Summer of Code effort. John Nash On 08/30/2011 06:00 AM, r-help-requ...@r-project.org wrote: > Message: 10 > Date: Mon, 29 Aug 2011 02:10:36 -0700 (PDT) > From: Kathie > To: r-help@r-project.org > Subject: [R] gradient function in OPTIMX > Message-ID: <131460903

Re: [R] gradient function in OPTIMX

2011-08-30 Thread Rubén Roa
nt problem in optimx. Rubén H. Roa-Ureta, Ph. D. AZTI Tecnalia, Txatxarramendi Ugartea z/g, Sukarrieta, Bizkaia, SPAIN -Original Message- From: r-help-boun...@r-project.org on behalf of Kathie Sent: Mon 8/29/2011 11:10 AM To: r-help@r-project.org Subject: [R] gradient function in OPTIMX Dear

Re: [R] Gradient function in OPTIMX

2011-08-30 Thread Ravi Varadhan
Hi Kathie, The gradient check in "optimx" checks if the user specified gradient (at starting parameters) is within roughly 1.e-05 * (1 + fval) of the numerically computed gradient. It is likely that you have correctly coded up the gradient, but still there can be significant differences b/w num

[R] gradient function in OPTIMX

2011-08-29 Thread Kathie
Dear R users When I use OPTIM with BFGS, I've got a significant result without an error message. However, when I use OPTIMX with BFGS( or spg), I've got the following an error message. > optim

Re: [R] gradient generation

2011-07-06 Thread Jim Lemon
On 07/06/2011 04:19 PM, Annemarie Verkerk wrote: Dear R-help subscribers; I have a question regarding making gradients in R. I've searched on the web, but was only able to find functions that make a gradient between color X and Y, which is not what I want. I want to 'pick out' individual, small

[R] gradient generation

2011-07-06 Thread Annemarie Verkerk
Dear R-help subscribers; I have a question regarding making gradients in R. I've searched on the web, but was only able to find functions that make a gradient between color X and Y, which is not what I want. I want to 'pick out' individual, smaller pieces of a gradient based on a range of nu

Re: [R] Gradient Boosting Trees with correlated predictors in gbm

2010-03-06 Thread Patrick Connolly
On Tue, 02-Mar-2010 at 02:43PM -0500, Liaw, Andy wrote: |> In most implementations of boosting, and for that matter, single tree, |> the first variable wins when there are ties. In randomForest the That still doesn't explain why with gbm, two identical variables will "share the glory" (approxima

Re: [R] Gradient Boosting Trees with correlated predictors in gbm

2010-03-02 Thread Max Kuhn
On Tue, Mar 2, 2010 at 2:43 PM, Liaw, Andy wrote: > In most implementations of boosting, and for that matter, single tree, > the first variable wins when there are ties. They must be in a union :-) >> What happens if there's a third? If they were P perfectly correlated predictors, the importanc

Re: [R] Gradient Boosting Trees with correlated predictors in gbm

2010-03-02 Thread Liaw, Andy
In most implementations of boosting, and for that matter, single tree, the first variable wins when there are ties. In randomForest the variables are sampled, and thus not tested in the same order from one node to the next, thus the variables are more likely to "share the glory". Best, Andy Fro

Re: [R] Gradient Boosting Trees with correlated predictors in gbm

2010-03-02 Thread Patrick Connolly
On Mon, 01-Mar-2010 at 12:01PM -0500, Max Kuhn wrote: |> In theory, the choice between two perfectly correlated predictors is |> random. Therefore, the importance should be "diluted" by half. |> However, this is implementation dependent. |> |> For example, run this: |> |> set.seed(1) |> n <-

Re: [R] Gradient Boosting Trees with correlated predictors in gbm

2010-03-01 Thread Max Kuhn
In theory, the choice between two perfectly correlated predictors is random. Therefore, the importance should be "diluted" by half. However, this is implementation dependent. For example, run this: set.seed(1) n <- 100 p <- 10 data <- as.data.frame(matrix(rnorm(n*(p-1)), nrow = n)) dat

[R] Gradient Boosting Trees with correlated predictors in gbm

2010-02-28 Thread Lars Bishop
Dear R users, I’m trying to understand how correlated predictors impact the Relative Importance measure in Stochastic Boosting Trees (J. Friedman). As Friedman described “ …with single decision trees (referring to Brieman’s CART algorithm), the relative importance measure is augmented by a strate

[R] gradient fill of a grid.polygon

2009-06-27 Thread baptiste auguie
Following up on my previous post. I've managed to have the function return a gList rather than plot everything directly, but I get a rather obscure error message when I try to wrap the grobs in a gTree with a rotated viewport, Error in x$children[[i]] : attempt to select less than one element ho

[R] gradient fill of a grid.polygon

2009-06-26 Thread baptiste auguie
Dear list, Following a recent enquiry, I've been playing with the idea of creating a colour gradient for a polygon, using the Grid package. The idea is to draw a number of stripes of different colours, using the grid.clip function. Below is my current attempt at this, library(grid) rotate.polyg

Re: [R] Gradient function for optim.

2009-03-02 Thread rkevinburton
Thank you. I saw the source. But I am not sure how to get from .Internal(optim(...)) to fmingr. Kevin Katharine Mullen wrote: > see the fmingr function in src/main/optim.c > (https://svn.r-project.org/R/trunk/src/main/optim.c) > > On Wed, 25 Feb 2009 rkevinbur...@charter.net wrote: > >

Re: [R] Gradient function for optim.

2009-02-25 Thread Katharine Mullen
see the fmingr function in src/main/optim.c (https://svn.r-project.org/R/trunk/src/main/optim.c) On Wed, 25 Feb 2009 rkevinbur...@charter.net wrote: > I have read that when the gradient function is not supplied (is null) > then first order differencing is used to find the differential. I was > tr

[R] Gradient function for optim.

2009-02-25 Thread rkevinburton
I have read that when the gradient function is not supplied (is null) then first order differencing is used to find the differential. I was trying to track down this for my own information but I run into .Internal(optim.). I was not sure where to look next to see the function that is automat

Re: [R] gradient and Hessian from lmer2

2007-10-29 Thread Abdus Sattar
Dear R-user: Could you please tell me how to extract gradient and Hessian from the following example model of lmer2 package? (fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)) I would really appreciate your kind help. Best, Sattar