Re: [R] Fw: modified mankendal

2017-11-24 Thread Jim Lemon
Hi Elham, The error message: Error in if (S == 0) { : missing value where TRUE/FALSE needed means that for at least one S, the value is missing. The best advice I can give you is to load the data frame X1 as in your code above, and try something like: which.na<-function(x)

[R] number to volume weighted distribution

2017-11-24 Thread PIKAL Petr
Dear all Strictly speaking it is not R question but as you are the most capable persons I know I give it a try. I am strugling with recalculation of number weighted to volume weighted distribution. Suppose I have objects (cubes) with size x<- c(rep(10,20), rep(100, 10), rep(300,5)) I can get

Re: [R] number to volume weighted distribution

2017-11-24 Thread Duncan Murdoch
On 24/11/2017 6:27 AM, PIKAL Petr wrote: Dear all Strictly speaking it is not R question but as you are the most capable persons I know I give it a try. I am strugling with recalculation of number weighted to volume weighted distribution. Suppose I have objects (cubes) with size x<-

[R] Using bartMachine with the caret package

2017-11-24 Thread Patrick Connolly
Dave Langer in this video https://www.youtube.com/watch?v=z8PRU46I3NY uses the titanic data as an example of using caret to create xgbTree models. The caret train() function has a tuneGrid parameter which takes a list set up like so: tune.grid <- expand.grid(eta = c(0.05, 0.075, 0.1),

Re: [R] installing "rgl" package

2017-11-24 Thread Duncan Murdoch
On 24/11/2017 2:30 PM, Santosh wrote: Hi All, Duncan, Rolf, Ista, DIrk, Thanks for the suggestions and I tried all of them (as suggested by Duncan, Rolf, Ista and Dirk)... I still get similar error as before while installing 'rgl' package.. I also tried to manually configure "rgl" and got an

Re: [R] Multiple sets of proportion tests

2017-11-24 Thread Thierry Onkelinx
Hi anonymous, ?prop.test states that it returns a list. And one of the element is 'p.value'. str() on the output of prop.test() reveals that too. So prop.test()$p.value or prop.test()["p.value"] should work. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid /

Re: [R] installing "rgl" package

2017-11-24 Thread Santosh
Hi All, Duncan, Rolf, Ista, DIrk, Thanks for the suggestions and I tried all of them (as suggested by Duncan, Rolf, Ista and Dirk)... I still get similar error as before while installing 'rgl' package.. I also tried to manually configure "rgl" and got an error message (please see below for the

Re: [R] number to volume weighted distribution

2017-11-24 Thread Thierry Onkelinx
Hi Petr, I think that Duncan suggests something like this: x<- c(rep(10,20), rep(300,5), rep(100, 10)) tx <- table(x) prop.x <- tx / sum(tx) vx <- as.integer(names(tx)) prop.wx <- tx * vx / sum(tx * vx) plot(ecdf(x)) plot(vx, cumsum(prop.x), ylim = 0:1) plot(vx, cumsum(prop.wx), ylim = 0:1)

Re: [R] installing "rgl" package

2017-11-24 Thread Dirk Eddelbuettel
On 23 November 2017 at 15:05, Santosh wrote: | I am trying to install 'rgl' package in Ubuntu.. Would highly appreciate | your assistance .. I tried several leads available on various discussion | fora and nothing helped so far. Install the _pre-built binary package_ via sudo apt install

Re: [R] libPaths displays truncated path?

2017-11-24 Thread Loris Bennett
peter dalgaard writes: [snip (40 lines)] >> I don't quite understand the point about cause and effect. If >> normalizePath changes the symbolic link from >> >> /cm/shared/apps/R/site-library/3.4.2 >> >> to the actual directory >> >> /cm/shared/apps/R/site-library/3.4 >>

Re: [R] installing "rgl" package

2017-11-24 Thread Ista Zahn
On Nov 23, 2017 6:16 PM, "Duncan Murdoch" wrote: On 23/11/2017 6:05 PM, Santosh wrote: > Hi Rxperts, > I am trying to install 'rgl' package in Ubuntu.. Would highly appreciate > your assistance .. I tried several leads available on various discussion > fora and nothing

Re: [R] number to volume weighted distribution

2017-11-24 Thread PIKAL Petr
Hi Duncan I tried Ecdf and/or wtd.quantile from Hmisc and it is working (probably). Ecdf(x, q=.5) Ecdf(x, weights=xw,col=2, add=T, q=.5) wtd.quantile(x) 0% 25% 50% 75% 100% 10 10 10 100 300 wtd.quantile(x, weights=xw, type="i/n") 0% 25% 50% 75% 100% 10.

Re: [R] installing "rgl" package

2017-11-24 Thread Duncan Murdoch
On 24/11/2017 5:24 PM, Santosh wrote: Hi Duncan, and others.. Yes, below are the search results. it is linked to mesa/libGL.so and is again point to libGL.so -> libGL.so.1.2.0 . However, I could not find libGL.so.1.2.0 or its source. Where is libGL.so.1.2.0 expected to be located? Mine was

Re: [R] installing "rgl" package

2017-11-24 Thread Dirk Eddelbuettel
On 24 November 2017 at 11:30, Santosh wrote: | Hi All, Duncan, Rolf, Ista, DIrk, | | Thanks for the suggestions and I tried all of them (as suggested by Duncan, | Rolf, Ista and Dirk)... I still get similar error as before while | installing 'rgl' package.. I also tried to manually configure

Re: [R] installing "rgl" package

2017-11-24 Thread Santosh
Hi Duncan, Thanks for the suggestions. How do I uninstall mesa related installations? Do I need to uninstall all of "mesa" or only the specific ones? Santosh On Fri, Nov 24, 2017 at 3:05 PM, Duncan Murdoch wrote: > On 24/11/2017 5:45 PM, Dirk Eddelbuettel wrote: > >>

Re: [R] installing "rgl" package

2017-11-24 Thread Santosh
Hi Duncan, and others.. Yes, below are the search results. it is linked to mesa/libGL.so and is again point to libGL.so -> libGL.so.1.2.0 . However, I could not find libGL.so.1.2.0 or its source. Where is libGL.so.1.2.0 expected to be located? /usr/lib/libGL.so.1

Re: [R] installing "rgl" package

2017-11-24 Thread Santosh
Hi Duncan, Dirk, & Others, Mine has also like this... /usr/lib/x86_64-linux-gnu/libGL.so -> mesa/libGL.so -> libGL.so.1.2.0 however, I could not find the source of libGL.so.1.2.0 Dirk, I just now saw your response... Yes, r-cran-rgl and ibgl1-mesa-glx

Re: [R] installing "rgl" package

2017-11-24 Thread Duncan Murdoch
On 24/11/2017 5:45 PM, Dirk Eddelbuettel wrote: On 24 November 2017 at 11:30, Santosh wrote: | Hi All, Duncan, Rolf, Ista, DIrk, | | Thanks for the suggestions and I tried all of them (as suggested by Duncan, | Rolf, Ista and Dirk)... I still get similar error as before while | installing 'rgl'

[R] Cannot start OpenBUGS from R2WinBugs

2017-11-24 Thread Lubo Larsson
Hello, I'm running R version 3.4.2 on Windows. I have a program written in BUGS which I can successfully run from the R2WinBUGS package. I would also like to try and use the same package to use OpenBUGS (version 3.2.3) rather than WinBUGS. The initial output looks ok (shown below), but the