[Rd] Trouble in using rJava
Hello, I'm using rJava and JRI to call R scripts from my Java code, but my scripts are sometimes executed, and very often they don't run throwing a Java exception. I'm using a 2.7 version of R, with rJava 0.8.4 and Java Sun 1.6. Somebody can help me please ?? Thank you very much, Nabila __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Suggestion: Adding quick rowMin and rowMax functions to base package
See rowMins(), rowMaxs() and rowRanges() in matrixStats (on CRAN). The matrixStats package was created for the purpose of providing such row*/col*() methods. First the functionality is provided, then the methods are optimized for speed and memory, e.g. vectorizing, implementing in native code, and utilizing other fast existing functions. Some methods have already been optimized this way. When mature, these may be suggested to be part of the default R distribution. Benchmarking reports, and contributions of code and redundancy are welcome. Testing the code under many different conditions is critical, e.g. missing values or not, infinite values or not, zero, one or many columns/rows, ... /Henrik PS. The rowMaxs() etc does not utilize pmax(); didn't know of it. On Mon, Mar 29, 2010 at 9:34 PM, Sebastian Kranz wrote: > Hi, > > I wonder whether similarly to the very quick rowSums and colSums functions > in the base package, one could add quick functions that calculate the min or > max over rows / cols in a matrix. While apply(x,1,min) works, I found out by > profiling a program of mine that it is rather slow for matrices with a very > large number of rows. A quick functionality seems to be already there in the > functions pmax and pmin, but it is rather cumbersume to apply them to all > columns of a matrix (if one does not know how many columns the matrix has). > Below, I have some code that shows a very unelegant implementation that > illustrates possible speed gains if apply could be avoided: > > rowMin = function(x) { > # Construct a call pmin(x[,1],x[,2],...x[,NCOL(x)]) > code = paste("x[,",1:(NCOL(x)),"]",sep="",collapse=",") > code = paste("pmin(",code,")") > return(eval(parse(text=code))) > } > > # Speed comparison: Taking rowMin of a 1,000,000 x 10 matrix > x = matrix(rnorm(1e7),1e6,10) > > # The traditional apply method > y=apply(x,1,min) # Runtime ca. 12 seconds > > # My unelegant rowMin function > z=rowMin(x) # Runtime ca 0.5 seconds > > Of course, the way the function rowMin is constructed is highly ineffective > if the matrix x has many columns, but maybe there is a simple way to adapt > the code from pmin and pmax to create quick rowMin, rowMax,... functions. I > don't know whether it is worth the effort, but I guess taking minima and > maxima over rows is a common task. > > Best wishes, > Sebastian > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Trouble in using rJava
Hello, Please don't post in multiple mailing lists. (this does not improve your chances of getting an answer). I think the best mailing list for this question (although see below) is : http://mailman.rz.uni-augsburg.de/mailman/listinfo/stats-rosuda-devel Le 30/03/10 10:19, Nabila Salmi a écrit : Hello, I'm using rJava and JRI to call R scripts from my Java code, but my scripts are sometimes executed, and very often they don't run throwing a Java exception. I'm using a 2.7 version of R, with rJava 0.8.4 and Java Sun 1.6. Somebody can help me please ?? Thank you very much, Nabila Even if someone wants to help you, how would they ? Your question is very vague. R version 2.7 does not exist. If we assume you mean 2.7.2, this has been released in almost two years ago, in august 2008. In the meantime, these versions of R have been released : 2.8.0, 2.8.1, 2.9.0, 2.9.1, 2.9.2, 2.10.0. Can you try to use the current version of R and see if this fix your vague problem. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/OIXN : raster images and RImageJ |- http://tr.im/OcQe : Rcpp 0.7.7 `- http://tr.im/O1wO : highlight 0.1-5 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [rJava] Trouble in using rJava
Hello Nabilia. You should send at least the Java exception to the list. Some code is also welcome. Regards, Guido García On Tue, Mar 30, 2010 at 10:19 AM, Nabila Salmi < nabila.sa...@orange-ftgroup.com> wrote: > Hello, > > I'm using rJava and JRI to call R scripts from my Java code, but my scripts > are sometimes executed, and very often they don't run throwing a Java > exception. > I'm using a 2.7 version of R, with rJava 0.8.4 and Java Sun 1.6. > > Somebody can help me please ?? > > Thank you very much, > > Nabila > ___ > Rjava mailing list > rj...@lists.rforge.net > http://lists.rforge.net/mailman/listinfo/rjava > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Possible improvements/clarifications for R-forge (Was: Re: Using SVN + SSH on windows)
On 03/28/2010 07:28 PM, Christophe Genolini wrote: Wahou! I did not plan to start such a debate... It is really not hard to set it up. I am using a vanilla ssh (rather than putty) and that works fine all the time... The problem is not how hard or easy it is, the problem is how time consuming it is. I am pretty sur that I will manage to make it work. But when? I allready lose three hours Friday and two hour on saturday... That's definitly too much. Because I am not an engeneer in computing, I am a researcher. To make my research, I have to be expert in longitudinal data, in clustering, in anorexia, I have to speak english, I have to know R, and C, and package managing, and LaTeX, and gimp, and... and... and... There is so many things to know... I can not be expert in all. So I do not have time to (and I do not want to) explore all the ssh subtulties... Worse, I have a project, I manage to find some people that want to work on the projet (but that also have a lot of other staff to do), I do not want them to give up because it will take to much time for them to make ssh run. Generalier, I think that anything should be done to make tools easy to use for non-expert, because more and more R user are occasional user. They are not experts, they don't want to become expert. They are just feed up to pay a lot of money for SPSS or Stata... But I guess this is another debate. As far as R-Forge is concerned, developers don't need to know how SSH works. Only the SVN client needs to be aware of it. One can always use passwords, private/public key authentication is not necessary here. Entering passwords multiple times is the only drawback of the keyless approach. I think question 5 is answered. Now, an attempt to answer the other questions: Christophe I wonder why nobody included the R-forge maintainer in this thread so far. Let me add Stefan now. Best wishes, Uwe On 28.03.2010 18:34, Henrik Bengtsson wrote: Hi, first, r-forge.r-project.org is filling a need and provides a great service to the community. Please read this thread as sincere feedback for making it even better, not as a complaint. I fully understand that r-forge is ran by limited resources and on a volunteer basis. I'll list some points about r-forge that I think could be improved/clarified. Not expecting anything, just sharing my experience. 1. Part of the R-forge services runs on a schedule, e.g. building and checking packages. As a user you do not really know when this happens. Some of this is documented at http://site.r-forge.r-project.org/, but not everything, e.g. as seen in another message on r-devel, the cron job for updating SSH keys is not specified. Moreover, all static documentation tends to become outdated. In other words, as a user I am not certain that http://site.r-forge.r-project.org/ is up to date. Providing some kind of online log of what the r-forge servers are doing would help the user to plan, troubleshoot etc. Right now there are too many degrees of freedom to figure out what and when things happens. The Bioconductor project provides a small log summary/status with timestamps of the last run, cf. small box at the top of http://bioconductor.org/checkResults/2.6/bioc-LATEST/. I have to admit, there may be documentation for some part of the R-Forge system missing. But a) Section 3.2. of the R-Forge manual actually specifies very clearly when the cron job for updating SSH keys is run (namely once every full hour), b) the schedule at http://site.r-forge.r-project.org/ is usually up-to-date and c) I'm open to work with you together on a fancy status report similar to the bioconductor project. 2. It is not possible to check the R CMD build/check log files for other people's packages. The log files are considered private to the project members. This means that I cannot troubleshoot other packages part of projects that I am not a member. This limits my chances to troubleshoot problems I have when my package depends on an external package. It also limits my chances to contribute with troubleshooting/bug reports for other packages. This is one of the features that makes the Bioconductor repository a success. Making these log files public would improve lots of things. This was based on historic reasons. It seems indeed reasonable to drop this limitation. From now on, only the "Submit to CRAN button" is hidden from non-members of a project. 3. For some OSes, the log files for the build and check of packages are missing. For instance, none of my packages has log files for Linux x86_32, e.g. "Logfile for R.batch not available.". It is not clear if this is because I made something wrong, or this is the flavor of the day, or a permanent error. (I looks permanent for "Linux x86_32", but not sure about the others). This is because the 32bit system has been replaced and is not set up correctly yet. I hope we can fix this soon. Being able to access the r-forge server logs, si
[Rd] hist.default()$density
Dear developers, the current implementation of hist.default() calculates 'density' (and 'intensities') as dens <- counts/(n*h) where h has been calculated before as h <- diff(fuzzybreaks) which results in 'fuzzy' values for the density, see e.g. > tmp <- hist(1:10,breaks=c(-2.5,2.5,7.5,12.5),plot=FALSE) > print(tmp$density,digits=15) [1] 0.03992016 0.1000 0.0600 Since hist.default()$breaks are not the fuzzy breaks used for the calculation of dens, the sum of the bins' area is significantly different from 1 in many cases, see e.g. > print(sum(tmp$density*diff(tmp$breaks)),digits=15) [1] 0.9996008 Is this intended, or should the calculation of dens read dens <- counts/(n*diff(breaks)) instead (or should hist.default()$breaks return the fuzzy breaks)? Best wishes Martin -- Dr. Martin Becker Statistics and Econometrics Saarland University Campus C3 1, Room 206 66123 Saarbruecken Germany __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel