Re: [R] rJava garbage collect

2018-02-06 Thread Benjamin Tyner
Hi Martin, Thanks for providing the reference. In this particular case, it helped me to discover that 13 JVM threads were garbage collecting in parallel, occasionally resulting in a race condition. Setting     options(java.parameters = "-XS:ParallelGCThreads=1") appears to resolve the issue

Re: [R] rJava garbage collect

2018-02-06 Thread Benjamin Tyner
Thanks Jeff; indeed it works:    .jcall("java/lang/System", method = "gc") On 02/05/2018 11:53 PM, Jeff Newmiller wrote: rJava offers a mechanism to call arbitrary methods in Java. Wouldn't you use that mechanism to call whatever you would call if you were programming in Java (e.g. System.gc

[R] Revolutions blog: January 2018 roundup

2018-02-06 Thread David Smith (CDA) via R-help
Since 2008, Microsoft (formerly Revolution Analytics) staff and guests have written about R at the Revolutions blog (http://blog.revolutionanalytics.com) and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you missed them, here

Re: [R] question with integrate function

2018-02-06 Thread li li
Oh ok. Thanks very much. I will have to restrict to a shorter interval. Hanna 2018-02-06 14:33 GMT-05:00 Göran Broström : > Hi Hanna, > > your function is essentially zero outside a short interval around 9. And > the help page states: "If the function is approximately constant (in > particula

Re: [R] question with integrate function

2018-02-06 Thread Göran Broström
Hi Hanna, your function is essentially zero outside a short interval around 9. And the help page states: "If the function is approximately constant (in particular, zero) over nearly all its range it is possible that the result and error estimate may be seriously wrong." You could try to inte

Re: [R] question with integrate function

2018-02-06 Thread li li
Sorry. I meant in the previous email that the function h() is a monotone decreasing function. Thanks very much. 2018-02-06 13:32 GMT-05:00 li li : > Hi all, > The function h below is a function of c and it should be a monotone > increasing function since the integrand is nonnegative and integra

[R] question with integrate function

2018-02-06 Thread li li
Hi all, The function h below is a function of c and it should be a monotone increasing function since the integrand is nonnegative and integral is taken from c to infinity. However, as we can see from the plot, it is not shown to be monotone. Something wrong with the usage of integrate function?

Re: [R] Aggregate behaviour inconsistent (?) when FUN=table

2018-02-06 Thread Alain Guillet
Thank you for your response. Note that with R 3.4.3, I get the same result with simplify=TRUE or simplify=FALSE. My problem was the behaviour was different if I define my columns as character or as numeric but for now some minutes I discovered there also is a stringsAsFactors option in the fun

Re: [R] Aggregate behaviour inconsistent (?) when FUN=table

2018-02-06 Thread William Dunlap via R-help
Don't use aggregate's simplify=TRUE when FUN() produces return values of various dimensions. In your case, the shape of table(subset)'s return value depends on the number of levels in the factor 'subset'. If you make B a factor before splitting it by C, each split will have the same number of leve

Re: [R] Aggregate behaviour inconsistent (?) when FUN=table

2018-02-06 Thread Jeff Newmiller
The normal input to a factory that builds cars is car parts. Feeding whole trucks into such a factory is likely to yield odd-looking results. Both aggregate and table do similar kinds of things, but yield differently constructed outputs. The output of the table function is not well-suited to be

Re: [R] gdistance::shortestPath throws error "not a symmetric matrix"

2018-02-06 Thread Jeff Newmiller
It is really hard to help you fix a function usage error if you don't show us how you used the function. [1][2][3] As for helping a customer by asking for help on the wrong list... you are not an expert on the topic, and are asking a group that might or might not know the theory behind your que

[R] gdistance::shortestPath throws error "not a symmetric matrix"

2018-02-06 Thread Loris Bennett
Hi, Calling gdistance::shortestPath gives me the error Error in asMethod(object) : not a symmetric matrix; consider forceSymmetric() or symmpart() The output of dput(.traceback()) is pairlist("stop(\"not a symmetric matrix; consider forceSymmetric() or symmpart()\")", "asMethod(

Re: [R] rJava garbage collect

2018-02-06 Thread Martin Møller Skarbiniks Pedersen
On 6 February 2018 at 04:34, Benjamin Tyner wrote: > Hi > > Does rJava offer a way to instruct the JVM to perform a garbage collection? Do you really, really need to run the garbage collector? Consider reading: https://stackoverflow.com/questions/5086800/java-garbage-collection Regards Martin

[R] Aggregate behaviour inconsistent (?) when FUN=table

2018-02-06 Thread Alain Guillet
Dear R users, When I use aggregate with table as FUN, I get what I would call a strange behaviour if it involves numerical vectors and one "level" of it is not present for every "levels" of the "by" variable: --- > df <- data.frame(A=c(1,1,1,1,0,0,0,0),B=c(1,0,1,0,0,