Re: [R] why the length and width of a plot region produced by the dev.new() function cannot be correctly set?

2018-05-03 Thread David Winsemius
> On May 3, 2018, at 6:28 PM, sunyeping via R-help wrote: > > When I check the size of the plot region usingdev.size("in")a new plot region > is produced and in the Rconsole I get[1] 5.33 5.322917 Your test is all mangleed together. You failed in your duty to read

[R] why the length and width of a plot region produced by the dev.new() function cannot be correctly set?

2018-05-03 Thread sunyeping via R-help
When I check the size of the plot region usingdev.size("in")a new plot region is produced and in the Rconsole I get[1] 5.33 5.322917If I mean to produce a plot region with size setting bydev.new(length=3,width=3)a plot region is produced, but the size is [2.281250, 5.322917], as detected by

Re: [R] adding overall constraint in optim()

2018-05-03 Thread Joshua Ulrich
On Thu, May 3, 2018 at 2:03 PM, Michael Ashton wrote: > Thanks Bert. But everyone on that forum wants to use finance tools rather > than general optimization stuff! And I am not optimizing a traditional > Markowitz mean-variance problem. Plus, smarter people

Re: [R] Converting a list to a data frame

2018-05-03 Thread William Dunlap via R-help
If you require that the 'type' column be a factor with a level for each element of the input list, then you need to do that after calling dplyr::bind_rows(), just as with the base-R solutions. > l <- list( A = data.frame(X=1:2, Y=11:12), B = data.frame(X=integer(), Y=integer()), C =

Re: [R] adding overall constraint in optim()

2018-05-03 Thread John C. Nash
This looks like what I call a sumscale problem i.e., some sort of simple function of the parameters sums to a constant. I've done some work on these, but don't have it with me just now. There are several approaches, but they can be quite tricky. Will send some info in about a week or so if you are

Re: [R] adding overall constraint in optim()

2018-05-03 Thread David Winsemius
> On May 3, 2018, at 10:52 AM, Michael Ashton > wrote: > > Hi – > > This is giving me a headache. I’m trying to do a relatively simple > optimization – actually trying to approximate the output from the Excel > Solver function but at roughly 1000x the

Re: [R] adding overall constraint in optim()

2018-05-03 Thread Michael Ashton
Thanks Bert. But everyone on that forum wants to use finance tools rather than general optimization stuff! And I am not optimizing a traditional Markowitz mean-variance problem. Plus, smarter people here. :-) > On May 3, 2018, at 3:01 PM, Bert Gunter wrote: > > You

Re: [R] adding overall constraint in optim()

2018-05-03 Thread Bert Gunter
You can't -- at least as I read the docs for ?optim (but I'm pretty ignorant about this, so maybe there's a way to tweak it so you can). See here: https://cran.r-project.org/web/views/Optimization.html for other R optimization capabilities. Also, given your credentials, the r-sig-finance

Re: [R] MCMCglmm - metric of the estimates

2018-05-03 Thread Bert Gunter
The r-sig-mixed-models list would be a better place for this post if you do not get an answer here. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

[R] MCMCglmm - metric of the estimates

2018-05-03 Thread Petr Palíšek
Hi, my question is probably amateurish but I can't seem to find the answer anywhere. In what metric are the MCMCglmm package's posterior means for family = "categorical"? I suppose that they can't be odds ratios and probabilites as my numbers are outside their bounds. So I'm thinking – are they

Re: [R] Converting a list to a data frame

2018-05-03 Thread Kevin E. Thorpe
On 05/03/2018 01:28 PM, Hadley Wickham wrote: On Wed, May 2, 2018 at 11:53 AM, Jeff Newmiller wrote: Another approach: library(tidyr) L <- list( A = data.frame( x=1:2, y=3:4 ) , B = data.frame( x=5:6, y=7:8 ) ) D <- data.frame( Type =

[R] adding overall constraint in optim()

2018-05-03 Thread Michael Ashton
Hi – This is giving me a headache. I’m trying to do a relatively simple optimization – actually trying to approximate the output from the Excel Solver function but at roughly 1000x the speed.  The optimization parameters look like this. The only trouble is that I want to add a constraint

Re: [R] Converting a list to a data frame

2018-05-03 Thread Hadley Wickham
On Wed, May 2, 2018 at 11:53 AM, Jeff Newmiller wrote: > Another approach: > > > library(tidyr) > L <- list( A = data.frame( x=1:2, y=3:4 ) > , B = data.frame( x=5:6, y=7:8 ) > ) > D <- data.frame( Type = names( L ) >,

Re: [R] Converting a list to a data frame

2018-05-03 Thread David Winsemius
> On May 2, 2018, at 2:43 PM, David L Carlson wrote: > > Typo: dat[[z]] should be x[[z]]: > > x2 <- do.call(rbind, lapply(names(x), function(z) > data.frame(type=z, x[[z]]))) > x2 > type x y > 1A 1 3 > 2A 2 4 > 3B 5 7 > 4B 6 8 Sometimes one want to

Re: [R] Calling the curve function with a character object converted into an expression

2018-05-03 Thread Sebastien Bihorel
Thanks, I always get confused by expression evaluation, when and how to use call, do.call, eval, parse/deparse, and all that good stuff. I always have to read documentation 10 times and still does not want to stick in my brain. - Original Message - From: "Bert Gunter"

Re: [R] The stages of standard function evaluation

2018-05-03 Thread Duncan Murdoch
First of all, your message is a little hard to read because you posted in HTML. This list removes the HTML, and often mangles messages, so you should always post in plain text. But in this case your message was still pretty readable. On 02/05/2018 11:04 PM, Andrew Hoerner wrote: Dear R

Re: [R] Converting a list to a data frame

2018-05-03 Thread Kevin E. Thorpe
On 05/03/2018 03:59 AM, Martin Maechler wrote: David L Carlson on Wed, 2 May 2018 21:43:52 + writes: Typo: dat[[z]] should be x[[z]]: x2 <- do.call(rbind, lapply(names(x), function(z) data.frame(type=z, x[[z]]))) x2 type x y 1A

[R] GA/SWARM Hyperparameter (HP) Optimisation for Classification based Machine Learning

2018-05-03 Thread Alexander Gracian via R-help
Hi, I believe that Caret uses a  grid-serach approach. I was wondering if: 1 There are more efficient implementations for HP tuning for classification algos (eg XGboost, CatBoost, SVM, RF etc), using say GM/SWARM approaches, akin to Google's approach AutoML for Image related Net problems? 2 This

Re: [ESS] ess-insert-function-outline

2018-05-03 Thread Patrick Connolly
G'day Alex, On Wed, 02-May-2018 at 09:19AM -0500, Alex Branham wrote: [...] |> |> It looks like ess-insert-function-outline was retired to the old/ |> directory, so it isn't defined in newer ESS versions. What could be the thinking behind that? The outline file is still there in the etc/

Re: [R] Package for Molecular Properties

2018-05-03 Thread Spencer Graves
library(sos) (mp <- findFn('{molecular properties}'))   ** found 7 matches in 4 packages and opened two web pages in my default browser with (a) the 7 matches and (b) the 4 packages. The first function was something for amino acids, like you suggested.  Two others returned compound

Re: [R] Converting a list to a data frame

2018-05-03 Thread Martin Maechler
> David L Carlson > on Wed, 2 May 2018 21:43:52 + writes: > Typo: dat[[z]] should be x[[z]]: > > x2 <- do.call(rbind, lapply(names(x), function(z) > data.frame(type=z, x[[z]]))) > x2 > type x y > 1A 1 3 > 2A 2 4 > 3B

[R] Package for Molecular Properties

2018-05-03 Thread bbb_aaa
All Is there a package or library that will, given a nucleotide sequence 1. calculate the extinction coefficient at 260 nm for (Beer-Lambert's law) 2. calculate molecular weight 3. return it's complementary sequence I was able to find several packages that can do similar calculations for an

Re: [R] Converting a list to a data frame

2018-05-03 Thread Tóth Dénes
On 05/03/2018 07:58 AM, Jeff Newmiller wrote: This is very nice to learn about, Denis, but it seems only fair to point out that the result of rbindlist is not a data frame. You can convert it to a data frame easily, but the copy and indexing semantics of data tables are quite different than

Re: [R] Calling the curve function with a character object converted into an expression

2018-05-03 Thread Bert Gunter
Typo: should be NULL not NUL of course An alternative approach closer to your original attempt is to use do.call() to explicitly evaluate the expr argument: w <- "1 + x^2" do.call(curve, list(expr = parse(text = w), ylab ="y")) Cheers, Bert Bert Gunter "The trouble with having an open mind is