Re: [R] ggplot 3-color gradient scales

2020-08-23 Thread Rui Barradas
Hello, Note that the midpoint argument can make a big difference. In the code below try commenting out the line where the default is changed. f <- function(x){ (x - min(x))/(max(x) - min(x)) } library(ggplot2) df1 <- iris[3:5] names(df1)[1:2] <- c("x", "y") df1$z <- ave(df1$y,

Re: [R] ggplot 3-color gradient scales

2020-08-23 Thread Jeff Newmiller
Check out scale_colour_gradient2() On August 23, 2020 8:12:06 PM PDT, April Ettington wrote: >Currently I am using these settings in ggplot to make a gradient from >red >to blue. > >geom_point( aes(x, y, color=z) ) + >scale_colour_gradient(low = "red",high = "blue") + > >z is a ratio, and

[R] ggplot 3-color gradient scales

2020-08-23 Thread April Ettington
Currently I am using these settings in ggplot to make a gradient from red to blue. geom_point( aes(x, y, color=z) ) + scale_colour_gradient(low = "red",high = "blue") + z is a ratio, and currently I am able to identify which have high and low values, but I'd really like to be able to distinguish

Re: [R] plot.window: need finite 'ylim' values

2020-08-23 Thread Jim Lemon
Hi Mike, This looks to me as though the error is not being generated by plot, but by a method specific to the package, maybe something with a name like plot.chart_Series, that is barfing on a vector of NA values. Jim On Mon, Aug 24, 2020 at 1:01 AM Mike wrote: > > Hi Jim, > > on 21.08. you

Re: [R] plot.window: need finite 'ylim' values

2020-08-23 Thread David Winsemius
You are using a function whose help page says it is "highly experimental". In such cases it is probably better to contact the package maintainer with a feature request. The DESCRIPTION file says contact should be through one of http://www.quantmod.com https://github.com/joshuaulrich/quantmod

Re: [R] plot.window: need finite 'ylim' values

2020-08-23 Thread Mike
Hi Jim, on 21.08. you wrote: > Try this: > > plot (chart_Series (sample.xts[,1], subset=subset, TA=ta), > type="n",ylim=c(minimum,maximum)) > > where minimum and maximum are the extremes of the plot if there were > any valid values. I've set minimum <- 0 maximum <- 1 The error persists.

Re: [R] Export R outputs to SAS dataset

2020-08-23 Thread Jomy Jose
Hi Daniel Thanks,please find the code and output #R libraries- library(tidyverse) library(MF) MFSubj(lesion ~ group, calflung) HLBoot(lesion ~ group, calflung, compare = c("con", "vac"), b = 100, B = 100, alpha = 0.05, hpd = TRUE, bca = FALSE,

Re: [R] Error in optim with method L-BFGS-B when hessian is TRUE

2020-08-23 Thread Marc Girondot via R-help
Sorry... it is already stated in the help, at the hessian section: hessian Only if argument hessian is true. A symmetric matrix giving an estimate of the Hessian at the solution found. Note that this is the Hessian of the unconstrained problem even if the box constraints are active. So no

[R] Error in optim with method L-BFGS-B when hessian is TRUE

2020-08-23 Thread Marc Girondot via R-help
Dear members, I fought for several days against an error I was getting with optim in L-BFGS-B. The error was produced because some parameters were outside the limits defined by upper and lower. After investigation, the error is not produced during the optimization itself but during the