Re: [R] Scaling Matrix in qda() function in MASS package

2017-08-24 Thread William Dunlap via R-help
If you multiply the data for a certain group by the scaling matrix for that group, the variance matrix will be the identity. E.g., > z <- qda(iris[-5], grouping=iris$Species) > zapsmall(var( as.matrix(subset(iris, Species=="virginica", 1:4)) %*% z$scaling[,,"virginica"] )) 1 2 3 4 1 1 0 0 0 2

Re: [R] rmutil parameters for Pareto distribution

2017-08-24 Thread Jeff Newmiller
You found that not all deviates are larger than m. Comparing the formulas quoted in Wikipedia and in your email it is obvious that m is not the same as x_m. If you don't find the rmutil formulation useful you can try another such as the one in PtProcess, or write your own. -- Sent from my

Re: [R] functions from 'base' package are not accessible

2017-08-24 Thread Hadley Wickham
This was a change in tidyr 0.7.0 that is causing a lot of confusion, so we are preparing tidyr 0.7.1 which will back this change out. If you want a work around in the meantime, you can express your operation a bit more elegantly as: library(tidyr) df <- data.frame(v1 = 1:5, somestring = 6:10,

Re: [R] Scaling Matrix in qda() function in MASS package

2017-08-24 Thread Ranjan Maitra
I guess the question that is being asked here is what is the scaling matrix that is being returned in the qda object. The help file on qda() says: ... scaling: for each group ‘i’, ‘scaling[,,i]’ is an array which transforms observations so that within-groups covariance matrix is spherical. ...

[R] rmutil parameters for Pareto distribution

2017-08-24 Thread Justin Thong
In https://en.wikipedia.org/wiki/Pareto_distribution, it is clear what the parameters are for the pareto distribution: *xmin *the scale parameter and *a* the shape parameter. I am using rmutil to generate random deviates from a pareto distribution. It says in the documentation that the probabilty

Re: [R] Flummoxed by gsub().

2017-08-24 Thread David Winsemius
> On Aug 24, 2017, at 10:20 AM, David Winsemius wrote: > > >> On Aug 23, 2017, at 2:29 AM, Rolf Turner wrote: >> >> >> On 23/08/17 18:33, Stefan Evert wrote: >> On 23 Aug 2017, at 07:45, Rolf Turner wrote:

Re: [R] functions from 'base' package are not accessible

2017-08-24 Thread William Dunlap via R-help
Or perhaps two exclamation points would be better ('unquote' in the tidyverse lexicon, 3 bangs is 'unquote-splice'). Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Aug 24, 2017 at 10:20 AM, William Dunlap wrote: > Try putting !!! (three exclamation symbols) in front of

Re: [R] functions from 'base' package are not accessible

2017-08-24 Thread Jeff Newmiller
Looks like a bug to me. I think you need to correspond with the package (tidyr?) maintainer, perhaps by putting a bug report on GitHub. Next time please make your example reproducible by including the necessary "library" function calls. -- Sent from my phone. Please excuse my brevity. On

Re: [R] functions from 'base' package are not accessible

2017-08-24 Thread William Dunlap via R-help
Try putting !!! (three exclamation symbols) in front of which(...)== The non-standard evaluation in the tidyverse can cause confusion. Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Aug 24, 2017 at 4:32 AM, Eugeny Melamud < eugeny.mela...@lanit-tercom.com> wrote: > Hi all! > > The

Re: [R] Flummoxed by gsub().

2017-08-24 Thread David Winsemius
> On Aug 23, 2017, at 2:29 AM, Rolf Turner wrote: > > > On 23/08/17 18:33, Stefan Evert wrote: > >>> On 23 Aug 2017, at 07:45, Rolf Turner wrote: >>> >>> My reading of ?regex led me to believe that >>> >>>gsub("[:alpha:]","",x) >>> >>>

Re: [R] Pull data from Tally 9.1 to R studio

2017-08-24 Thread Marc Schwartz
Hi, Inline below. > On Aug 24, 2017, at 5:22 AM, John Kane via R-help > wrote: > > > IIt might help to read the material at one or both of these links > http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example > In this case, had Jagan

Re: [R] cross validation in random forest using rfcv functin

2017-08-24 Thread David Winsemius
> On Aug 23, 2017, at 10:59 AM, Elahe chalabi via R-help > wrote: > > Any responds?! When I look at the original post a I see a question about a function named `rfcv` but do not see a `library` call to load such a function. I also see a reference to a help page or

Re: [R] functions from 'base' package are not accessible

2017-08-24 Thread Bert Gunter
Inline. -- Bert On Thu, Aug 24, 2017 at 4:32 AM, Eugeny Melamud wrote: > Hi all! > > The following code (executed in console)... > somevar <- data.frame(v1 = 1:5, somestring = 6:10, v3 = 11:15, v4 = > 16:20); > somevar %>% gather(key = var, value =

[R] functions from 'base' package are not accessible

2017-08-24 Thread Eugeny Melamud
Hi all! The following code (executed in console)... somevar <- data.frame(v1 = 1:5, somestring = 6:10, v3 = 11:15, v4 = 16:20); somevar %>% gather(key = var, value = val, which(names(somevar) == "somestring"):length(somevar)) %>% head(2); throws... Error in which(names(somevar) ==

Re: [R] Pull data from Tally 9.1 to R studio

2017-08-24 Thread John Kane via R-help
IIt might help to read the material at one or both of these links http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example Reproducibility · Advanced R. | | | | Reproducibility · Advanced R. | | | On Thursday, August 24, 2017, 6:19:25 AM EDT, John

Re: [R] Pull data from Tally 9.1 to R studio

2017-08-24 Thread John Kane via R-help
On Thursday, August 24, 2017, 1:50:13 AM EDT, David Winsemius wrote: > On Aug 22, 2017, at 11:31 PM, jagan krishnan via R-help > wrote: > > Hi all, > This is Jagan.i have been provided a task of analyzing sales data of a > company in R

Re: [R] strange nlme augpred behaviour

2017-08-24 Thread David Winsemius
> On Aug 23, 2017, at 8:08 AM, PIKAL Petr wrote: > > Hi > > Well, yes I tried it about two weeks ago but my post did not get through as > it still awaits moderator approval. It got through just fine. It appeared on Aug 15. It just didn't get any replies. As I read

Re: [R] Getting all possible combinations

2017-08-24 Thread peter dalgaard
> On 24 Aug 2017, at 11:58 , peter dalgaard wrote: > > M <- as.matrix(do.call(expand.grid, rep(list(0:1),5))) > M > # This is just 0:31 encoded as (little-endian) binary > apply(M, 1, function(i) sum((2^(0:4))[i])) > > # now, use rows of M for logical indexing into "A"-"E" >

Re: [R] Getting all possible combinations

2017-08-24 Thread peter dalgaard
> On 24 Aug 2017, at 11:58 , peter dalgaard wrote: > > apply(M, 1, function(i) sum((2^(0:4))[i])) -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Office: A 4.23 Email:

Re: [R] Getting all possible combinations

2017-08-24 Thread peter dalgaard
> On 24 Aug 2017, at 01:25 , Duncan Murdoch wrote: > > On 23/08/2017 6:25 PM, Bert Gunter wrote: >> Doesn't sort by size of subgroup. I interpret the phrase I asterisked as: > > You were fooled by Peter's tricky single negative. > ... Let's do this more carefully,

Re: [R] boot.stepAIC fails with computed formula

2017-08-24 Thread Stephen O'hagan
OK, I will try that. I notified the maintainer of boot.stepAIC, so he might fix this in due course. Thanks, SGO. -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Heinz Tuechler Sent: 24 August 2017 00:07 To: r-help@r-project.org Subject: Re: [R]

[R] Problem in optimization of Gaussian Mixture model

2017-08-24 Thread niharika singhal
Hello, I am facing a problem with optimization in R from 2-3 weeks. I have some Gaussian mixtures parameters and I want to find the maximum in that *Parameters are in the form * mean1mean2mean3 sigma1 sigma2 sigma3 c1c2c3 506.8644 672.8448 829.902 61.02859

Re: [R] Comparing 2 dale columns

2017-08-24 Thread PIKAL Petr
Hm. I used the code from Mark's response and it works correctly. So you either messed the data or you do not tell us the whole story. data > dput(data) structure(list(COL1 = structure(c(16222, 16252), class = "Date"), COL2 = structure(c(16556, 16556), class = "Date"), Date_Flag = c(0,

Re: [R] Vibration signal prediction in R

2017-08-24 Thread Barry Rowlingson
On Thu, Aug 24, 2017 at 7:07 AM, David Winsemius wrote: > > > On Aug 23, 2017, at 10:06 PM, Dhivya Narayanasamy > wrote: > > > > I have a vibration signal coming accelerometer. I converted this signal > from* > > m/s^2* to *mm/s*. Now I am supposed

Re: [R] Vibration signal prediction in R

2017-08-24 Thread David Winsemius
> On Aug 23, 2017, at 10:06 PM, Dhivya Narayanasamy > wrote: > > I have a vibration signal coming accelerometer. I converted this signal from* > m/s^2* to *mm/s*. Now I am supposed to predict this vibration signal in R > using historical data. (Please see the attached