Re: [R] editor for MacOS
On Thu, Dec 16, 2010 at 12:41 PM, Troels Ring tr...@gvdnet.dk 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? The developer of Tinn-R also contributes to the development of the Vim-R-plugin [1] and, consequently. both projects have some similarities. I don't have a Mac OS, but some people reported success using the Vim-R-plugin with the Conque Shell plugin [2] in OS X. The next version of the plugin will have some support to send code to R gui using AppleScript (I can send by email the development version to anyone interested in testing the new feature). The links: [1] http://www.vim.org/scripts/script.php?script_id=2628 [2] http://www.vim.org/scripts/script.php?script_id=2771 Best regards, Jakson Aquino __ 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 file
On Mon, Oct 25, 2010 at 9:11 AM, Mike Marchywka marchy...@hotmail.com wrote: You mention Notepad++, I'm still using vi under cygwin and an ancient copy of ultra edit. People who uses vi or vim may be interested in looking at the plugin to Vim that I'm developing. The plugin works in Windows, Linux and OS X: http://www.vim.org/scripts/script.php?script_id=2628 It's main features are: * Syntax highlighting for R syntax, including: - Special characters in strings. - Functions of all installed packages (must be updated manually). - Special highlighting for R output (.Rout files). * Smart indentation for R syntax. * Integrated communication with R: - Start/Close R. - Send lines, selection, paragraphs, functions, blocks, entire file. - Send commands with the object under cursor as argument: help, args, plot, print, str, summary, example, names. - Send to R the Sweave and pdflatex commands. - Run R inside a Vim's buffer (with Conque Shell plugin; currently available only on Unix -- Linux or OS X). * Omni completion (auto-completion) for R objects (.GlobalEnv and installed packages. The list of installed packages must be updated manually. * Ability to see R's documentation in a Vim's buffer: - Automatic calculation of the best layout of the R documentation buffer (split the window either horizontally or vertically according to the available room). - Automatic formating of the text to fit the panel width. - Send code and commands to R (useful to run examples). - Jump to another R documentation. - Syntax highlighting of R documentation. * Object browser (.GlobalEnv and loaded packages; must be updated manually): - Send commands with object under cursor as argument. - Call R's help() with object under cursor as argument. - Syntax highlighting of the object browser. * Most of the plugin's behavior is customizable. -- Jakson Aquino Federal University of Ceara - Brazil __ 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] Vim-R-plugin now works on Windows too
Dear R users, Some of you may be interested in the following announcement: The Vim-R-plugin now works on Windows too. With the Vim-R-plugin we can send commands to R from the text editor Vim: http://www.vim.org/scripts/script.php?script_id=2628 Notes: On Windows, the plugin copies the command that will be sent to R into the clipboard. Thus, if you have anything in the clipboard it will be lost while using the plugin. The plugin's zip file must be unpacked in the correct directory. I cannot make a vimball of the plugin because it includes binary files (bmp and png). The plugin depends on the correct version of python being installed. It was tested only with Vim 7.3, which requires python 2.7. The plugin's documentation has many more details. Please report any issues! Best regards, Jakson Aquino __ 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] Saving/loading custom R scripts
On Thu, Sep 9, 2010 at 1:14 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: On Thu, Sep 9, 2010 at 7:05 AM, Bos, Roger roger@rothschild.com wrote: Josh, I liked your idea of setting the repo in the .Rprofile file, so I tried it: r - getOption(repos) r[CRAN] - http://cran.stat.ucla.edu; options(repos = r) rm(r) I couldn't understand why to use 4 lines of code... You could try this: options(repos = http://cran.stat.ucla.edu;) __ 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 map Brazil and documentation
2010/7/1 Pablo Cerdeira pablo.cerde...@gmail.com: *If not, can someone help me to find some brazilian map (with states)?* You may look at: http://www.gismaps.com.br/divpol/divpol.htm and ftp://geoftp.ibge.gov.br/mapas/malhas_digitais/ __ 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] Network Analysis
On Wed, Apr 14, 2010 at 07:44:23AM -0800, bchaney wrote: Does anyone have any thoughts on this? I would really appreciate any insights/suggestions that the group could provide. I did not do sophisticated analyzes, but my opinion is that igraph is easier to use and more versatile than statnet. It is also more capable of dealing with big networks. The only issue with igraph functions is that we have to remember that the indexes start at 0 and not 1 as all other R functions. The default igraph plots are very simple, but it is easy to add attributes to an igraph object to make nice graphics. -- Jakson A. Aquino Federal Uni. of Ceara www.lepem.ufc.br - Brazil __ 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] outputing text colors
On Thu, Mar 18, 2010 at 11:27:40PM -0800, rtist wrote: Hi Everyone, And thanks for the replies. I was more specifically referring to the console table output itself. I have a time series that has columns of months and rows of years, and each row,col is a value. I wanted the actual text output value to the console table r,c to have a color corresponding to the value, like ifelse(val0,txt=red,txt=green), so that I can quickly have an overview of returns by color. It looks like the only solution is to use a literal graphics object, and that the above solution is not feasible. I'll look into the graphical type objects. It would be nice to have a function that simply reads a time series object table-f(ts.table) and outputs the above criteria. It's possible to do it (at least in a Linux terminal emulator) with the package xterm256. However, the default print function does not print the scape sequences which the terminal emulator interprets as colors. It would be necessary to create a print method for ts.table (or any other object to be printed in color). Simple example: library(xterm256) x - style(c(-1, 0, 1), fg = c(red, blue, green), check.xterm = F) cat(x, \n) print(x) -- Jakson A. Aquino Federal Uni. of Ceara www.lepem.ufc.br - Brazil __ 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] igraph plot - vertex colors
On Sun, Dec 06, 2009 at 04:34:18PM -0800, Brock Tibert wrote: I have successfully created and analyzed my network data. I am new to R, and Network Analysis too, but I want to color my vertex based on some of the centrality measures calculated. Can someone point me in the right direction? Again, I am new to R, but given how powerful R appears to be, I figure this is probably pretty easy to do, I just wish I could figure it out. Below is an example of how to do it. Suppose you have a igraph object called g: hc5 - heat.colors(5) g.bet - betweenness(g) g.bet.max - max(g.bet) vcolors - 5 - round(4 *(g.bet / g.bet.max)) vcolors - hc5[vcolors] plot(g, vertex.color=vcolors, main = Betweenness) -- Jakson __ 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] Announce: edtdbg, integrating R's debug() with your text editor
On Sun, Dec 06, 2009 at 11:39:06PM -0800, Norm Matloff wrote: I've just developed edtdbg, a small package that integrates R's debug() with one's text editor. Congratulations! I was planning to add this functionality to vim-r-plugin, but I had no idea how to do it. I downloaded edtdbg files from http://heather.cs.ucdavis.edu/~matloff/R/edtdbg/ since the tar.gz package was not available. -- Jakson Aquino __ 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] Get back to the console with ssh access
On Fri, Dec 04, 2009 at 02:23:18AM +0100, Timothée Poisot wrote: I am currently learning how to work with a new shared computer (a Mac pro) in our lab, that is dedicated to execute R code for large simulations (over a few days). We have a VNC option to remote control the computer, with a shared used session, but this is not really needed in most of the cases. I would like to do some ssh access. This is pretty straigthforward, and I am able to launch commands using R -e 'source(myfile.R)' However, it could be useful to check the advancement of the computation from time to time, again via ssh. Is there any way to do this? On Linux you can type in the terminal (I guess the command will work in Mac too): tail -f myfile.Rout Then you hit Ctrl+C to stop tail from following myfile.Rout. Another option would be the use of screen (again, this is a *nix solution that may be available to Mac too). With screen you can run R interactively detach the session, logout, come back and reattach the session. But it seems that tail -f is what you really needs since the R script is finished and you just need to run it. -- Jakson __ 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] Histogram and Density on the the same graph
On Mon, Nov 30, 2009 at 12:01:12PM +0100, Trafim wrote: Dear all, I cannot find a function which would allow drawing hist and density on the same graph. x - seq(1,40,1) y - 2*x+1+5*rnorm(length(x)) hist(y,freq = FALSE) plot(density(y)) The package descr has the function histkdnc() which plots a histogram with kernel density and normal curve. I mantain the package but this function was written by Dirk Enzmann. -- Jakson __ 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] other decriptive stats packages
On Sat, Nov 21, 2009 at 02:01:07PM -0800, frenchcr wrote: i just found the following list, i wondered if anybody could add to this as i have to characterize a large data set and am new to R...the list below was so helpfulcan you add to this??? Just to forestall confusion amongst those who would like to use one of the functions called describe... Hmisc package - describe [...] psych package - describe [...] prettyR package - describe [...] the above are the defaults - the user can specify the name(s) of any function(s) as an argument to the function to customize the display. [...] are there any more packages that help decribe and explore data sets I maintain the package descr, which has the following descriptive functions (in addition to a few others): freq : frequency table crosstab : cross tabulation compmeans : means comparison The three functions accept weights among their arguments. __ 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] Compiling from sources (ubuntu and x11)
On Thu, Nov 19, 2009 at 11:34:22PM -0600, stephen sefick wrote: am using ubuntu 9.10 and I am getting and x11 lib/headers not found. I have installed libx11-dev. I thought this would solve the problem, but it is not. Any help would be appreciated. Looking at output of the configure script you should be able to know what specific file is missing. Then you can Search the contents of packages at http://packages.ubuntu.com/ to know what package contains the missing file. __ 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] Run R code by Vim-R-plugin (How do I to run two or more programs at the same time)?
On Tue, Nov 03, 2009 at 04:59:30PM +0800, Pan, Jia-chiun/潘家群 wrote: I use R on Ubuntu 9.04 by Vim editor with vim-R-plugin. I want to use Vim to run two R programs A.R and B.R. At beginning, I sent A.R to R prompt by pressing \rf and F5 on my keyboard, and it works well. Meanwhile, I want to sent another file B.R to another R window. When I press \rf, the R window shows up and still runs A.R. How could I run B.R in another R window by using vim-R-plugin? You may put the following line in your vimrc: let g:vimrplugin_nosingler = 1 Then, each Vim buffer will start its own R process. __ 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] Boxplot with grouped data
On Thu, Oct 22, 2009 at 04:36:22PM +0100, Paul Smith wrote: Is there some way of drawing a boxplot, with R, when one does not have the original continuous data, but only the data grouped in classes? The function boxplot() can only deal with original data. Do you mean a numeric vector grouped by a factor? If you have a numeric vector x and a categorical variable f, then: boxplot(x ~ f) __ 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] Linear Regression Question
On Tue, Oct 13, 2009 at 11:17:11PM +0200, Alexandre Cohen wrote: I have two vectors rendements_CAC40 and rendements_AlcatelLucent. I use the lm function as follows, and then the sumarry function: regression=lm(rendements_CAC40 ~ rendements_AlcatelLucent); sum=summarry(regression); [...] I would like to access to the p-value field, but I can't find the name of it, as we can see it below: [...] sum is the name of an R function, so in the example below I'll use another name: x - summary(regression) pf(x$fstatistic[1], x$fstatistic[2], x$fstatistic[3], lower.tail = FALSE) Reference: https://stat.ethz.ch/pipermail/r-help/2009-April/194123.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.
[R] Vim-R-plugin (new version)
Dear R users, The author of Tinn-R (Jose Claudio Faria) now is co-author of Vim-R-plugin2, a plugin that makes it possible to send commands from the Vim text editor to R. We added many new key bindings, restructured the menu and created new Tool Bar buttons. The new version is available at: http://www.vim.org/scripts/script.php?script_id=2628 NOTES: (1) Some old key binding changed, including the shortcuts to start R. (2) The plugin doesn't work on Microsoft Windows yet. Below is the plugin's menu structure, and the corresponding default keyboard shortcuts: Start/Close . Start R (default) \rf . Start R --vanilla \rv . Start R (custom) \rc . Close R (no save) \rq . Close R (save workspace) \rw --- Send . Filef5 . File (echo) F5 . Block (cur) f6 . Block (cur, echo) F6 . Block (cur, echo and down) ^F6 . Function (cur) f7 . Function (cur and down) F7 . Selection f8 . Selection (echo)F8 . Selection (and down)f9 . Selection (echo and down) F9 . Linef8 . Line (and down) f9 . Line (and new one) \q --- Control . List space \rl . Clear console \rr . Clear all \rm . Object (print) \rp . Object (names) \rn . Object (str) \rt . Arguments (cur)\ra . Example (cur) \re . Help (cur) \rh . Summary (cur) \rs . Plot (cur) \rg . Plot and summary (cur) \rb . Set working directory (cur file path) \rd . Sweave (cur file) \sw . Sweave and PDF (cur file) \sp . Rebuild (list of objects) \ro Best regards, Jakson Aquino __ 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 (new version)
On Mon, Oct 05, 2009 at 08:03:23PM -0400, Gabor Grothendieck wrote: Looks interesting. Could you make a vimball out of it to facilitate installation. It seems that VimBall is capable of creating vimballs of simple plugins which have a file at ftplugin and a another at doc. The Vim-R-plugin has 18 files, and two symbolic links in 7 directories. __ 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] comma as decimal separator in xtable
On Wed, Sep 16, 2009 at 07:11:46AM +0200, Schalk Heunis wrote: This might be of help, first applies the formatting:print(xtable(prettyNum(d, decimal.mark=,))) Thanks! Your solution works for the example that I gave. However, I failed to provide an example that really represent my problem because I'm passing a lm object to xtable. Currently, I'm using the following function, which also puts the table header in bold font: tabprint - function(x, ...) { colsani - function(x){paste({\\bf , x, }, sep = )} p - capture.output(print(x, caption.placement = top, sanitize.colnames.function = colsani, ...)) writeLines(p, /tmp/xtableOutPut) system(sed -i -e 's/\\([0-9]\\)\\.\\([0-9]\\)/\\1,\\2/g' /tmp/xtableOutPut) p - readLines(/tmp/xtableOutPut) cat(p, sep = \n) } tabprint(xtable(lm.model)) I could call gsub() if I knew the perl regular expression equivalent to the sed one that I'm using. On Tue, Sep 15, 2009 at 5:06 PM, Jakson A. Aquino jaksonaqu...@gmail.comwrote: Hello, How can I make xtable print a comma as decimal separator? Setting the option OutDec isn't enough for xtable: library(xtable) options(OutDec = ,) x - c(1.1, 1.2, 1.3) y - c(2.3, 2.2, 2.1) d - data.frame(x, y) d print(xtable(d)) Thanks! Jakson Aquino __ 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. [[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] comma as decimal separator in xtable
On Wed, Sep 16, 2009 at 01:59:29PM +0200, David Hajage wrote: Perhaps with the dcolumn package ? http://newton.ex.ac.uk/research/qsystems/people/latham/LaTeX/dcolumn.pdf Thanks for the suggestion, but the problem isn't of alignment. When I have commas as decimal separators, the values are aligned because all values of each column were formated with the same number of digits. __ 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] comma as decimal separator in xtable
On Wed, Sep 16, 2009 at 09:14:39AM -0300, Henrique Dallazuanna wrote: Try this also; format(coef(summary(lm.D9)), decimal.mark = ',') or using gsub: apply(coef(summary(lm.D9)), 2, gsub, pattern = \\., replacement = ,) using lm.D9 object from ?lm example. Thanks for your suggestion! The problem with the above approach is that all values get the same formatting. For example, x - c(1.2, 1.2e10) format(x, format = 'g', decimal.mark = ',') [1] 1,2e+00 1,2e+10 What I would like to get was: [1] 1,2 1,2e+10 I already solved my problem, but I'm using an external program to replace . with ,. Perhaps I should ask my question again, with a new subject, since what I need now is the perl regular expression equivalent to the sed command: s/\([0-9]\)a/a\1/ That's is, 1a becomes a1; 3b becomes b3, etc. __ 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] comma as decimal separator in xtable
On Wed, Sep 16, 2009 at 03:29:44PM +0200, David Hajage wrote: But, it seems that dcolumn can change the decimal separator too (see the table on the first page of the pdf document). For example: \documentclass{article} \usepackage{dcolumn} \newcolumntype{d}[1]{D{.}{,}{#1}} \begin{document} results=tex= x - matrix(rnorm(4), 2, 2) library(xtable) xtable(x, align = c(l, |, d{2}, |, c, |)) @ \end{document} It works. Thanks! 2009/9/16 Jakson A. Aquino jaksonaqu...@gmail.com On Wed, Sep 16, 2009 at 01:59:29PM +0200, David Hajage wrote: Perhaps with the dcolumn package ? http://newton.ex.ac.uk/research/qsystems/people/latham/LaTeX/dcolumn.pdf __ 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] comma as decimal separator in xtable
On Wed, Sep 16, 2009 at 03:16:12PM -0300, Henrique Dallazuanna wrote: Try this: sapply(x, format, decimal.mark = ',') Yes, this works as I need, regarding the replacement of dots with commas. Thanks! On Wed, Sep 16, 2009 at 2:06 PM, Jakson A. Aquino jaksonaqu...@gmail.com wrote: On Wed, Sep 16, 2009 at 09:14:39AM -0300, Henrique Dallazuanna wrote: Try this also; format(coef(summary(lm.D9)), decimal.mark = ',') or using gsub: apply(coef(summary(lm.D9)), 2, gsub, pattern = \\., replacement = ,) using lm.D9 object from ?lm example. Thanks for your suggestion! The problem with the above approach is that all values get the same formatting. For example, x - c(1.2, 1.2e10) format(x, format = 'g', decimal.mark = ',') [1] 1,2e+00 1,2e+10 What I would like to get was: [1] 1,2 1,2e+10 __ 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] comma as decimal separator in xtable
Hello, How can I make xtable print a comma as decimal separator? Setting the option OutDec isn't enough for xtable: library(xtable) options(OutDec = ,) x - c(1.1, 1.2, 1.3) y - c(2.3, 2.2, 2.1) d - data.frame(x, y) d print(xtable(d)) Thanks! Jakson Aquino __ 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] Vim R plugin-2
Dear R users, People who uses vim in Linux/Unix may be interested in checking the plugin for R that I'm developing: http://www.vim.org/scripts/script.php?script_id=2628 The plugin includes omni completion for R objects, code indentation and communication with R running in a terminal emulator (xterm or gnome-terminal). This last feature was already present in Johannes Ranke's plugin. I would like to know if you have any suggestions of improvements. Best regards, -- Jakson Aquino Professor of Political Science Federal University of Ceará Brazil __ 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.