Re: [R] Linux R / Windows client
L.S. On 03/18/2012 02:39 PM, Mag Gam wrote: correct, but for StatET i believe I can only use the local R installed to do my computation. My intention is to use my Linux server -- which as 128GB of memory and 32 cores to do my calculations and I want to connect to it via Windows Eclipse GUI. That is perfectly possible. In summary you need to get the rj-consoleserver tarball from the StatET website, untar it (on the GNU/Linux machine) and edit the startup.sh script that is included. From your Windows client you then configure a so-called Remote R Console within Eclipse and point to the startup.sh file on the server. It is BTW possible to tunnel all traffic over SSH just by checking the appropriate box in the Remote Console run configuration. Help Help Contents StatET User Guide R Console Remote Console gives some more extensive explanations. Should you have further questions, don't hesitate to ask on the StatET mailing list. http://lists.r-forge.r-project.org/mailman/listinfo/statet-user Best wishes, Tobias On Sun, Mar 18, 2012 at 9:13 AM, jose Bartolomeisurfpr...@hotmail.com wrote: Hi, I do not understand why you want to do that but both Eclipse and StatEt are available for Linux environment. Then, you can have everything running on Linux http://www.eclipse.org/downloads/ http://www.walware.de/goto/statet Jose Date: Sun, 18 Mar 2012 08:56:39 -0400 From: magaw...@gmail.com To: r-help@r-project.org Subject: [R] Linux R / Windows client Hello, I am currently running R on ubuntu and everything is working perfectly fine. However, I would like to connect to R via Windows using Eclipse StatEt plugin. Is this possible to do? or do I have to have a version of R running on Windows also? I prefer to have Linux do the heavy lifting and Windows Eclipse to be a sort of GUI. Any thoughts? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Eclipse StatET - create own code formatting
Hi Syrvn, On 11/19/2011 03:08 PM, syrvn wrote: does anybody know whether it is possible to create its own code formatting rules? Defining rules under Eclipse - Preferences - R Code Formatting is so limited. There is a dedicated mailing list for StatET here http://lists.r-forge.r-project.org/mailman/listinfo/statet-user Maybe you can tell there what you are missing currently? Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Access R functions from web
Hi Caveman, On 06/25/2011 11:18 AM, Orvalho Augusto wrote: I need a way to send R objects and call R functions from web. Is there any project close or similar to that? I want to be able to send an HTTP rquest from an existing application with some data. And obtain a plot from R. This is one of the typical integration scenarios the R Service Bus is able to cope with. http://www.openanalytics.eu/r-service-bus The REST interface is documented here http://rsb.doc.openanalytics.eu/ http://rsb.doc.openanalytics.eu/wsdocs/index.html Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R licence
On 04/07/2011 04:46 PM, Ista Zahn wrote: I don't think R-help is the appropriate place for this question. Probably you will have more luck at http://www.theattorneysforum.com/ or some such. I would hope, though, there are means for community members to express their concerns in some medium of the community. Fortes fortuna iuvat! Best, Tobias On Thu, Apr 7, 2011 at 10:36 AM, Matthew Dowlemdo...@mdowle.plus.com wrote: Duncan, Letting you know then that I just don't see how the first paragraph here : http://www.revolutionanalytics.com/downloads/gpl-sources.php is compatible with clause 2(b) here : http://www.gnu.org/licenses/gpl-2.0.html Perhaps somebody could explain why it is? Matthew Duncan Murdochmurdoch.dun...@gmail.com wrote in message news:4d9da9ff.9020...@gmail.com... On 07/04/2011 7:47 AM, Matthew Dowle wrote: Peter, If the proprietary part of REvolution's product is ok, then surely Stanislav's suggestion is too. No? Revolution has said that they believe they follow the GPL, and they haven't been challenged on that. If you think that they don't, you could let an R copyright holder know what they're doing that's a license violation. My opinion of Stanislav's question is that he doesn't give enough information to answer. If he is planning to distribute R as part of his product, he needs to follow the GPL. If not, I don't think any R copyright holder has anything to complain about. Duncan Murdoch Matthew peter dalgaardpda...@gmail.comwrote in message news:be157cf5-9b4b-45a0-a7d4-363b774f1...@gmail.com... On Apr 7, 2011, at 09:45 , Stanislav Bek wrote: Hi, is it possible to use some statistic computing by R in proprietary software? Our software is written in c#, and we intend to use http://rdotnet.codeplex.com/ to get R work there. Especially we want to use loess function. You need to take legal advice to be certain, but offhand I would say that this kind of circumvention of the GPL is _not_ allowed. It all depends on whether the end product is a derivative work, in which case, the whole must be distributed under a GPL-compatible licence. The situation around GPL-incompatible plug-ins or plug-ins interfacing to R in GPL -incompatible software is legally murky, but using R as a subroutine library for proprietary code is clearly crossing the line, as far as I can tell. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Revolution Analytics reading SAS datasets
On 02/10/2011 07:44 PM, David Smith wrote: The SAS import/export feature of Revolution R Enterprise 4.2 isn't open-source, so we can't release it in open-source Revolution R Community, or to CRAN as we do with the ParallelR packages (foreach, doMC, etc.). It is, though, available for download free of charge to members of the academic community (as is all of Revolution Analytics' software) from http://www.revolutionanalytics.com/downloads/ timeo Danaos et dona ferentes On Wed, Feb 9, 2011 at 5:46 PM, Daniel Nordlunddjnordl...@frontier.com wrote: Has anyone heard whether Revolution Analytics is going to release this capability to the R community? http://www.businesswire.com/news/home/20110201005852/en/Revolution-Analytics-Unlocks-SAS-Data Dan Daniel Nordlund Bothell, WA USA VP of Marketing, Revolution Analytics http://blog.revolutionanalytics.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problem with xlsx package
On 02/10/2011 05:30 PM, Gabor Grothendieck wrote: On Thu, Feb 10, 2011 at 10:49 AM, Nikhil Joshinikhiljo...@gmail.com wrote: Gabor, thanks for the suggestion. I did as you have suggested- Started a clean session of R and set the java option. Then I sourced the library and tried to read the xlsx file but got the same error. I am assuming that Java machine is loaded when the package xlsx is sourced and not when the base package is sourced (or in other words upon starting a new R session). Or am I totally off? Regards Nikhil The JVM would be initialized when xlsx is loaded or when certain functions in the package are called depending on how the package was written so as long as you set the java.parameters option prior to issuing the library(xlsx) command you should be ok. If that does not work and assuming the number I suggested is big enough then it must be something else. You could try contacting the author to see if other users have experienced this. If you still can't get it to work there are a number of alternatives listed here: http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windows There is also this recent thread on rosuda-devel which might be of instructive: http://mailman.rz.uni-augsburg.de/pipermail/stats-rosuda-devel/2011q1/001621.html Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] rj packages and eclipse
Hi Sebastián, You can find the rj package here: http://www.walware.de/it/downloads/ and the installation instructions here: http://www.walware.de/it/statet/installation.mframe?jump=install-rj-rpkg If you have further questions, don't hesitate to join the StatET-specific mailing list at http://lists.r-forge.r-project.org/mailman/listinfo/statet-user or search its archives at http://lists.r-forge.r-project.org/mailman/swish.cgi?query=listname%3D%22statet-user%22 Best, Tobias On 01/31/2011 07:43 AM, Sebastián Daza wrote: Hi everyone! Does anyone know how to install the rj package in Windows (7)? I am trying to set up eclipse, but I got [INFO] The R package 'rj' is not available, R-StatET tools cannot be initialized. Thank you in advance! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R-/Text-editor for Windows?
Hi Sascha, On 01/28/2011 07:55 PM, Sascha Vieweg wrote: Tinn-R (http://www.sciviews.org/Tinn-R/) is one of the topmost suggestions when googling an R-(text-)editor for Windows. However, to me it appears dissappointing that Tinn-R does not handle utf-8 (mac-roman, or any other) encoded R-scripts or, in general, text files. Besides Emacs and the R built-in editor, could you recommend a good editor for Windows, even some commmercial for a small price? (For a comparison, TextMate for OS X is 35 USD and does a great job on all plain text and code related issues, not only R.) One of the platform independent ones is StatET: http://www.walware.de/goto/statet Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] using gsarima package with R
Hi Nandan, On 01/23/2011 08:52 PM, nandan amar wrote: I am trying to use function garsim from package gsarima. I can download gsarima package from http://cran.fyxm.net/web/packages/gsarima/index.html for linux. But how I can add it to R. I have compiled and installed R from its R source code under Ubuntu. $ sudo R install.packages(gsarima) # install at R command line library(gsarima) # load the package ?garsim # look a the help page of the function Hope this helps, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] using gsarima package with R
On 01/24/2011 05:05 AM, nandan amar wrote: Thanks a lot. I am getting following errors on, R CMD INSTALL gsarima_0.0-2.tar.gz (gsarima_0.0-2.tar.gz is in same directory where I am running R) Error: unexpected symbol in R CMD and install.pacakges('gsarima',dep=TRUE,clean=TRUE) Error: could not find function install.pacakges You spelled it incorrectly. Best, Tobias On 24 January 2011 03:10, Tobias Verbeke tobias.verb...@openanalytics.eu wrote: Hi Nandan, On 01/23/2011 08:52 PM, nandan amar wrote: I am trying to use function garsim from package gsarima. I can download gsarima package from http://cran.fyxm.net/web/packages/gsarima/index.html for linux. But how I can add it to R. I have compiled and installed R from its R source code under Ubuntu. $ sudo R install.packages(gsarima) # install at R command line library(gsarima) # load the package ?garsim # look a the help page of the function Hope this helps, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] editor for MacOS
On 12/16/2010 04:54 PM, Marc Schwartz wrote: On Dec 16, 2010, at 9:41 AM, Troels Ring wrote: Dear friends - I'm using Tinn-R in Windows and find it OK. My son is running MacOS and is just starting using R and I know nothing about MacOS and R but we seem to have difficulties in finding something similar to Tinn for MaC. What are your suggestions? Thanks a lot! Troels Ring, MD Aalborg, Denmark I have not used Tinn-R, so can't speak for specific functions. That being said, Emacs/ESS is perhaps the most conceptually similar environment. It is also portable across Windows, OSX and Linux, which can provide consistency advantages if supporting multiple platforms. As it is difficult to measure 'conceptual similarity', let me add another cross-platform option, namely Eclipse and its StatET plug-in http://www.walware.de/goto/statet Best, Tobias Vincent Goulet has made it easy to install for OSX with a binary image. More info here: http://vgoulet.act.ulaval.ca/en/ressources/emacs/mac He also has a Windows installer here: http://vgoulet.act.ulaval.ca/en/ressources/emacs/windows Further OSX specific queries are also best posted to: https://stat.ethz.ch/mailman/listinfo/r-sig-mac HTH, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] StatET: Connecting to a remote rterm instance
Dear WanderingWizard, On 12/02/2010 07:58 PM, WanderingWizard wrote: Is it possible to use Eclipse (StatET) to connect to an rterm instance running on another computer? Yes. You can launch, disconnect and reconnect to a remote R console. It looks like it should be easy, but when I select an R Engine it says Connection failed to: hostname everytime. Is there a guide somewhere? There is Eclipse Help available in the StatET User Guide (Help Help Contents StatET..) and additional information can be found (if needed) in the archives of the StatET user list http://lists.r-forge.r-project.org/mailman/listinfo/statet-user searchable here http://lists.r-forge.r-project.org/mailman/swish.cgi?query=listname%3D%22statet-user%22 Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R + Linux Ubuntu 10.10
Hi Maximilien, On 11/20/2010 01:51 PM, Maximilien Renard wrote: I've just installed Linux (K)Ubuntu 10.10 as well as R and I'm stuck with a very annoying problem. I've compiled the latest R version from the sources without any problem, sadly when I start R in a terminal, it does not behave as expected. In fact, I cannot use the arrow keys (up, down, left, right) because they are automatically replaced with things like ^[[A I have no idea if it R related or not but it is very annoying and I'd appreciate any help. You need to compile R with readline support (and for that libreadline-dev needs to be installed IIRC). Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] class matrix lost when extracting a row from matrix
On 09/19/2010 10:02 AM, h...@wiseadvice.eu wrote: Good morning experts! situation: class(myMatrix)=matrix class(myMatrix[(1:2),]))=matrix class(myMatrix[1,])= character consequences are far reaching as, for instance colnames(myMatrix[(1:2),]) != colnames(myMatrix[1,]) or names(myMatrix[(1:2),]) != names(myMatrix[1,]) My question: 1. How can the coercion to character be avoided and the attributes of the original object myMatrix of class matrix been preserved when slicing out one row of the matrix? 2. Is there a reason why there is a loss of generality in that sense that a matrix of dimension (1xn) is treated differently than a matrix of dimension (mxn); m,n1 ? in other words is there a reason why class vector is needed at all? m - matrix(1:4, 2) m[1,, drop = FALSE] # [,1] [,2] # [1,]13 m[, 1, drop = FALSE] # [,1] # [1,]1 # [2,]2 See ?Extract HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] split file equivalent in R
Hi, On 07/19/2010 11:56 AM, Iasonas Lamprianou wrote: (a)in SPSS PASW there is a 'split file' command is repeats the same analysis for all sub-groups. Is there a split file equivalent in R? There is a by command in base R, but for this type of problems Hadley Wickham has written a nice package 'plyr' available on CRAN. See also the package home page: http://had.co.nz/plyr/ HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Using Ubuntu as a Server
Hi Leandro, On 07/10/2010 08:46 PM, Leandro Marino wrote: I want to know how can I configure R in a Ubuntu to be a server. I am planning to use R in a Windows machine with Tinn-R, but I want R running at an Ubuntu Lucid machine. How can i do this? One possibility is to use Eclipse/StatET on the Windows machine and configure a remote console (to be running on your GNU/Linux server). The StatET user list has posts with explanations on how to achieve this. http://lists.r-forge.r-project.org/mailman/listinfo/statet-user http://lists.r-forge.r-project.org/mailman/swish.cgi?query=listname%3D%22statet-user%22 Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Good Package(s) for String and URL processing?
On 07/02/2010 05:51 AM, Erik Iverson wrote: Ralf B wrote: Are there packages that allow improved String and URL processing? E.g. extract parts of a URLs such as sub-domains, top-level domain, protocols (e.g. https, http, ftp), file type based on endings, check if a URL is valid or not, etc... I am currently only using split and paste. Are there better and more efficient ways to handle strings e.g. finding sub-strings or to do pattern matching? What packages do you use if you have to do a lot of String processing and you don't have the option to go to another language such as Perl or Python? Well, much of the power of Perl is built on top of regular expressions, which R also supports. See ?regex for more details. Also the R functions ?grep, ?sub, etc. I can also highly recommend the book Mastering Regular Expressions. It does not cover R explicitly, but what you learn in there can be directly applied to R. Regexs go very, very far with helping you with the task of finding substrings and pattern matching. You might find some things in RCurl helpful: http://www.omegahat.org/RCurl/ Probably others... Including gsubfn by Gabor Grothendieck and stringr by Hadley Wickham http://cran.r-project.org/web/packages/gsubfn/index.html http://cran.r-project.org/web/packages/stringr/index.html Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Agreement
Hi Grégoire, HB8 wrote: Has Lawrence Lin's code been ported to R? http://tigger.uic.edu/~hedayat/sascode.htmlhttp://tigger.uic.edu/%7Ehedayat/sascode.html One of Lin's methods (CCC) is available in function epi.ccc of the epiR package. Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Symbols in biplot
Hi Ara, Ara Kooser wrote: I just started in on R today. I am at the point where I am trying to distinguish different groups of data (hydrochemical data) in biplot. I search and found a post about converting the sample number in biplot to a symbol like x or + temp - matrix(runif(50), nrow=10) temp.pca - princomp(temp) biplot(temp.pca, xlabs=c(A, A, B, B, B, C, C, C, D, D)) When I try this: biplot(pca,xlabs=c(X)) Error in dimnames(x) - list(xlabs, dimnames(x)[[2L]]) : length of 'dimnames' [1] not equal to array extent I guess I am not understanding fully what xlabs is doing and what the array extent is. You need to add as many symbols (i.e. a character vector with as many elements) as there are rows in your dataset biplot(temp.pca, xlabs= rep(X, 10), col = c(blue, darkgrey)) should work, similarly to the 10 symbols (A, A, B, etc.) you used in your call above. I was wondering if someone could clarify for me how to change the sample numbers to a symbol? Also is there a way to color a group of data (i.e. samples 1-50) in biplot? From the help page of biplot.default, it seems the col argument can be used only to specify the two colors for the two sets of points which are drawn on the biplot. Once you get familiar with R graphics, however, it should be relatively straightforward to work out your own biplot function. When looking through the code of biplot.default using getAnywhere(biplot.default) you will see places where the col argument is used (look for col[1L] and col[2L]). HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] StatEt: Error R Object Browser Update java.lang.NullPointerException
Hi Roman, Roman Luštrik wrote: Have you managed to resolve this? I get the same error on Karmic Koala as well. Are you sure you're using the latest StatET, i.e. version 0.8.2, installed from the update site (for Eclipse 3.5) at http://download.walware.de/eclipse-3.5 Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Image RGB calculation
Hi Ole, ole_roessler wrote: I need to read an image (mostly jpg) and split the channel of this image to an colour channel calculation like this: sqrt(R²+G²+B²) Do you have an idea what package I need to use for it, and is it possible? For general image processing capabilities within R, I would recommend the EBImage package which you can find on the BioConductor repositories. Hope this helps, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] GSL in C code for R
Hi Sebastian, J. Sebastian Tello wrote: Dear fellow R users, I am now investing time in learning how to use compiled C code to produces functions that can be used in R. I am just starting, and there is much that I need to learn, so I have a question that might be straight forward. I am learning how to use function in the C library GSL (gnu scientific library), to write C code, that I then plant to use in R. Is there any problem in doing this? I mean, using functions of GSL to write C funtions to then use them in R? I just want to make sure that this approach is correct, before I invest more time trying to figure out how to include GSL functions into my C functions. Any commentaries, insights or advice will be highly appreciated. It may or may not be relevant to your query, but there is a GSL wrapper package available on CRAN which might be instructive or even used directly for your purposes. http://cran.r-project.org/web/packages/gsl/index.html Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R package documentation
Hi Sébastien, Sébastien Bihorel wrote: I am currently writing the documentation for my first package. I have created a short user manual using sweave/pdflatex which is distinct from the manual/summary-of-package-functions created by R CMD CHECK. I was wondering how could I seamlessly combine both documents. It is common to have - technical documentation in your .Rd files (in the man/ directory of your package) - functional documentation as a so-called vignette (Sweave file documenting concrete use of your package) in the inst/doc directory of your package. http://cran.r-project.org/doc/manuals/R-exts.html#Writing-package-vignettes Combining both documents into one file is not common. I hope this helps, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R package documentation
Hi Sébastien, Sébastien Bihorel wrote: The .R files that I have created for all my functions are somehow used to generate a package manual pdf when I used R CMD CHECK. This is what I'd like to add in my vignette. It might be uncommon, but I saw this was done for several package documentations (e.g. PBS collections) and I kind of like this combination. I now understand what you mean. The PBS documentation you refer to seems a mere (manual) concatenation of a (non-LaTeX based) pdf document and the reference manual pdf which is not generated from a Sweave file. Such manipulations can be done using e.g. the pdfjam toolbox by David Firth. http://go.warwick.ac.uk/pdfjam Best, Tobias On Wed, Apr 14, 2010 at 6:52 AM, Tobias Verbeke tobias.verb...@openanalytics.eu mailto:tobias.verb...@openanalytics.eu wrote: Hi Sébastien, Sébastien Bihorel wrote: I am currently writing the documentation for my first package. I have created a short user manual using sweave/pdflatex which is distinct from the manual/summary-of-package-functions created by R CMD CHECK. I was wondering how could I seamlessly combine both documents. It is common to have - technical documentation in your .Rd files (in the man/ directory of your package) - functional documentation as a so-called vignette (Sweave file documenting concrete use of your package) in the inst/doc directory of your package. http://cran.r-project.org/doc/manuals/R-exts.html#Writing-package-vignettes Combining both documents into one file is not common. I hope this helps, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Design of a survey using the survey package
Tom La Bone wrote: I have looked through the new Complex Surveys book and the documentation for the survey package and it appears to me that there are no functions in survey that help one to design a sampling scheme. For example, in the book section 2.8 discusses the design of stratified samples, but there is no mention of any functions in the survey package that implement the discussed strategies. So, am I missing something obvious here or is the survey package meant only for analyzing survey data once you have it in hand? Yes. packageDescription(survey) Package: survey Title: analysis of complex survey samples [...] For drawing samples, see e.g. the sampling package: http://cran.r-project.org/web/packages/sampling/index.html HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Please Post Planned Contrasts Example in lme {nlme}
Hi Martin, Martin Turcotte wrote: Hi I am running some linear and non-linear mixed effect models and would like to do some planned contrasts (a priori contrasts) I have looked in the help and in many forums and it seems possible to do so but don't understand how to write the function and I couldn't find an example in Pinheiro and Bates. lme {nlme} has a contrasts argument but I can't understand how to code it. Here is a simple example of my working lme model: dependent variable: APHIDS: log (number of aphids) Fixed effects: DAY (time) and TREATMENT ( 6 different aphid treatments) Random effects: POPULATION (each population is counted through time) lme.fit-lme(log(APHIDS)~ DAY*TREATMENT, random = ~ DAY| POPULATION,data= aphid.data) My hypothesis testing focuses on comparing Treatments ~ 1 and 4 , and eventually 2 vs 5, and 3 vs 6. Q1: How can I do planned contrasts on these pairs for the main effect of TREATMENT? Q2: Can I also do this for the interaction term (DAY*TREATMENT)? Q3: Would this code work for a non-linear mixed effect modelnlme( ) I would have a look at the multcomp package which allows for defining contrasts in a very convenient way and can deal a.o. with lme (from nlme) and mer (from lme4) objects. http://cran.r-project.org/web/packages/multcomp/index.html The package comes with several vignettes with example uses (also an lmer one IIRC). Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Writing dataframes to SAS XPT format
Dennis Fisher wrote: Colleagues, On occasion, I need to output an R dataframe to a file in SAS XPT format. Although the foreign package supports reading of XPT files and writing to a format that SAS can read, it does not support writing to XPT format (confirmed with Thomas Lumley, the author of write.foreign). Has anyone developed such a function? If so, would you be willing to share it? Better yet, post it to CRAN so that it is available to all users. http://cran.r-project.org/web/packages/SASxport/index.html HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] dmvnorm masked by emdbook
Hi Dan, For this to work, the copula package should explicitly import dmvnorm from the mvtnorm package by including importFrom(mvtnorm, dmvnorm) in their NAMESPACE file. You can do the same thing and rebuild + reinstall the package to solve your problem quickly, but there might be some other imports of relevance (I cc'ed the maintainer). Best, Tobias jyan at stat.uconn.edu Daniel Murphy wrote: I am using curve3d in the emdbook package to graph a gaussian copula density function generated via the copula package. Unfortunately, it appears that emdbook masks dmvnorm from the package mvtnorm in a way that prohibits copula from generating the gaussian copula. (Sounds very confusing!) For example, library(copula) f-function(x,y) dcopula(normalCopula(0),c(x,y)) library(emdbook) curve3d(f) Error in dmvnorm(x, sigma = sigma) : unused argument(s) (sigma = sigma) Is there no way for me to use those two libraries together? Thanks, Dan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] find CP
Hi, assaedi76 assaedi76 wrote: Thanks in advance: I need to use the function mle.cp in R. When I run this function I recive result - mle.cp(y.hald~x.hald) Error: could not find function mle.cp could some one give me a help? There is a function of that name in the wle package. Make sure it is installed, then load the package using library(wle) before issuing your command. HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Ubunut + Eclipse + StatET: Console terminates upon error
Hi Dirk, Janko, Dirk Eddelbuettel wrote: On 11 March 2010 at 19:19, Janko Thyson wrote: | I'm trying to set up Eclispe (3.5.1) with the StatET-Plugin (0.8.1) under | Ubuntu (Karmic) and found it strange that my console terminates every time | something in a script produces an arbitrary error (e.g. just calling a | missing variable, trying to perform an illegal operation etc.). Can anyone | tell me why this happens or even better how to fix this? I never experienced such behaviour and use Eclipse/StatET daily on Ubuntu Karmic. I did experience weird UI behaviour once (related to a GTK bug) and currently use this #!/bin/bash export GDK_NATIVE_WINDOWS=1 /opt/eclipse/eclipse -debug -consolelog -vmargs -Xms1024m -Xmx2048m -XX:MaxPermSize=2048m to launch eclipse (never mind the insane vmargs ;-) While we're at it: if you have the choice, you can upgrade to Eclipse 3.5.2 (i.e. Galileo SR2) and to StatET 0.8.2 (which is available via the update site at http://download.walware.de/eclipse-3.5 ) It so happens that I help a colleague recently to triage this. The problem there was that a recent rJava was needed + and installed -- and on Ubuntu and Debian this goes into /usr/local/lib/R/site-library/ and StatET -- as shipped -- does not look there. I don't use Eclipse so I don't recall where to set this, but in essence you need to make sure that StatET looks where R puts things. And that tends to be The libraries can be set (and auto-detected) when defining an R environment in the Preferences under StatET Run/Debug R Environments. The R environment for a particular R Console Run Configuration is in turn set in the R Config tab (of the named Run Configuration). R .libPaths() [1] /usr/local/lib/R/site-library /usr/lib/R/site-library [3] /usr/lib/R/library R CCing Tobias just in case. Don't hesitate if there would be further questions. There also is a dedicated StatET user list at https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/statet-user HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Ubunut + Eclipse + StatET: Console terminates upon error
Hi Janko, I'm not an rJava install expert (on all but my own system I often end up setting the appropriate environment variables related to Java manually before launching the R CMD INSTALL for the package), but with respect to the choice Rterm vs. RJ Console, I would strongly advise to use the RJ Console. It allows for a much richer IDE experience, particularly through the Object Browser and Content Assist (Content Assist corresponds in non-Eclipse lingo to command completion and hover pop-ups in the editors and R Console). Best, Tobias Janko Thyson wrote: Thanks for the quick reply. I was following your hint with rJava, but I'm still a little lost. I maybe should have added that the console terminating happens when launching it as Rterm, it works fine when running it as RJ. However, I would like to use Rterm. Here is what I did so far: First of, I'm still confused about Ubuntu's sudo way of doing things. Not knowing how to authorize me as root when installing packages from a R-script, I can't write on /usr/local/lib/R/site-library or /usr/lib/R/site-library. So I turned to Synaptics, found and installed the CRAN package rJava that enables me to run the R console with Launch Type RJ within Eclipse. rJava went into /usr/lib. Then, launching R as RJ and trying to execute an install.packages(), Ubuntu prompted me for the specification of a valid library directory and offered to create /home/ME/i486-pc-linux-gnu-library/2.10. So .libPaths() would give me: R .libPaths() [1] /home/ME/i486-pc-linux-gnu-library/2.10 /usr/lib/R/site-library [3] /usr/lib/R/library R I then tried to re-install the package rJava by install.packages() which got me the following output: + install.packages(rJava, repos=repos.cran, lib=/home/ME/R/i486-pc-linux-gnu-library/2.10) trying URL 'http://cran.at.r-project.org/src/contrib/rJava_0.8-2.tar.gz' Content type 'application/x-gzip' length 471971 bytes (460 Kb) opened URL == downloaded 460 Kb * installing *source* package ‘rJava’ ... checking for gcc... gcc -std=gnu99 checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc -std=gnu99 accepts -g... yes checking for gcc -std=gnu99 option to accept ISO C89... none needed checking how to run the C preprocessor... gcc -std=gnu99 -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/wait.h that is POSIX.1 compatible... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for string.h... (cached) yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking for unistd.h... (cached) yes checking for an ANSI C-conforming const... yes checking whether time.h and sys/time.h may both be included... yes configure: checking whether gcc -std=gnu99 supports static inline... yes checking whether setjmp.h is POSIX.1 compatible... yes checking whether sigsetjmp is declared... yes checking whether siglongjmp is declared... yes checking Java support in R... present: interpreter : '/usr/bin/java' archiver: '/usr/bin/jar' compiler: '/usr/bin/javac' header prep.: '/usr/bin/javah' cpp flags : '' java libs : '-L/usr/lib/jvm/java-6-openjdk/jre/lib/i386/server -L/usr/lib/jvm/java-6-openjdk/jre/lib/i386 -L/usr/lib/jvm/java-6-openjdk/jre/../lib/i386 -L -L/usr/java/packages/lib/i386 -L/usr/lib/jni -L/lib -L/usr/lib -ljvm' configure: error: One or more Java configuration variables are not set. Make sure R is configured with full Java support (including JDK). Run R CMD javareconf as root to add Java support to R. If you don't have root privileges, run R CMD javareconf -e to set all Java-related variables and then install rJava. ERROR: configuration failed for package ‘rJava’ * removing ‘/home/ME/R/i486-pc-linux-gnu-library/2.10/rJava’ The downloaded packages are in ‘/tmp/RtmpbGKuzS/downloaded_packages’ Warning message: In install.packages(rJava, repos = repos.cran, lib = /home/ME/R/i486-pc-linux-gnu-library/2.10) : installation of package 'rJava' had non-zero exit status + So I ran sudo R CMD javareconf, but still get the same error. Any hints from here on? Thanks a lot! Janko -Ursprüngliche Nachricht- Von: Dirk Eddelbuettel [mailto:e...@debian.org] Gesendet: Donnerstag, 11. März 2010 19:40 An: Janko Thyson Cc: r-help@r-project.org; tobias.verb...@openanalytics.eu Betreff:
Re: [R] Statet on Eclipse: ${project_path} is empty
Hi Paul, Paul wrote: I'm tryign to use Statet on Eclipse on my Kubuntu Karmic PC. I've set everything up and I can start the R configuration, but the working directory is set to my home directory. If I set the start in directory to ${worspace_loc}/${project_path} I can't start the console, with an error that project_path is empty. Personally I always use (nothing more than) ${resource_loc} to set the R working directory. Before launching R, you select a *directory* in the Project Explorer, then launch the R Console Run Configuration and that particular directory will be used as the working directory. An alternative (some people prefer) is to use ${resource_container}. In that case you select the R script you want to work with, then launch the R Console Run Configuration of your choice and it will have the directory (containing the file you selected) as the working directory. As mentioned, for me selecting a directory to become the working directory is more natural, but this is merely a matter of taste and habit. HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Hartley's table
Hi Silvano, Is it library(SuppDists) ?maxFratio you are looking for ? Best, Tobias Silvano wrote: Hi, Does anyone know how to generate Hartley's table in R? -- Silvano Cesar da Costa Departamento de Estatística Universidade Estadual de Londrina Fone: 3371-4346 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] counting the number of ones in a vector
Nutter, Benjamin wrote: What you did works well. You could also try the following. table(x)[1] or sum(x==1) HTH, Tobias -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Randall Wrong Sent: Friday, February 26, 2010 9:41 AM To: r-help@r-project.org Subject: [R] counting the number of ones in a vector Dear R users, I want to count the number of ones in a vector x. That's what I did : length( x[x==1] ) Is that a good solution ? Thank you very much, Randall [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. === P Please consider the environment before printing this e-mail Cleveland Clinic is ranked one of the top hospitals in America by U.S.News World Report (2009). Visit us online at http://www.clevelandclinic.org for a complete listing of our services, staff and locations. Confidentiality Note: This message is intended for use\...{{dropped:13}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] text editors
Sharpie wrote: Dwayne Blind wrote: Dear all, Do you use a text editor ? What would you recommend for Windows users ? What about Tinn-R ? Thank you very much, Dwayne Learning a text editor is a significant and very valuable investment of your time. In order to maximize the return from this investment you will want to choose an editor that works well with all the languages and operating systems you currently use, as well as the ones you may use in the future. For example, I spend an equal amount of time working on Windows, OS X and Linux. There are a ton of great Windows-only editors out there, but they aren't a good option for me because I only use windows 1/3 of the time I'm at a computer. Some good editors I know of that fall into this category are Emacs, Vim and Eclipse. For integrating with R, Emacs has the ESS plug-in and Eclipse has an extension called StatET. Eclipse is a rather large in terms of file size compared to Emacs or Vim-- also I know Emacs and Vim can be used through a ssh connection. I'm not sure about Eclipse as I haven't used it much. For the record: it is perfectly possible to configure an 'R Remote Console' in StatET which will launch R over an SSH connection. You can then disconnect from /reconnect to an R session on server etc. Best, Tobias This is important because if you happen to be stuck on a computer that is locked down and doesn't have your editor of choice installed there is still a chance that you will be able to use ssh to reach a computer that does. Personally, I use Vim and have found it just fine for my needs. ESS: http://ess.r-project.org/ StatET: http://www.walware.de/?page=/;jsessionid=b4d82261e53bd419d41609155e9e -Charlie __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R or C++ on FreeNX servers
Hi Murray, Murray Jorgensen wrote: I have just found out that the machine learning group in our Faculty has a lot of spare capacity on their FreeNX servers. I do not know a lot about these beasts but I understand that they are a free version of something produced by a firm called NoMachine. They are designed for executing parallel algorithms and I thought that they might be of use in a project of mine comparing different model-fitting algorithms from the point of view of sensitivity to starting values. As far as I know FreeNX is an implementation of a protocol that allows to connect to remote X sessions (X being the standard windowing system for *nix systems) in an optimized way. There is (in my understanding) no relationship to parallel algorithm execution. Using a NX client, you can connect to a remote (often more powerful) machine (potentially making use of multiple cores on that machine in a parallel way), but the FreeNX part of it is just about having the remote machine's GUI forwarded such that you can work on the server (in a window on) on your desktop machine. HTH, Tobias Anyway before revealing my near-total ignorance to my computer science colleagues I thought I would ask if any of my fellow R users have any experience with these things and possibly advice to offer. The CS people are probably using the servers in conjunction with Java or C++ and I could possibly use the latter of these. I wondered, though, if R could be used directly with such hardware and if so, how the parallelizing would be handled. Regards, Murray Jorgensen __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] serialized plot object (2 years later)
Hi Jack, Jack Tanner wrote: About 2 years ago, Tobias Verbeke asked: I am looking for a way to capture the binary string that in normal use of graphics devices will bewritten to (most commonly) a file connection... Is there a way of capturing the binary `jpeg string' [generated by jpeg()]? http://tolstoy.newcastle.edu.au/R/e2/devel/07/09/4276.html Brian Ripley's answer was Nope, unfortunately, they write to files not connections and no R object is involved. Is this still the case? Yes (assuming your question wasn't a rhetorical question). I still think it would be a useful feature if graphics devices could write to connections. Best, Tobias P.S. Your question seems more appropriate for R-devel. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] SOM library - where do I find it
Hi tdm, tdm wrote: R version 2.9.2 (2009-08-24) - for windows library(SOM) Error in library(SOM) : there is no package called 'SOM' Where can I get the SOM library from? Thanks in advance R is case-sensitive, so install.packages(som) library(som) ?som http://cran.r-project.org/web/packages/som/index.html HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] refactoring in R
Hi Peng, Some of the refactoring methods I identified back then were integrated into Eclipse/StatET in the mean time. StatET by the way contains some extensions that were not in the original proposal on that website. For the announcement of the latest release, see http://lists.r-forge.r-project.org/pipermail/statet-user/2009-September/000208.html It is advisable to use it with the rJava version referenced in the announcement (as rJava 0.8.* had some non-backwards-compatible API changes). A new StatET version (a.o. adapted to rJava 0.8.x) is likely to be released on short notice. If you want to keep up to date, there is a dedicated mailing list at https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/statet-user HTH, Tobias P.S. The refactoring methods are available under the Source menu, and there is one [simple rename] made available as a QuickFix (Ctrl+1). Peng Yu wrote: I found the examples of how to change the code for each refactoring activity. Are there tools that can help automate this process? On Fri, Nov 13, 2009 at 9:16 PM, milton ruser milton.ru...@gmail.com wrote: Hi Peng, If that information is preliminary, so I guess you have a more clear problem and may be you are able to state a minimally reproducible code/example with what you really need. Bests milton On Fri, Nov 13, 2009 at 9:30 PM, Peng Yu pengyu...@gmail.com wrote: I'm wondering if there are some tips for refactoring in R. I found the following website, which is still preliminary. Is there any program that can help me do refactoring in R? http://www.r-developer.org/projects/show/refactoring __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] refactoring in R
Hi Peng, I'm wondering which eclipse I shall download to use with StatET. Would you please let me know? http://www.eclipse.org/downloads/ This depends on your needs other than R programming. As you can see, there are Eclipse Packages targeted at C/C++ developers, PHP developers, Java EE developers etc. Whatever Eclipse Package you choose, Eclipse is a highly modular (component-based) platform and you can install (or remove) any plug-ins you want after installation. The StatET plug-ins will be the first additional ones you want to install. http://www.walware.de/it/statet/installation.mframe For general use, I would just take Eclipse Classic. HTH, Tobias On Sat, Nov 14, 2009 at 5:46 AM, Tobias Verbeke tobias.verb...@openanalytics.be wrote: Hi Peng, Some of the refactoring methods I identified back then were integrated into Eclipse/StatET in the mean time. StatET by the way contains some extensions that were not in the original proposal on that website. For the announcement of the latest release, see http://lists.r-forge.r-project.org/pipermail/statet-user/2009-September/000208.html It is advisable to use it with the rJava version referenced in the announcement (as rJava 0.8.* had some non-backwards-compatible API changes). A new StatET version (a.o. adapted to rJava 0.8.x) is likely to be released on short notice. If you want to keep up to date, there is a dedicated mailing list at https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/statet-user HTH, Tobias P.S. The refactoring methods are available under the Source menu, and there is one [simple rename] made available as a QuickFix (Ctrl+1). Peng Yu wrote: I found the examples of how to change the code for each refactoring activity. Are there tools that can help automate this process? On Fri, Nov 13, 2009 at 9:16 PM, milton ruser milton.ru...@gmail.com wrote: Hi Peng, If that information is preliminary, so I guess you have a more clear problem and may be you are able to state a minimally reproducible code/example with what you really need. Bests milton On Fri, Nov 13, 2009 at 9:30 PM, Peng Yu pengyu...@gmail.com wrote: I'm wondering if there are some tips for refactoring in R. I found the following website, which is still preliminary. Is there any program that can help me do refactoring in R? http://www.r-developer.org/projects/show/refactoring __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] editors for R
Hi Mark, After reviewing the IDE/Script Editors article at sciviews.org, I wanted to pose a quick question here to see if anyone can offer an opinion or commentary about GUI editors that can be installed in a Windoze environment that allow editing/saving of remote .R files and running R programs from within a shell that is housed in the editor (although R itself is installed in a Linux environment). Windoze would essentially be providing a GUI-based tool to edit, save, and execute without making the user copy files back and forth and switch between various programs to execute their routines. Thus far, BlueFish seems to come closest to this; but other recommendations will be most appreciated. Eclipse + StatET; see http://lists.r-forge.r-project.org/pipermail/statet-user/2009-September/000208.html for information on the latest release. For remote connections, you need to install RJ-Server (on the Linux machine) and configure a Remote R Console (on the client). There is a dedicated mailing list at https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/statet-user HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How do I do simple string concatenation in R?
Tobias Verbeke wrote: Hi Ari, How do I do simple string concatenation in R? For example: A = klm B = jjj How can I assign a value to C such that C == klmjjj is True? paste(A, B, collapse = ) Oops. paste(A, B, sep = ) Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How do I do simple string concatenation in R?
Hi Ari, How do I do simple string concatenation in R? For example: A = klm B = jjj How can I assign a value to C such that C == klmjjj is True? paste(A, B, collapse = ) See ?paste HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How to compile R with command completion?
Peng Yu wrote: I want to compile R with command completion. But I don't find such an option in configure. Can somebody let me know how to enable command completion in an R session? AFAIK this is not an option you set when compiling. Did you try to type a letter (say 'l') and press the TAB key ? If you are not satisfied, you might want to use other R editors or development environments (such as StatET for Eclipse or ESS) which implement command completion in their idiosyncratic ways. Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Running an ANOVA with a BY
baxterj wrote: I downloaded the package and got it to work with the coding: model - function(df) {aov(values ~ WellID, data = twelldata)} Hmm.. I guess you mean to use 'data = df' instead of 'data = twelldata' ANOVA1way - dlply(twelldata, .(Analyte), model) print(ANOVA1way) This gives me degrees of freedom and sum of squares for each anova per analyte. However, I cant get the summary(ANOVA1way) to work so that I can get p-values, etc... How can I do this? You need to extend your model function: - extract the bits you want - construct a result data frame - return it and use a ddply For example (non-tested): model - function(df) { lmObj - lm(values ~ WellID, data = df) summaryLmObj - summary(lmObj) res - data.frame(intercept = coef(lmObj)[1], adjr2 = summaryLmObj$adj.r.squared) # extract and insert anything return(res) } (ANOVA1way - ddply(twelldata, .(Analyte), model)) HTH, Tobias Tobias Verbeke-2 wrote: baxterj wrote: I have a simple 1 way anova coded like summary(ANOVA1way - aov(Value ~ WellID, data = welldata)) How can I use the BY function to do this ANOVA for each group using another variable in the dataset?? I tried coding it like this, but it doesn't seem to work. summary(ANOVA1way - by(welldata, Analyte, function(x) aov(Value ~ WellID, data = welldata))) In SAS I would code it like this: Proc sort data=welldata; by analyte; run; Proc glm data=welldata; by analyte; class wellid; model value = wellid; run; Look at the plyr package for a general solution to this type of problems: http://cran.r-project.org/web/packages/plyr/index.html and its introductory guide on the package home page: http://had.co.nz/plyr/ HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Running an ANOVA with a BY
baxterj wrote: I have a simple 1 way anova coded like summary(ANOVA1way - aov(Value ~ WellID, data = welldata)) How can I use the BY function to do this ANOVA for each group using another variable in the dataset?? I tried coding it like this, but it doesn't seem to work. summary(ANOVA1way - by(welldata, Analyte, function(x) aov(Value ~ WellID, data = welldata))) In SAS I would code it like this: Proc sort data=welldata; by analyte; run; Proc glm data=welldata; by analyte; class wellid; model value = wellid; run; Look at the plyr package for a general solution to this type of problems: http://cran.r-project.org/web/packages/plyr/index.html and its introductory guide on the package home page: http://had.co.nz/plyr/ HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] for cycle with uncontinuous numbers
Hi nice people, :-) I would like to do a for cycle but i wish it to assume only the numers 50, 100, 200, 300, 900 and 2343 I tried to do something like x - c(50,100,200,300,900,2343) for (i in x){ #. } But it didn´t work If you would use a reproducible code example we could point out where the error comes from; otherwise we can only tell this should work; try x - c(50,100,200,300,900,2343) for (i in x){ cat(i^2, \n) } # 2500 # 1 # 4 # 9 # 81 # 5489649 HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Viewing Function Code
Michael Pearmain wrote: I'd like to see the function code behind the barplots2() function in the gplots package, however i come across a bit of a stumbling block of a hidden function, can anyone help? library(gplots) methods(barplot2) [1] barplot2.default* Non-visible functions are asterisked barplot2 function (height, ...) UseMethod(barplot2) environment: namespace:gplots getAnywhere(barplot2.default) HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Google's R Style Guide
Vitalie S. wrote: On Fri, 28 Aug 2009 16:40:53 +0200, Kevin Wright kw.s...@gmail.com wrote: On Fri, Aug 28, 2009 at 8:22 AM, Ted Harding ted.hard...@manchester.ac.ukwrote: On 28-Aug-09 12:59:24, Esmail wrote: Perhaps most of you have already seen this? http://google-styleguide.googlecode.com/svn/trunk/google-r-style.html Comments/Critiques? Thanks, Esmail ps: Reminds me of PEP 8 for Python http://www.python.org/dev/peps/pep-0008/ Maybe not that surprising since Python is also one of the main languages used by Google. I think it is grossly over-prescriptive. For example: function names have initial capital letters and no dots is violated throughout R itself. Ted. Certainly R's function names are an inconsistent mess: row.names, rownames browseURL, contrib.url, fixup.package.URLs package.contents, packageStatus mahalanobis, TukeyHSD getMethod, getS3method It's too late to fix the established functions, but it would be nice to have more reliable and sensible standards going forward into the future. I agree, but on the other hand one should not overestimate the importance of the inconsistent mess. A good IDE (such as Eclipse + StatET) provides content assist for R that takes away the burden both of remembering and correctly spelling R functions (and function arguments). It's never too late - it's only a name not a code - search replace through the whole R code and have old names deprecated is not a big deal, isn't it? ? Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] RE xcel Macro Mode
spencerg wrote: Have you looked at RExcel and the RExcelInstaller package? There is now a companion book: Heiberger and Neuwirth (2009) R Through Excel: A Spreadsheet Interface for Statistics, Data Analysis, and Graphics (Springer)? Both Amazon and the Springer web site say it's not yet available. However, the Springer booth at the Joint Statistical Meetings was selling copies Monday and maybe Tuesday until they ran out. I believe that both Amazon and Springer would take your order and ship fairly soon. If this does not solve your problem I suggest you write directly to Heiberger or Neuwirth. Or (maybe better) post a question to the rcom mailing list http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l/ HTH, Tobias ryusuke wrote: I would like to do so as well, but I faced some problems as well.. livia wrote: Hi everyone, I would like to write VBA macros for accessing R and it is my first attempt. I really could use some help here. I am trying to use the following code to read data from Access. The R code between is correct as I successfully run it from R, but when I call it using VBA, it comes out the error message Compile error Syntax error Call RInterface.RRun(mdbConnect - odbcConnectAccess(//c/users/Shared/data.mdb)) If I would like to run a function , is the following codes correct? Call RInterface.RRun(quareturn - function(x){ ... ...{ ... } ... }) Could anyone give me some advice? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Check functions in package
Steve Lianoglou wrote: On Jul 28, 2009, at 4:16 PM, voidobscura wrote: Hi, I run R on a server via SSH, over a terminal. After loading a specific package, how do I know what functions are in that package? Is there any way to list or display them? Here's one way. Let's say I load the glmnet package, at the prompt I could use tab-completion to which functions are exported: R library(glmnet) R glmnet::TABTAB glmnet::coef.glmnet glmnet::jerr glmnet::plot.glmnet glmnet::predict.elnetglmnet::predict.lognet glmnet::print.glmnet glmnet::glmnet glmnet::nonzeroCoef glmnet::plotCoef glmnet::predict.glmnet glmnet::predict.multnet TABTAB is hitting the tab key twice in quick succession. There are probably better ways, but there's one option. An alternative is (in this case) to call library(help = glmnet) Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] error when installing rjags
Hi Mark, What command did you use exactly to install the package ? The following blog post by Yu-Sung Su http://yusung.blogspot.com/2009/01/install-jags-and-rjags-in-fedora.html indicates that some configure.args might need to be set to succesfully install the package (at least on Fedora 10) install.packages(rjags, configure.args=--with-jags-include=/usr/local/include/JAGS --with-jags-lib=/usr/local/lib/JAGS --with-jags-modules=/usr/local/lib/JAGS/modules) The fact that in the error message complains some files are not found might have to do with one of the appropriate paths not being picked up. HTH, Tobias markle...@verizon.net wrote: Hi All: I get the following error when trying to install the rjags package. I've installed the jags software and I'm using Fedora 10.0 and my sessionInfo is at the bottom of this email. I'm also sorry if this email ends up having control A's all over it. I still haven't figured how to fix that. Thanks. [1] LOADING MASS LIBRARY checking for prefix by checking for jags... /usr/bin/jags configure: creating ./config.status config.status: creating src/Makevars configure: creating ./config.status config.status: creating src/Makevars config.status: creating R/unix/zzz.R g++ -m32 -I/usr/include/R -I/usr/include/JAGS -I/usr/local/include   -fpicÂ-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -c jags.cc -o jags.o jags.cc:8:21: error Console.h No such file or directory jags.cc:9:24: error: util/naing.h: No such file or directory jags.cc:20: error: 'SArray' was not declared in this scope jags.cc:21: error expected ',' or ';' before { token R version 2.9.0 (2009-04-17) i386-redhat-linux-gnu locale: LC_CTYPE=en_US.utf8;LC_NUMERIC=C;LC_TIME=en_US.utf8;LC_COLLATE=en_US.utf8;LC _MONETARY=C;LC_MESSAGES=en_US.utf8;LC_PAPER=en_US.utf8;LC_NAME=C;LC_ADDRESS= C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.utf8;LC_IDENTIFICATION=C attached base packages: [1] datasets utils    stats    graphics grDevices methods  base    other attached packages:  [1] gsubfn_0.3-8      proto_0.3-8       latticeExtra_0.5-4 RColorBrewer_1.0-2filehash_2.0-1    reshape_0.8.2     plyr_0.1.8        rOpenBUGS_0.0-1   caret_4.19       [10]dyn_0.2-8        Âcoda_0.13-4       lattice_0.17-22   zoo_1.5-5         chron_2.3-30      MASS_7.2-46      loaded via a namespace (and not attached): [1] grid_2.9.0 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] time attribute from a file
Erin Hodgess wrote: Dear R People: I am reading in a file via read.table. Is there a way to bring in the time that the file was created, please? Use file.info on the same file ? HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Comprehensive power analysis/sample size package in R?
Frank E Harrell Jr wrote: Greg Snow wrote: I don't know of a single package that is comparable to PASS, but the R system itself is the most comprehensive tool available for power and sample size computations. For the simple cases you already found the pwr package, there are also some power functions in the stats package and in some other packages and these will be comparable to the equivalent (or possibly better) than the simple ones in PASS. FYI, Russ Lenth is porting his piface package http://www.cs.uiowa.edu/~rlenth/Power/ to R http://r-forge.r-project.org/projects/piface/ Best, Tobias When things get a bit more complicated then there are a few different options for what to do next: 1. Don't provide anything for the more complicated cases. 2. Provide a minimal set of routines for more complicated cases based on programmer assumptions rather than information from someone familiar with the source of the data (assumptions often hidden). 3. Provide many different routines encompassing every alternative set of assumptions that the programmer can think of forcing the user to sort through all the options to find the one that is closest (and maybe the same) as what they want to do. 4 Provide a full programming language so that the people familiar with the question(s) of interest and the source of the data can explicitly spell out the desired analysis and assumptions. 5. possible others, but I can't think of any. It looks like PASS uses option 3, giving many different routines that any one user in only likely to use a few of. R is option 4. You can decide what assumptions you want to make about the data (and later change any of those assumptions), decide how you plan to analyze the data, then by simulation you can work out the power/sample size/etc. knowing exactly what assumptions went into the analysis. As one example of what Greg is talking about see http://bm2.genes.nig.ac.jp/RGM2/R_current/library/Hmisc/man/spower.html __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] productivity tools in R?
seeliger.c...@epamail.epa.gov wrote: snip There is no IDE for R in the same way that there is for other languages -- something that supports integrated versioning, debugging and testing, perhaps using Eclipse. Boy howdee, I hope someone knows otherwise. There is a feature-rich R plug-in for Eclipse at http://www.walware.de/goto/statet see the link below if you'd like to install the latest testing version. https://lists.r-forge.r-project.org/pipermail/statet-user/2009-May/000147.html HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Roxygen vs Sweave for S4 documentation
On Mon, Jun 22, 2009 at 2:18 PM, Douglas Batesba...@stat.wisc.edu wrote: On Mon, Jun 22, 2009 at 7:12 AM, Martin Maechlermaech...@stat.math.ethz.ch wrote: TobiasV == Tobias Verbeke tobias.verb...@openanalytics.be on Sun, 21 Jun 2009 08:25:07 +0200 writes: TobiasV Hi Ken, I have been using R for a while. Recently, I have begun converting my package into S4 classes. I was previously using Rdoc for documentation. Now, I am looking to use the best tool for S4 documentation. It seems that the best choices for me are Roxygen and Sweave (I am fine with tex). Are there any users of Roxygen or Sweave who can comment on the strengths or weaknesses of one or othe other? Thanks in advance. TobiasV For the moment proper documentation of S4 classes (with a @slot tag TobiasV e.g.) is not implemented yet, how did you define proper here? I know that the result of promptClass() may not always be perfect. As most things are not perfect, I would not quickly call this improper ... Or is using *.Rd not proper for you, as it does not have all of code + docs in one file? I think Tobias was referring to Roxygen support for S4 classes, not the existence of .Rd tags. Yes, I was just referring to the Roxygen support and as a matter of fact I recommended Roxygen to mimick the nice job done by promptClass a while ago https://lists.r-forge.r-project.org/pipermail/roxygen-devel/2009-February/23.html No intent to criticize nor current Rd tags nor Rd as a documentation system, although having code + docs in one file (as in Roxygen) seems to be convenient to some. Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Roxygen vs Sweave for S4 documentation
Hi Ken, I have been using R for a while. Recently, I have begun converting my package into S4 classes. I was previously using Rdoc for documentation. Now, I am looking to use the best tool for S4 documentation. It seems that the best choices for me are Roxygen and Sweave (I am fine with tex). Are there any users of Roxygen or Sweave who can comment on the strengths or weaknesses of one or othe other? Thanks in advance. For the moment proper documentation of S4 classes (with a @slot tag e.g.) is not implemented yet, but my secret hope is that this will be implemented before Peter and Manuel (in cc) will present Roxygen at DSC2009. Maybe they have further comments ? Kind regards, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Recursive partitioning algorithms in R vs. alia
Wensui Liu wrote: well, how difficult to code random forest with sas macro + proc split? if you are lack of sas programming skill, then you are correct that you have to wait for 8 years :-) It is true one can use the macro language to obtain some control flow the plain SAS language and its PROCs are missing and for manipulating matrices there is even a third language (IML), but my customers prefer to leverage community-tested open source implementations as building blocks rather than spending unnecessary resources in writing things from scratch in their corner. i don't know how much sas experience you have. as far as i know, both bagging and boosting have been implemented in sas em for a while, together with other cut-edge modeling tools such as svm / nnet. Fair enough, but whenever you will need ensemble methods for survival data or would like to escape bias in variable importance in presence of categorical predictors you will (1) not be able to take something off the shelf and (2) neither to programmatically tweak SAS EM procedures (as they are not exposed but locked in the GUI), so there again your only option is to implement things from scratch. Best, Tobias On Fri, Jun 19, 2009 at 4:18 PM, Tobias Verbeketobias.verb...@openanalytics.be wrote: Wensui Liu wrote: in terms of the richness of features and ability to handle large data(which is normal in bank), SAS EM should be on top of others. Should be ? That is not at all my experience. SAS EM is very much lagging behind current research. You will find variants of random forests in R that will not be in SAS for the next 8 years, to give just one example. however, it is not cheap. in terms of algorithm, split procedure in sas em can do chaid/cart/c4.5, if i remember correctly. These are techniques of the 80s and 90s (which proves my point). CART is in rpart and an implementation of C4.5 can be accessed through RWeka. For the oldest one (CHAID, 1980), there might be an implementation soon: http://r-forge.r-project.org/projects/chaid/ but again there have been quite some improvements in the last decade as well: http://cran.r-project.org/web/views/MachineLearning.html HTH, Tobias On Fri, Jun 19, 2009 at 2:35 PM, Carlos J. Gil Bellostac...@datanalytics.com wrote: Dear R-helpers, I had a conversation with a guy working in a business intelligence department at a major Spanish bank. They rely on recursive partitioning methods to rank customers according to certain criteria. They use both SAS EM and Salford Systems' CART. I have used package R part in the past, but I could not provide any kind of feature comparison or the like as I have no access to any installation of the first two proprietary products. Has anybody experience with them? Is there any public benchmark available? Is there any very good --although solely technical-- reason to pay hefty software licences? How would the algorithms implemented in rpart compare to those in SAS and/or CART? Best regards, Carlos J. Gil Bellosta http://www.datanalytics.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Recursive partitioning algorithms in R vs. alia
Wensui Liu wrote: in terms of the richness of features and ability to handle large data(which is normal in bank), SAS EM should be on top of others. Should be ? That is not at all my experience. SAS EM is very much lagging behind current research. You will find variants of random forests in R that will not be in SAS for the next 8 years, to give just one example. however, it is not cheap. in terms of algorithm, split procedure in sas em can do chaid/cart/c4.5, if i remember correctly. These are techniques of the 80s and 90s (which proves my point). CART is in rpart and an implementation of C4.5 can be accessed through RWeka. For the oldest one (CHAID, 1980), there might be an implementation soon: http://r-forge.r-project.org/projects/chaid/ but again there have been quite some improvements in the last decade as well: http://cran.r-project.org/web/views/MachineLearning.html HTH, Tobias On Fri, Jun 19, 2009 at 2:35 PM, Carlos J. Gil Bellostac...@datanalytics.com wrote: Dear R-helpers, I had a conversation with a guy working in a business intelligence department at a major Spanish bank. They rely on recursive partitioning methods to rank customers according to certain criteria. They use both SAS EM and Salford Systems' CART. I have used package R part in the past, but I could not provide any kind of feature comparison or the like as I have no access to any installation of the first two proprietary products. Has anybody experience with them? Is there any public benchmark available? Is there any very good --although solely technical-- reason to pay hefty software licences? How would the algorithms implemented in rpart compare to those in SAS and/or CART? Best regards, Carlos J. Gil Bellosta http://www.datanalytics.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Issues getting R to write image files
Hi Kenny, Have spent the last couple of days learning R and shell scripting to do batch plotting jobs. I have had success getting R to complete a filled contour plot and output to a file (.jpg or .tiff etc). However, when I try to do the same thing with the simple plot command the script seems to execute correctly yet there is no output. Below is my R code: file - Sys.getenv(input_file) tiff(paste( file, tiff, sep=.)) z - read.table(file) plot(z, type=l, xlim=range(0.6,2), col = red, plot.title = title(main = file, xlab = Wavelength (um), ylab = Intensity (arb.)) dev.off() q() You need to close the tiff graphics device you opened using dev.off() before quitting. HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Analisys in Multidimensional contingency tables
Hi José, Hi everyone, Im trying to make an analysis of multidimensional contingency tables using R. I' working with the Agresti example where you have the data from 3 categories. The thing is how can I do the analisys using the G2 statistics. Somebody can send me an Idea? Please find below a link to an R companion for Agresti by Laura Thompson https://home.comcast.net/~lthompson221/Splusdiscrete2.pdf There are chances you find the example you would like to reproduce in there. HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Sweave \Sexpr{} advice please
Hi Kyle, First off, my deepest gratitude to the Sweave developers: this tool has improved my quality greatly. A question in my work I use \Sexpr{} statements scalar values and the xtable package for all manner of tables. What I'd like to do is to use a vector inline, rather than a whole separate table. Something like: begin code % Latex junk % Sweave block: = covmat - cov(matrix(runif(100),ncol=3)) @ % back to Latex, typing up a report, my homework, etc. The first column of the covariance matrix is $(\Sexpr{covmat[1,1]}, \Sexpr{covmat[2,1]}, \Sexpr{covmat[3,1]})^T$ % end code but, of course, this is poor way of going about it. Any suggestions? loadPkg, echo=FALSE= require(xtable) @ = covmat - cov(matrix(runif(99), ncol=3)) # 99 not 100 @ The first row of the\dots is firstRow, echo = FALSE, results=tex= xtable(covmat[1,,drop=FALSE]) @ This should get you started. Be sure to explore the facilities of the xtable package (you can use captions, labels etc.): ?xtable ?print.xtable The results=tex option to the chunk is important as well, of course. HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] caching of the .Rprofile file
Hi Tom, It seems that if I make a change to the .Rprofile file in my working directory, it is not immediately reflected when the session is restarted. (I am using statET and rJava) Is that something I should expect? No. Is your launch configuration of R in StatET configured such that it takes ${resource_loc} as working directory (Main tab of the launch configuration) ? This way you can select the directory you want as a working directory in the Project Explorer and launch R directly in there. If you do not launch R in that way it will take a default directory and therefore not load the .Rprofile from the specific directory you want to be the working directory. HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Vim R plugin-2
Hi Jose, Jose Quesada wrote: snip In my view, R as a language is very good but the tools around it are not good. When a matlab person tries R, their first comments are always how poor the environment is. Sure, one can have a debugger (with a crappy GUI in TK), and there's some editor support, but it's kind of painful. Integreting an R debugger with something like pyclewn would be very good. There's no integrated debugger yet, but the StatET plugin for Eclipse is one example of a mature development environment for R. Moreover it allows to leverage the Eclipse eco-system and its myriad of plug-ins. No painful experience at all for me.. http://www.walware.de/goto/statet Best, Tobias P.S. When I try Matlab my first comment is always how poor the language is ;-) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] running R on netbooks/minis?
Zeljko Vrba wrote: On Sun, May 03, 2009 at 03:27:43AM -0500, Erin Hodgess wrote: Is it possible to run R on a netbook/mini, please? There should be no reason not to be possible, if the notebook uses an OS that R supports. For the eeepc, e.g., documentation has been contributed on the R wiki http://wiki.r-project.org/rwiki/doku.php?id=getting-started:installation:eeepc HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Can't install package glmnet
Uwe Ligges wrote: Liang Zhang wrote: I am just wondering how to solve this installation problem. As I said, ask your admin to install suitable compilers. And 'suitable compilers' in this case means to install the GNU compiler collection gcc 4.x.y. Contrary to gcc 3.x.y (which only has a Fortran 77 compiler), gcc 4.x.y has gfortran which is the GNU Fortran 95 compiler. My guess is that your system currently only has gcc 3.x.y and no gcc4 and friends. HTH, Tobias P.S. Be sure to also install the appropriate libgfortran. From: Uwe Ligges lig...@statistik.tu-dortmund.de To: Liang Zhang zhangl...@yahoo.com Cc: r-help@r-project.org Sent: Friday, April 24, 2009 2:50:00 AM Subject: Re: [R] Can't install package glmnet Liang Zhang wrote: Hi, I was trying to install package glmnet in R, but failed and it show such messages: * Installing *source* package glmnet ... This package has only been tested with gfortran. So some checks are needed. R_HOME is /home/username/R/R-2.9.0 Attempting to determine R_ARCH... R_ARCH is Attempting to detect how R was configured for Fortran 90 Unsupported Fortran 90 compiler or Fortran 90 compilers unavailable! Stop! ERROR: configuration failed for package glmnet * Removing /home/username/R/R-2.9.0/library/glmnet The downloaded packages are in /tmp/RtmpwsLWSc/downloaded_packages Updating HTML index of packages in '.Library' Warning message: In install.packages(glmnet) : installation of package 'glmnet' had non-zero exit status It seems that it needs fortran 90 complier. What can I do to solve this problem? (I am not the administrator, only a user in the linux system). Ask for a suitable compiler? Uwe Ligges Thank you very much! Liang [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problem with apply
Marc Schwartz wrote: The cut() function will do what you want in a vectorized fashion. See ?cut However, that being said, I would strongly advise that you read Frank's page on the categorizing of continuous variables: http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/CatContinuous before you proceed. A simple example of how to use it for your problem would be set.seed(158) ages - sample(0:100, 50, TRUE) head(ages) ageGroups - cut(ages, breaks = c(-1,5,15,30,70,80,150), right = FALSE, labels = c(0-4, 5-14, 15-29, 30-69, 70-79, 80+)) head(ageGroups) See ?cut HTH, Tobias On Apr 22, 2009, at 1:56 PM, Alan Cohen wrote: Hi R users, I am trying to assign ages to age classes for a large data set (123,000 records), and using a for-loop was too slow, so I wrote a function and used apply. However, the function does not properly assign the first two classes (the rest are fine). It appears that when age is one digit, it does not get assigned properly. I tried to provide a small-scale work-up (at the end of the email) but it does not reproduce the problem; the best I can do is to provide my code and the output below. As you can see, I've confirmed that age is numeric, that all values are integers, and that pieces of the code work independently. Any thoughts would be appreciated. To add to the mystery, depending which rows of my data set I select, I get different problems. mds[1:100,] gives the problem above, as do mds[100:200,] , mds[150:250,] and mds[1:10100,]. However, with mds[200:300,], mds[250:350,] and mds[1000:1100,], only ages with 3 digits are correctly assigned - all ages 100 are returned as NA. I'm using R v 2.8.1 on Windows XP. Cheers, Alan Cohen Centre for Global Health Research, Toronto,ON ageassign - function(x){ + y - NA + if (x[11] %in% c(0:4)) {y - 0-4} + else if (x[11] %in% c(5:14)) {y - 5-14 } + else if (x[11] %in% c(15:29)) {y - 15-29 } + else if (x[11] %in% c(30:69)) {y - 30-69} + else if (x[11] %in% c(70:79)) {y - 70-79} + else if (x[11] %in% c(80:125)) {y - 80+} + return(y) + } jj - apply(mds[1:100,],1,FUN=ageassign) jj 1 2 3 4 5 6 7 8 9 10 11 12 13 NA 80+ 30-69 30-69 80+ NA 30-69 30-69 70-79 15-29 15-29 30-69 70-79 14 15 16 17 18 19 20 21 22 23 24 25 26 80+ NA 30-69 30-69 30-69 80+ 80+ 15-29 70-79 30-69 70-79 70-79 30-69 27 28 29 30 31 32 33 34 35 36 37 38 39 70-79 80+ NA 80+ 70-79 NA 15-29 15-29 NA NA 70-79 30-69 30-69 40 41 42 43 44 45 46 47 48 49 50 51 52 70-79 30-69 30-69 30-69 70-79 30-69 30-69 70-79 15-29 30-69 NA 15-29 30-69 53 54 55 56 57 58 59 60 61 62 63 64 65 30-69 NA 70-79 30-69 30-69 30-69 30-69 15-29 30-69 30-69 70-79 30-69 NA 66 67 68 69 70 71 72 73 74 75 76 77 78 30-69 30-69 30-69 30-69 30-69 80+ 30-69 80+ 70-79 30-69 30-69 30-69 NA 79 80 81 82 83 84 85 86 87 88 89 90 91 30-69 30-69 30-69 NA 80+ 30-69 30-69 30-69 NA 15-29 30-69 30-69 30-69 92 93 94 95 96 97 98 99 100 30-69 30-69 30-69 30-69 70-79 30-69 30-69 30-69 30-69 mds[1:100,11] [1] 3 82 40 35 82 1 37 57 71 22 21 52 73 86 1 43 60 63 84 88 29 73 69 75 73 43 75 83 4 83 77 1 27 [34] 15 1 6 76 51 45 71 54 64 69 70 48 38 74 26 37 4 18 63 59 8 78 63 67 62 50 21 66 69 75 57 4 50 [67] 58 60 61 62 83 69 92 75 30 49 69 1 69 63 69 0 93 64 59 69 2 25 32 60 66 67 54 53 64 79 59 49 59 [100] 64 table(mds[,11]) 0123456789 10 11 12 13 14 15 16 17 18 19 3123 6441 3856 2884 1968 1615 1386 1088 1098 721 943 681 511 380 426 835 571 555 719 653 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 879 715 672 631 655 773 680 713 769 538 685 566 729 702 652 766 683 723 821 675 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 774 650 908 892 784 925 781 1043 1161 924 1087 827 1261 1356 1297 1272 1277 1614 1831 1523 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 1702 1251 1954 2157 1901 2090 1874 2705 3085 2529 2488 1777 2701 2586 2308 2020 1801 2269 2486 1856 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1762 1047 1413 1326 967 1013 753 870 884 531 601 277 364 301 193 288 149 174 169 470 100 101 102 103 104 105 106 107 108 114 115 117
Re: [R] Neural Networks in R - Query
Hi Lars, I'd like to ask your guidance regarding the following two questions: (i) I just finished reading Chris Bishop's book Neural Networks for Pattern Recognition. Although the book gave me good theoretical foundation about NN, I'm now looking for something more practical regarding architecture selection strategies. Is there any good reference about best practices for architecure selection? (ii) Which R package provides a good implementation of NN? The CRAN Task View on Machine Learning http://cran.r-project.org/web/views/MachineLearning.html opens with the following topical item: o Neural Networks : Single-hidden-layer neural network are implemented in package nnet as part of the VR bundle (shipped with base R). HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Presenting R Results in Webpages
Hi Jason, I apologize in advance that this question is not specific to R, but I thought some R users may be using this in their work process flow. I would like to be able to have a tool (prefer scriptable) that will take two images and some pre-written text and put it on an simple webpage. That is, it would look something like the following: |-| |Title| | | | || || Some basic txt | | | Image1 | | Image2 | ... | | || || ... | |_| R comes in because I have R scripts creating the images I would like to import. There will be 14-18 pages of these type of slides, but the key is we will be producing these over and over. I tried doing something like this in PowerPoint, but not impressed with the linking capability or Macros. Thanks for any feedback and again appologize that this is not exactly a specific R question. Would the hwriter package by Gregoire Pau provide a solution? http://cran.r-project.org/web/packages/hwriter/index.html http://www.ebi.ac.uk/~gpau/hwriter/ HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Tinn-R pdf()
Hi Henning, thanks for your help, with solved the problem, although i don't why, because when using the R editor accessible via the R console i created many many lattice plots with the code i posted, i.e. without the print() command. At the command line, R objects (including lattice plots which are objects) get auto-printed, i.e. the print method is invoked automatically on these objects. This is not the case when you write to a pdf file. Best, Tobias Original-Nachricht Datum: Wed, 8 Apr 2009 12:29:58 +0200 Von: ONKELINX, Thierry thierry.onkel...@inbo.be An: Henning Wildhagen hwildha...@gmx.de, r-help@r-project.org Betreff: RE: [R] Tinn-R pdf() Dear Henning, You need to print() lattice plots when using a device: library(lattice) pdf(plot1.pdf) PLOT-(xyplot, ...) print(PLOT) dev.off() So this is not due to TINN-R. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 thierry.onkel...@inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Henning Wildhagen Verzonden: woensdag 8 april 2009 11:25 Aan: r-help@r-project.org Onderwerp: [R] Tinn-R pdf() Dear R and Tinn-R users, i recently switched to Tinn-R and sending code to R works fine (R 2.8.1, Tinn-R 2.2.0.2, OS Windows XP). However, i encountered a problem when trying to send plots to pdf files like this: library(lattice) pdf(plot1.pdf) PLOT-(xyplot, ...) PLOT dev.off() The file plot1.pdf is created, but it is empty. If i paste the code above directly into the R console and run it, the file plot1.pdf is created and in this case contains PLOT. I guess that some settings in Tinn-R are wrong, but i have no idea which. Maybe someone has a suggestion? Thanks, Henning -- [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document. The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Public R servers?
Hi Aaron, Earlier I posted a question about memory usage, and the community's input was very helpful. However, I'm now extending my dataset (which I use when running a regression using lm). As a result, I am continuing to run into problems with memory usage, and I believe I need to shift to implementing the analysis on a different system.. I know that R supports R servers through Rserve. Are there any public servers where I could upload my datasets (either as a text file, or through a connection to a SQL server), execute the analysis, then download the results? I identifed Wessa.net (http://www.wessa.net/mrc.wasp?outtype=Browser%20Blue%20-%20Charts%20White), but it's not clear it will meet my needs. Can anyone suggest any other resources? Karim Chine made available Amazon EC2 images with R and biocep that can be run on the Amazon servers on a pay per hour basis. The only requirement is to have an Amazon EC2 account. There is some explanation on http://biocep-distrib.r-forge.r-project.org/doc.html under the heading Biocep-R on Amazon's Cloud HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help with ggplot2 -- ggpoint function missing?
Hi, I'm trying to follow the ggplot introduction here: http://had.co.nz/ggplot/ggplot-introduction.pdf I've installed ggplot2 with install.packages(ggplot2, dep=T) but when I try to run print(ggpoint(p, list(colour = sex))) I get an error: Error in print(ggpoint(p, list(colour = sex))) : could not find function ggpoint What is the problem? Has the function been renamed in the ggplot - ggplot2 transition? ggplot2 has seen many improvements and still is under active development. Rather than find out what ggpoint was about and what happened to it, you might want to discover the current version using the following book as an introduction: http://had.co.nz/ggplot2/book/ There also is a targeted e-mail list whose archives may be instructive http://groups.google.com/group/ggplot2 HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] oggetto gstat
Hi Giuseppe, The language of this mailing list is English. Ciao a tutti ho appena iniziato ad utilizzare R per ora per attuare un'analisi geostatistica di dati. Volevo sapere come poter creare un oggetto gstat partendo da un file testo(che ho gia importato con read.table)e che contiene 3 colonne: x,y,value. Mi servirebbe far questo per costruire un variogramma. So che la domanda molto probabilmente per voi sara' banalevi ringrazio comunque, Giuseppe The details of how to create a gstat object are given in the help page of gstat that you can read after typing in the following commands: library(gstat) ?gstat It apparently contains an example as well on how to create and plot a variogram. HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Extract statistics from lm()
Hi, Hi, perhaps this question was answered previously however I could not find them. My problem is how how to extract a particular statistic from the result given by lm(). For e.g. ctl - c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt - c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group - gl(2,10,20, labels=c(Ctl,Trt)) weight - c(ctl, trt) summary(lm.D9 - lm(weight ~ group)) Call: lm(formula = weight ~ group) Residuals: Min 1Q Median 3Q Max -1.0710 -0.4938 0.0685 0.2462 1.3690 Coefficients: Estimate Std. Error t value Pr(|t|) (Intercept) 5.0320 0.2202 22.850 9.55e-15 *** groupTrt -0.3710 0.3114 -1.1910.249 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.6964 on 18 degrees of freedom Multiple R-squared: 0.07308,Adjusted R-squared: 0.02158 F-statistic: 1.419 on 1 and 18 DF, p-value: 0.249 Here I want to extract the values of t-stat, Pr(|t|) individually. Can anyone please guide me how to get them? summaryD9 - summary(lm.D9 - lm(weight ~ group)) (coefD9 - coef(summaryD9)) coefD9[, t value] coefD9[, Pr(|t|)] In order to get an overview of the structure of an object you can use the str function as in: str(summaryD9) HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How to connect R and WinBUGS/OpenBUGS/LinBUGS in Linux in Feb. 2009
Uwe Ligges wrote: Hi all, I've managed to get JAGS working on my Ubuntu Hardy Linux with a 32-bit computer and AMD processors using R 2.8.1. JAGS is great. I've read that JAGS is the fastest, but that hasn't been my experience. At any rate, I have more experience with WinBUGS under Windows and would like a version of that working as well. It seems like I've read a lot on the subject and tried a lot, but haven't managed to get BUGS to work yet. The most success I've had is to install WinBUGS or OpenBUGS using this method: http://www.math.aau.dk/~slb/kurser/bayes-08/install.html What you also need to know is that you need to open Wine and add a drive. Although Z is recommended, I haven't been able to specify it, but have gotten a D drive to work, using: wine D:/opt/OpenBUGS/winbugs.exe Using this method, OpenBUGS opens. Now, to be able to open it with R. I've read all sorts of discussions about BRugs (which is no longer on CRAN, but old versions can still be found), rbugs, and R2WinBUGS (which I'm used to using on Windows with WinBUGS). Some people say R2WinBUGS cannot run OpenBUGS on Linux, some claim they've done it (I think). It seems the same thing with everything else. I've tried making the linbugs and cbugs file recommended elsewhere online. It's all very confusing. For short: It is quite unlikely that BRugs / OpenBUGS (which is called LinBUGS under Linux) works natively under your Linux (although it might work under very specific settings). As every now and then I get offline requests from people who stumble on this thread http://finzi.psych.upenn.edu/R/Rhelp08/archive/132855.html to give details on how I got OpenBUGS running under GNU/Linux, I made a stripped-down package that does just that. The approach is very, very basic and I only tested this on a few machines and distributions, but if it can be useful to anyone, I temporarily put it up at http://www.openanalytics.be/rOpenBUGS_0.0-1.tar.gz Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] twitter useRs?
Hi José, I wonder if there are any useRs sharing day-to-day realizations/tricks on twitter... Seems like a good place for those things that are good findings, but one is too lazy to blog about them... I don't twitter, but I wrote an R package to read and write tweets from the R command line for twitter and laconi.ca. I will submit it soon, but if anyone is interested contact me off-list. Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Next-generation sequencing data analysis with R
Hi Frank, Hello, everyone! I have a set of proteomic data .And I do a solexa sequencing in the corresponding sample. So I get much mass sequencing data. How can I using R to integrate those two set data. I wonder if some tool or R package would help me? You are more likely to receive a reply on the BioConductor mailing list. BioConductor is an R based platform specifically targeted at the analysis of omic data. http://www.bioconductor.org There also is a special interest group related to the BioConductor efforts in the area of these novel high-througput sequencing technologies. Their mailing list can be found at https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] updating contents of a package
Hi Markus, I read through the Writing R Extensions document and am able to now create my own packages/libraries which so far are just well documented collections of my own R functions. I use package.skeleton() and the tools package to build these packages. However, it is not clear to me how to modify and update a package after its initial creation. How do you elegantly update e.g. the old help file when one added an argument to a function ? How do you keep most of the existing package structure when implementing incremental changes ? Generally speaking you will have your package in a directory we will call PKG_ROOT here, with (more or less) the following structure PKG_ROOT `- inst `- man `- R `- DESCRIPTION `- NAMESPACE If you want to update the package, you edit the help files, the R files, etc. in their respective folders and when you're finished you can build, check and/or install the package using R CMD build PKG_ROOT R CMD check PKG_ROOT R CMD INSTALL PKG_ROOT or what is appropriate for your platform. To build a Windows binary package, e.g. you will need R CMD INSTALL --build PKG_ROOT For this to work you will need R to work from the commandline (add it to your PATH). On Windows you also need to have installed the R Windows Toolset provided by Duncan Murdoch at http://www.murdoch-sutherland.com/Rtools/ If you would like to keep track of the changes from package version to package version, you can maintain a NEWS or ChangeLog file in the inst/ package directory. HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problems in Recommending R
friedrich.lei...@stat.uni-muenchen.de wrote: On Mon, 2 Feb 2009 18:14:03 +0530, Ajay ohri (Ao) wrote: Plain HTML coding is simple enough for this list ( I think)...but aesthetic designhmm In most cases one can do more than most think using HTML and CSS: Our universities corporate design was done by professionals and is backed by a CMS: http://www.uni-muenchen.de Our dpertment didn't want to use the CMS, so we emulated it using HTML, CSS and iframes: http://www.stat.uni-muenchen.de/ which is *much* more convenient to maintain for us: I have a copy of my page on my laptop, I can work on it while offline on a train, etc. I don't want to discuss whether the above examples are aesthetic or not (we are required to follow the coporate design, so have no choice). The main point I want to make is: that everything is static HTML makes life very easy for command line junkies like me ;-) Apart from making life easy for command line junkies, plain HTML is also very search engine friendly. Best, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Test Driven Development in R
Jose Quesada wrote: Hi, I wonder what kind of interest there is on Test Driven Development (TDD) in R. Test Driven Development consists of writing the test before the function, and iteratively build the function until it passes the test. Python and Ruby (specially Ruby) have very strong test-oriented cultures. In fact, in Ruby at least the custom is to do TDD and lately Behavior-driven development (BDD). In BDD, one writes a story of what one would want the code to do. This story is almost native English, and then the test suite converts it into something that the language understand as tests. There are some posts on the list about this, but they are about testing in general (Runit), not TDD. Example: http://thread.gmane.org/gmane.comp.lang.r.general/85047 Recently, I found there is an alpha, but working implementation of TDD for Komodo edit: www.sciviews.org/SciViews-K/index.html The editor has a green bar that becomes red as soon as one edits a function, and that edit breaks the tests. This is tremendously useful. Using Gmane search, the only mention I could find on svUnit was: http://thread.gmane.org/gmane.comp.lang.r.general/136632/focus=136662 I think this could make a great UseR 2009 talk. Ideally, by someone with more R experience than me, and even more ideally by Philippe Grosjean :), but it push comes to shove, I could prepare such a talk. Would this be interesting at all? Are there any resources that I have missed? There is the RUnit package which is a mature xUnit implementation for R. I don't know of a tight integration into an editor (apart from that it is _planned_ for StatET, the Eclipse R plug-in), but as such it is very useful already. http://cran.r-project.org/web/packages/RUnit/index.html HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Can't load Rgraphviz on windows-based R
L.S., I am facing the same problem. I followed the all instructions given in help file and some steps of previous discussion (from google search) but I could not install package Rgraphiviz in windows. I tried even the instructions given to install Bioconductor package then only able to install in Linux systems but not in Windows. In my opinion, Graphiviz package which creating problems in installation of Rgraphiviz packageis, is doing something wrong or needs some special requirements . If some body have idea regarding this problem, I am also enthusiastic to see the solution. Pls, if you find solution, let me know. I installed it (without problems) on someone's Windows PC yesterday. The recipe: 1) download and install the Windows installer for graphviz http://www.graphviz.org/pub/graphviz/stable/windows/graphviz-2.20.3.msi 2) add the path to the graphviz binaries to your PATH environment variable o in the Control Panel right click on System - Properties - Advanced - Environment Variables o edit PATH and add the path to the binaries (ends in ...\bin) 3) install the Rgraphviz package from BioConductor HTH, Tobias --- On Tue, 12/2/08, Prof Brian Ripley [EMAIL PROTECTED] wrote: From: Prof Brian Ripley [EMAIL PROTECTED] Subject: Re: [R] Can't load Rgraphviz on windows-based R To: Daren Tan [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Date: Tuesday, December 2, 2008, 1:47 AM Rgraphviz is a Bioconductor package, so please ask on the apporpriate mailing list (see the posting guide). On Tue, 2 Dec 2008, Daren Tan wrote: Hi, I have problem loading Rgraphviz. Following the instructions specified by the README in Rgraphviz_1.20.3.tar.gz didn't help either. o. set the following Windows environment variables accordingly (control panel - systems - Advanced - Environment Variables ): (a) create new user variables: GRAPHVIZ_INSTALL_DIR (e.g., C:\Graphviz-2.21) -- I stated C:\Graphviz-2.21 (I also tried C:\/Graphviz-2.21) GRAPHVIZ_INSTALL_MAJOR (e.g., 2) -- I stated 2 GRAPHVIZ_INSTALL_MINOR (e.g., 20) -- I stated 21 Notice the way \/ are used for the paths above. (b) add to user variable 'path': $GRAPHVIZ_INSTALL_DIR/bin e.g., C:\Graphviz-2.21\bin -- I stated C:\Graphviz-2.21\bin (I also tried C:\/Graphviz-2.21\/bin) It should be 'PATH', not 'path': environment variables are case-sensitive (in general, not sure what happens with PATH if set there). library(Rgraphviz) Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared library 'D:/PROGRA~1/R/R-28~1.0/library/Rgraphviz/libs/Rgraphviz.dll': LoadLibrary failure: The specified module could not be found. That does not mean Rgraphviz.dll: it means a dependent DLL. You did actually install graphviz, I presume? In addition: Warning messages: 1: closing unused connection 4 (D:/PROGRA~1/R/R-28~1.0/library/Rgraphviz/libs/Rgraphviz.dll) 2: closing unused connection 3 (D:/PROGRA~1/R/R-2.8.0/library/Rgraphviz/libs/Rgraphviz.dll) Error : .onLoad failed in 'loadNamespace' for 'Rgraphviz' Error: package/namespace load failed for 'Rgraphviz' file.exists(D:/PROGRA~1/R/R-28~1.0/library/Rgraphviz/libs/Rgraphviz.dll) [1] TRUE sessionInfo() R version 2.8.0 (2008-10-20) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] grid stats graphics grDevices utils datasets methods base other attached packages: [1] graph_1.20.0 loaded via a namespace (and not attached): [1] cluster_1.11.11 tools_2.8.0 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R and SPSS
There exists a R plug-in for SPSS. You can find it on the SPSS website. ... and there is a page on the R wiki: http://wiki.r-project.org/rwiki/doku.php?id=tips:callingr:spss HTH, Tobias I have a code in R. Could anyone give me the best possible way (or just ways!) to integrate it in SPSS? I would doubt you could do this, but for the least provide commented, minimal, self-contained, reproducible code. It would help if you were more specific. Liviu -- Alain Guillet Statistician and Computer Scientist SMCS - Institut de statistique - Université catholique de Louvain Bureau d.126 Voie du Roman Pays, 20 B-1348 Louvain-la-Neuve Belgium tel: +32 10 47 30 50 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] eclipse and R
Hi Ruud, I forwarded your message to the StatET (R in Eclipse) list; there might be StatET users with a similar setup as yours on that list (and the StatET developer is more likely to pick up your question there). Best, Tobias Hello, I am trying to install Eclipse and R on an amd64 machine running Suse linux 9.3. I have compiled R 2.8.0 with --enable-R-shlib and it seems that compilation was successfull. After starting R, I installed the latest rJava package, from the output: checking whether JRI is requested... yes cp src/libjri.so libjri.so It seems JRI support has been compiled successfully. However, when I try to open R from within Eclipse, I receive an error message: Launching the R Console was cancelled, because it seems starting the Java process/R engine failed. Please make sure that R package 'rJava' with JRI is installed. I can open an R console from the command line, and attach the rJava library without problems. What am I doing wrong here? Thanks, Ruud __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] SAS - surveyselect in R?
Hi Markus, is there a R function or package containing a similar functionality then the SAS PROC SURVEYSELECT? I think you need the sampling package http://cran.r-project.org/web/packages/sampling/index.html It is a package accompanying the book Tillé, Y. (2006). Sampling Algorithms, New York: Springer. Kind regards, Tobias P.S. for the analysis itself, your best choice is the survey package by Thomas Lumley: http://cran.r-project.org/web/packages/survey/index.html Thanks Markus __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] TINN-R's R Explores - Available for other editors?
Hi Stefan, I am using TINN-R for working with R and for that purpose it is a very handy editor, in particular the R-Explorer that shows the existing objects and their properties is worth money. But I want to move to a more flexible editor (in particular for Latex) and was thinking of WinEdt (or maybe Eclipse, because of Java). I know they have capabilities to work directly with R, but has any other editor the same capabilities when it comes down to the R-Explorer? StatET (the Eclipse plug-in for R) has very good Sweave support: - Sweave document templates - content assist for creating new code chunks (with templates) - the basic behaviour of the R-script editor inside code chunks (highlighting, submit to console etc.) - possibility to define several document building configurations (and actions [buttons/keyboard shortcuts] that build the document and open it in a viewer in one go) There currently is no object explorer yet in StatET. Something very interesting, though, is the Outline View for R scripts which shows in an outline what packages are loaded, what classes, methods and functions defined etc. One could consider this to be a The-Source-is-Real-equivalent of an object-browser... Kind regards, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] plot - central limit theorem
Hi Joerg, Is there a way to simulate a population with R and pull out m samples, each with n values for calculating m means? I need that kind of data to plot a graphic, demonstrating the central limit theorem and I don't know how to begin. So, perhaps someone can give me some tips and hints how to start and which functions to use. Have a look at library(TeachingDemos) ?clt.examp HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Automatic code diagramming for R?
Ben Bryant wrote: Greetings - Is anyone aware of an automatic code diagrammer/flow chart creator that works for the R language (either a contributed package, or external software)? I need to explain some code structure of a package I'm working on to non-R users, and would find it extremely helpful to have such a program similar to, for example, Visustin ( http://www.aivosto.com/visustin.html ). I can do it by hand (possibly with the help of the 'diagram' package) but it seems like automated capabilities for recognizing nested structures and argument-passing would be of good general use to package developers. When you document your package using Roxygen, you can generate callgraphs (using the @callGraph and/or @callGraphPrimitives tags). The roxygen package homepage can be found at http://roxygen.org/ and the vignette has an example of a call graph (and how to generate it). HTH, Tobias Much appreciated, -Ben Bryant [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] best material for programmers?
Barry Rowlingson wrote: 2008/9/28 June Kim [EMAIL PROTECTED]: Hello, What is the best material(book, pdfs, ...) for programmers, who have extensive experience in other programming languages, to learn R programming? I think there are many materials on how to use R for specific statistical jobs, but I haven't seen any material particularly designed for R programming. snip I think possibly the most stats-free reference is Chambers' Programming with Data. Get a copy of that... I would rather get the more recent Software for Data Analysis. Programming with R by John Chambers: http://www.springer.com/statistics/computational/book/978-0-387-75935-7 or R Programming for Bioinformatics by Robert Gentleman: http://www.crcpress.com/shopping_cart/products/product_detail.asp?sku=C6367isbn=9781420063677parent_id=pc= HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Dream of a wiki GUI for R
Hi, I am just writing a draft to introduce confidence intervals of various effect sizes to my students. Surely, I'll recommend the package MBESS in R. Currently, it means I have to recommend R's interface at first. As a statistics teacher in a dept of psychology, I often have to reply why not to teach SPSS. Psychologists and their students hate to memorize codes, or even to call any function with a list of parameters. I know if I have an online R platform with a wiki html-form design, I can bypass the function calls and headache parameters to expose the power of R. Rcmdr and its plugins help some, but students like to remember just one menu structure in the SPSS textbook. A wiki interface means they can search and find a complete example in psychology, with self-explained parameter inputs and outputs. Do I actually dream a wikipedia with front forms and back R? Most R fans are wiki fans, but not vice verse. So, I think I should talk my dream here rather than at wikipedia. If you know it had been a practice rather than an idea, please tell me where to write my teaching interface. Some have had similar dreams: http://ideas.repec.org/p/hum/wpaper/sfb649dp2008-030.html http://www.r-project.org/user-2006/Slides/Klinke.pdf http://www.r-project.org/user-2006/Abstracts/Klinke+Schmerbach+Troitschanskaia.pdf HTH, Tobias LI, Xiaoxu School of Arts and Social Sciences, Shenzhen Graduate School, Peking Univ.(Shenzhen Campus) China __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Two way clustering
Hi, I am trying to do two-way clustering (using information of both observation and variables). Is there any package available in R. There is a package for biclustering in development on R-Forge http://r-forge.r-project.org/projects/biclust/ Slides from a recent presentation of the package at useR!2008 can be found at http://www.statistik.uni-dortmund.de/useR-2008//slides/Kaiser+Leisch.pdf Another querry, if somebody can provide related information (website) regarding this statistics, it will be great. You can find a nice review by Iven Van Mechelen et al. at http://ppw.kuleuven.be/okp/_pdf/VanMechelen2004TMCMA.pdf HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Genmod in SAS vs. glm in R
Ajay ohri wrote: Whats the R equivalent for Proc logistic in SAS ? glm with the appropriate family (binomial) and link, I guess. There is a book 'R for SAS and SPSS users' forthcoming http://www.springer.com/statistics/computational/book/978-0-387-09417-5 Is there a stepwise method there ? See library(MASS) ?stepAIC for an example; the following might provide a useful read on stepwise methods: http://www.pitt.edu/~wpilib/statfaq/regrfaq.html How to create scoring models in R , for larger datasets (200 mb), Is there a way to compress and use datasets (like options compress=yes;) Fit the model using glm and 'score' using the predict method. 200 Mb isn't that large anymore, but see Thomas Lumley's biglm package for a bounded-memory version if you're working on limited hardware. HTH, Tobias On Wed, Sep 10, 2008 at 11:12 AM, Peter Dalgaard [EMAIL PROTECTED] wrote: Rolf Turner wrote: For one thing your call to glm() is wrong --- didn't you notice the warning messages about ``non-integer #successes in a binomial glm!''? You need to do either: glm(r/k ~ x, family=binomial(link='cloglog'), data=bin_data, offset=log(y), weights=k) or: glm(cbind(r,k-r) ~ x, family=binomial(link='cloglog'), data=bin_data, offset=log(y)) You get the same answer with either, but this answer still does not agree with your SAS results. Perhaps you have an error in your SAS syntax as well. I wouldn't know. The data created in the data step are not those used in the analysis. Changing to data nelson; etc gives the same result as R on the versions I have available: Analysis Of Parameter Estimates Standard Wald 95% Confidence Chi- ParameterDFEstimate Error Limits SquarePr ChiSq Intercept 1 -3.5866 2.2413 -7.9795 0.8064 2.560.1096 x 1 0.9544 2.8362 -4.6046 6.5133 0.110.7365 Scale 0 1. 0. 1. 1. and Call: glm(formula = r/k ~ x, family = binomial(link = cloglog), data = bin_data, weights = k, offset = log(y)) Deviance Residuals: 1234 0.5407 -0.9448 -1.0727 0.7585 Coefficients: Estimate Std. Error z value Pr(|z|) (Intercept) -3.5866 2.2413 -1.6000.110 x 0.9544 2.8362 0.3360.736 cheers, Rolf Turner On 10/09/2008, at 10:37 AM, sandsky wrote: Hello, I have different results from these two softwares for a simple binomial GLM problem. From Genmod in SAS: LogLikelihood=-4.75, coeff(intercept)=-3.59, coeff(x)=0.95 From glm in R: LogLikelihood=-0.94, coeff(intercept)=-3.99, coeff(x)=1.36 Is there anyone tell me what I did wrong? Here are the code and results, 1) SAS Genmod: % r: # of failure % k: size of a risk set data bin_data; input r k y x; os=log(y); cards; 1350.5 0250.5 0241.0 1241.0 ; proc genmod data=nelson; model r/k = x / dist = binomial link =cloglog offset = os ; Results from SAS Log Likelihood -4.7514 ParameterDFEstimate Error Limits SquarePr ChiSq Intercept 1 -3.6652 1.9875 -7.5605 0.2302 3.400.0652 x1 0.8926 2.4900 -3.9877 5.7728 0.130.7200 Scale 0 1. 0. 1. 1. 2) glm in R bin_data - data.frame(cbind(y=c(5,5,4,4),r=c(1,0,0,1),k=c(3,2,2,2),x=c(0.5,0.5,1.0,1.0))) glm(r/k ~ x, family=binomial(link='cloglog'), data=bin_data, offset=log(y)) Results from R Coefficients: (Intercept)x -3.9911.358 'log Lik.' -0.9400073 (df=2) ## Attention:\ This e-mail message is privileged and confid...{{dropped:9}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list
Re: [R] non-negative least squares
Terry Therneau wrote: I have a problem whose solution requires non-negative least squares. That is minimize sum(y - Xbeta)^2 subject to beta =0 Splus has the nnls.fit command. Is there an R alternative? There is a package nnls on CRAN by Kate Mullen and Ivo van Stokkum: http://cran.r-project.org/web/packages/nnls/index.html HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Quantitative risk analysis with R
Dear Graham, Recently a course with this title, from Vose consulting, was announced on the list. Does anyone know of any books/websites/downloadable tutorials etc that cover the same ground. There is an R package QRMlib on CRAN http://cran.r-project.org/web/packages/QRMlib/index.html that accompanies the book Quantitative Risk Management: Concepts, Techniques and Tools by Alexander J. McNeil, Rüdiger Frey and Paul Embrechts http://www.ma.hw.ac.uk/~mcneil/book/index.html HTH, Tobias ie not just quantitative risk analysis, but specifically on using R for risk analysis and as an alternative to @Risk/Crystal Ball. Many thanks, Graham __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Point-biserial correlation
Angelo Scozzarella wrote: what the command for the point-biserial correlation? Have a look at the polycor package by John Fox. http://cran.r-project.org/web/packages/polycor/index.html HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] CART Analysis
Darin Brooks wrote: Good evening Does R have an extension/add-on package that assists in Classification and Regression Tree analysis? Yes. Abundantly. Have a look under `Recursive Partitioning' in the following Task View: http://cran.r-project.org/web/views/MachineLearning.html HTH, Tobias Checked by AVG. 12:59 PM [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] childNames for xaxis grob (grid package)
Hi Paul, Can someone explain why the childNames below gives character(0) instead of the (canonical) names of the children grobs of the xaxis gTree ? [1] major ticks labels The problem is that you xaxis has an 'at' component of NULL, which means that the axis calculates its tick marks on-the-fly when it comes time to draw (it has to ask the current viewport what the current scale is). This means that there are no grobs representing the major, ticks, and labels stored with the xaxis grob on the display list. These are generated just to draw then thrown away. If you want to modify the look of the grobs that are drawn (then thrown away), you can use the 'edits' component of the xaxis. This provides an edit that will be applied whenever the children are created for drawing. Simple example (assuming your code below has been run) ... grid.edit(xa, edits=gEdit(labels, rot=45)) Thank you very much for the detailed explanation. I was trying to find the grid equivalent of the following base graphics code atPositions - axis(2, labels = FALSE) axis(2, at = atPositions, labels = 10^atPositions) i.e. use the 'at' to make appropriate labels. I guess there is no way to do this without passing a (self-made) 'at' to grid.xaxis in the first place as in library(grid) pushViewport(plotViewport(c(5,4,4,2))) set.seed(120) xData - rpois(5, 12) yData - rpois(5, 12) pushViewport(dataViewport(xData, yData)) grid.points(xData, yData) atPositions - grid.pretty(current.viewport()$xscale) grid.xaxis(name = xa, at = atPositions, label = 10^atPositions) Thanks again, Tobias P.S. Maybe the above could be used to populate the \examples{} section of grid.pretty ? ### minimal example code ### library(grid) pushViewport(plotViewport(c(5,4,4,2))) pushViewport(dataViewport(1:5, 1:5)) grid.points(1:5, 1:5) grid.xaxis(name = xa) grid.get(xa) childNames(grid.get(xa)) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Sorting / editing a table
Jörg Groß wrote: I have a problem sorting a table; When I read a table into R by x - read.table() I get something like this: V1V2V3 yes13 no26 yes39 no412 Now I want to generate a vector of V2. But R should only put in the numbers of V2 into the new vector when there is the entry yes in V1. x - data.frame(V1 = factor(c(yes, no, yes, no)), V2 = 1:4) # vector as result newVector - x$V2[x$V1 == yes] newVector # subsetting a data.frame newX - subset(x, V1 == yes) newX HTH, Tobias __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] childNames for xaxis grob (grid package)
Dear list, Can someone explain why the childNames below gives character(0) instead of the (canonical) names of the children grobs of the xaxis gTree ? [1] major ticks labels Many thanks in advance, Tobias ### minimal example code ### library(grid) pushViewport(plotViewport(c(5,4,4,2))) pushViewport(dataViewport(1:5, 1:5)) grid.points(1:5, 1:5) grid.xaxis(name = xa) grid.get(xa) childNames(grid.get(xa)) ### sessionInfo() ### sessionInfo() R version 2.7.1 (2008-06-23) i486-pc-linux-gnu locale: en_US.UTF-8 attached base packages: [1] grid stats graphics grDevices utils datasets methods [8] base __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Find the closest value in a list or matrix
Daniel Malter wrote: x=c(1:100) your.number=5.43 which(abs(x-your.number)==min(abs(x-your.number))) or [depending on the problem]: which.min(abs(x-your.number)) HTH, Tobias - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von R_Learner Gesendet: Wednesday, July 09, 2008 11:28 AM An: r-help@r-project.org Betreff: [R] Find the closest value in a list or matrix I have a long list of numbers [3.4,5.4,3.67,], and I basically want to find the index of the number closest to this number that I have, let's say 5.43. How would I do this without writing a for loop (I have to do this many times for several lists)? Is there a lookup function in R? Thanks! -- View this message in context: http://www.nabble.com/Find-the-closest-value-in-a-list-or-matrix-tp18363290p 18363290.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Survey questions
Farley, Robert wrote: I found and loaded the survey package. ?rake and ?postStratify seem promising. Are there other packages/procedures I've missed? Are there online references that an R newbie could use to feel comfortable applying these procedures to a survey? How about a reference discussing the details of designing a post survey survey to generate additional weights? There is quite some material on the package homepage at http://faculty.washington.edu/tlumley/survey/ including a page on post-stratification and calibration http://faculty.washington.edu/tlumley/survey/example-poststrat.html Maybe the exemplars of the PEAS project are helpful as well: http://www2.napier.ac.uk/depts/fhls/peas/about.asp HTH, Tobias Thanks in advance, Robert Farley Metro www.Metro.net From: Farley, Robert Sent: Thursday, June 26, 2008 15:48 To: 'r-help@r-project.org' Subject: Survey questions First the R question. I have the results of a rather large survey (thousands of forms, each with dozens of questions) with some existing weights and expansion factors. I wish to add additional weighting factors, based on new information that elements of certain variables should appear in certain proportions. Where should I look in R to develop what is essentially an N-dimensional balancing process. I'd like to develop new weighting factors, without disturbing the existing weightings/expansion. Now the statistics question. Is this appropriate? Where can I find a nearly entry level discussion of the statistical ramifications of this? Is it possible (proper) to re-survey a population to obtain new weights (for previously un-weighted responses) for an original survey? Thanks in advance, Robert Farley Metro 1 Gateway Plaza Mail Stop 99-23-7 Los Angeles, CA 90012-2952 Voice: (213)922-2532 Fax:(213)922-2868 www.Metro.net [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.