Re: [R] Arranging ggplot2 objects with ggplotGrob()

2020-07-26 Thread H
On 07/25/2020 03:05 PM, H wrote: > On 07/25/2020 03:01 PM, Rui Barradas wrote: >> Hello, >> >> OK, now it's reproducible, thanks. >> align = "hv" works like I had suggested. >> >> The full code is now >> >> library(ggplot2) >> library(cowplot) >> >> s <- ggplot(data = subset(iris, Species == 'virgi

Re: [R] A question about optim function in R

2020-07-26 Thread Rasmus Liland
Dear Zixuan, On 2020-07-26 07:36 -0700, Jeff Newmiller wrote: > On July 26, 2020 7:33:32 AM PDT, Zixuan Qi wrote: > > Hi, > > > > I encounter a problem in R. My program is as follows. > > lower <- c(-Inf, -Inf, -Inf, -Inf, 0, 0, 0, -1, -1, -1) > > upper <- c(Inf, Inf, Inf, Inf, Inf, Inf, Inf, 1,

Re: [R] A question about optim function in R

2020-07-26 Thread J C Nash
For this and the nlminb posting, a reproducible example would be useful. The optimx package (I am maintainer) would make your life easier in that it wraps nlminb and optim() and other solvers, so you can use a consistent call. Also you can compare several methods with opm(), but do NOT use this fo

Re: [R] One year return not year to date

2020-07-26 Thread Rasmus Liland
Hello, On 2020-07-25 20:05 +0100, Rui Barradas wrote: > Às 19:06 de 25/07/2020, Bert Gunter escreveu: > > On Sat, Jul 25, 2020 at 8:41 AM Pedro páramo wrote: > > > Hi all, > > > > > > I want to calculate interanual > > > (not year to date) variation of a > > > stock, I am able to obtain year t

Re: [R] [External] Re: help with web scraping

2020-07-26 Thread Rasmus Liland
Dear William Michels, On 2020-07-25 10:58 -0700, William Michels wrote: > > Dear Spencer Graves (and Rasmus Liland), > > I've had some luck just using gsub() > to alter the offending "" > characters, appending a "___" tag at > each instance of "" (first I > checked the text to make sure it

Re: [R] [External] Re: help with web scraping

2020-07-26 Thread Rasmus Liland
Dear GRAVES et al., On 2020-07-25 12:43 -0500, Spencer Graves wrote: > Dear Rasmus Liland et al.: > > On 2020-07-25 11:30, Rasmus Liland wrote: > > On 2020-07-25 09:56 -0500, Spencer Graves wrote: > > > Dear Rasmus et al.: > > > > It is LILAND et al., is it not? ... else it's customary to > > p

[R] A question about nlminb function

2020-07-26 Thread Zixuan Qi
Hi, I use the function nlminb to maximize a function and got convergence with the message false-convergence. I know the reason may be the gradient $B"`(Bf(x) may be computed incorrectly, the other stopping tolerances may be too tight, or either f or $B"`(Bf may be discontinuous near the cur

Re: [R] A question about optim function in R

2020-07-26 Thread Jeff Newmiller
This is not reproducible. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example [2] http://adv-r.had.co.nz/Reproducibility.html [3] https://cran.r-project.org/web/packages/reprex/index.html (read the vignette) On July 26, 2020 7:33:32 AM PDT, Zixuan Qi w

[R] A question about optim function in R

2020-07-26 Thread Zixuan Qi
Hi, I encounter a problem in R. My program is as follows. lower <- c(-Inf,-Inf,-Inf,-Inf,0,0,0,-1,-1,-1) upper <- c(Inf,Inf,Inf,Inf,Inf,Inf,Inf,1,1,1) out <- optim(parm,logLik,method='L-BFGS-B',lower=lower,upper=upper,hessian=hessian) As you can see, I have restricted parameter[5], parameter[6]