Re: [R] separate numbers from chars in a string

2014-07-31 Thread arun
If you have some variations of the order of numbers followed by chars, library(stringr) v1 - c(absdfds0213451ab, 123abcs4145) pattern=c([A-Za-z]+, \\d+) do.call(`Map`,c(c,lapply(pattern, function(.pat) str_extract_all(v1, .pat #[[1]] #[1] absdfds ab  0213451 #[[2]] #[1] abcs 123  4145

Re: [R] separate numbers from chars in a string

2014-07-31 Thread Uwe Ligges
On 31.07.2014 04:46, carol white wrote: There are some level of variation either chars followed by numbers or chars, numbers, chars Perhaps, I should use gsub as you suggested all and if the string is composed of chars followed by numbers, it will return the 3rd part empty? Please read

Re: [R] a knitr question

2014-07-31 Thread Rolf Turner
On 31/07/14 12:06, Joshua Wiley wrote: SNIP I don't think that this is about prompts in interactive R, but when a document is knit, should the echoed code in the report have prompts or not. Surely that should be left up to the user. And as Erin pointed out in her second message, it is.

Re: [R] fancyRpartPlot and the title at the bottom of the plot....

2014-07-31 Thread Graham Williams
Hopefully, better late than never Current version of Rattle (3.1.4) supports sub= in fancyRpartPlot() to override or get rid of that useless title, as in: fancyRpartPlot(m, sub=) Install it using: install.packages(rattle, repos=http://rattle.togaware.com;, type=source) Graham Williams

Re: [R] a knitr question

2014-07-31 Thread Ista Zahn
On Thu, Jul 31, 2014 at 4:28 AM, Rolf Turner r.tur...@auckland.ac.nz wrote: On 31/07/14 12:06, Joshua Wiley wrote: SNIP I don't think that this is about prompts in interactive R, but when a document is knit, should the echoed code in the report have prompts or not. Surely that should be

Re: [R] a knitr question

2014-07-31 Thread Duncan Murdoch
On 30/07/2014, 11:12 PM, Yihui Xie wrote: No. That is not my suggestion. Joshua Wiley correctly explained what I was suggesting. Prompts are useful in the R console, but not necessarily in a report. Okay, then we agree. For Erin's purpose (teaching), it is helpful to beginners if the document

[R] Need(?) way to create a picture (or plot) of a data.frame

2014-07-31 Thread John McKown
OK, I'm probably using the wrong tool for this, but I'm doing everything else in this project in R, so I'm looking at how to do this too. I create a number of graphs using ggplot2. I use the png() function before the print(..graph.variable..) in order to create a PNG file which can be embedded in

Re: [R] Need(?) way to create a picture (or plot) of a data.frame

2014-07-31 Thread Duncan Murdoch
On 31/07/2014, 7:49 AM, John McKown wrote: OK, I'm probably using the wrong tool for this, but I'm doing everything else in this project in R, so I'm looking at how to do this too. I create a number of graphs using ggplot2. I use the png() function before the print(..graph.variable..) in order

Re: [R] Need(?) way to create a picture (or plot) of a data.frame

2014-07-31 Thread Jim Lemon
On Thu, 31 Jul 2014 06:49:22 AM John McKown wrote: OK, I'm probably using the wrong tool for this, but I'm doing everything else in this project in R, so I'm looking at how to do this too. I create a number of graphs using ggplot2. I use the png() function before the print(..graph.variable..)

Re: [R] Need(?) way to create a picture (or plot) of a data.frame

2014-07-31 Thread Duncan Murdoch
On 31/07/2014, 8:06 AM, Duncan Murdoch wrote: On 31/07/2014, 7:49 AM, John McKown wrote: OK, I'm probably using the wrong tool for this, but I'm doing everything else in this project in R, so I'm looking at how to do this too. I create a number of graphs using ggplot2. I use the png()

Re: [R] separate numbers from chars in a string

2014-07-31 Thread Marc Schwartz
On Jul 31, 2014, at 3:17 AM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: On 31.07.2014 04:46, carol white wrote: There are some level of variation either chars followed by numbers or chars, numbers, chars Perhaps, I should use gsub as you suggested all and if the string is

Re: [R] XLConnect on Linux Mint Maya

2014-07-31 Thread Keith S Weintraub
Ista Et Al, Unfortunately your suggestion to use remove.packages did exactly the reverse of what you thought would happen. I have cleaned up my installation but still have trouble getting rJava to install properly and of course that means that XLConnect cannot install either.

Re: [R] Need(?) way to create a picture (or plot) of a data.frame

2014-07-31 Thread John McKown
On Thu, Jul 31, 2014 at 7:34 AM, Jody White j...@jody-white.com wrote: What about xtable? If it's going to PowerPoint and you're using RStudio, what about using knitr and exporting to PowerPoint and use xtable? I'll need to look at those. I'm new to R and am not familiar with either of those

Re: [R] simulation dichotomous data

2014-07-31 Thread Charles Determan Jr
Thanoon, You should still send the question to the R help list even when I helped you with the code you are currently using. I will not always know the best way or even how to proceed with some questions. As for to your question with the code below. Firstly, there is no 'phi' method for cor in

[R] Regex - subsetting parts of a file name.

2014-07-31 Thread arnaud gaboury
A directory is full of data.frames cache files. All these files have the same pattern: df.some_name.RData my.cache.list - c(df.subject_test.RData, df.subject_train.RData, df.y_test.RData, df.y_train.RData) I want to keep only the part inside the two points. After lots of headache using grep()

[R] Multiple plots and postscripts using split function

2014-07-31 Thread fd
Hi, I'm relatively new to R and I would like to do the following: I have a .csv file with four columns (NAME, ID, YEAR, VALUE) and would like to do several xy plots with the year on the x-axis and the data values (measurements) on the y-axis and after that export the different plots to

Re: [R] Need(?) way to create a picture (or plot) of a data.frame

2014-07-31 Thread David Winsemius
On Jul 31, 2014, at 4:49 AM, John McKown wrote: OK, I'm probably using the wrong tool for this, but I'm doing everything else in this project in R, so I'm looking at how to do this too. I create a number of graphs using ggplot2. I use the png() function before the print(..graph.variable..)

Re: [R] Regex - subsetting parts of a file name.

2014-07-31 Thread S Ellison
I want to keep only the part inside the two points. After lots of headache using grep() when trying something like this: grep('.(.*?).','df.subject_test.RData',value=T) Does anyone have any suggestion ? gsub(df\\.(.+)\\.RData, \\1, 'df.subject_test.RData') Steve E

Re: [R] Regex - subsetting parts of a file name.

2014-07-31 Thread arun
Try: gsub(.*\\.(.*)\\..*,\\1, my.cache.list) [1] subject_test  subject_train y_test    y_train #or library(stringr) str_extract(my.cache.list, perl('(?=\\.).*(?=\\.)')) [1] subject_test  subject_train y_test    y_train  A.K. On Thursday, July 31, 2014 11:05 AM, arnaud gaboury

Re: [R] Regex - subsetting parts of a file name.

2014-07-31 Thread Sarah Goslee
Hi, Here are two possibilities: R as.vector(sapply(my.cache.list, function(x)strsplit(x, \\.)[[1]][2])) [1] subject_test subject_train y_testy_train R gsub(df\\.(.*)\\.RData, \\1, my.cache.list) [1] subject_test subject_train y_testy_train Note that . will match any

Re: [R] Need(?) way to create a picture (or plot) of a data.frame

2014-07-31 Thread John Kane
Have a look at http://www.r-bloggers.com/getting-tables-from-r-output/ for a suggestion. using raw xtable output You end up having to format the table in a word processor or spreadsheet, but it seems to work. I keep forgetting just how ugly html tables can be. John Kane Kingston ON Canada

Re: [R] Regex - subsetting parts of a file name.

2014-07-31 Thread arnaud gaboury
R as.vector(sapply(my.cache.list, function(x)strsplit(x, \\.)[[1]][2])) [1] subject_test subject_train y_testy_train R gsub(df\\.(.*)\\.RData, \\1, my.cache.list) [1] subject_test subject_train y_testy_train Note that . will match any character, while \\. matches a

Re: [R] Eager To Learn And Contribute!

2014-07-31 Thread John Kane
If you are new, one of the best ways to learn and then start contributing is to just read the R-help list a lot. Even if you don't think that you can answer a specific question you see a lot and you can try to anwser questions even if you don't post a solution. Welcome to R. John Kane

[R] keep information on the number of warnings

2014-07-31 Thread Luis Borda de Agua
I’m using R 3.1.0 in OS X 10.9.4 (Mavericks) I’m running a function Y that calls a function X which occasionally generates a warning. Say that I call the function X 1000 times, and out of these 1000 times I get the following message: There were 36 warnings (use warnings() to see them) How

Re: [R] keep information on the number of warnings

2014-07-31 Thread David Winsemius
On Jul 31, 2014, at 9:26 AM, Luis Borda de Agua wrote: I’m using R 3.1.0 in OS X 10.9.4 (Mavericks) I’m running a function Y that calls a function X which occasionally generates a warning. Say that I call the function X 1000 times, and out of these 1000 times I get the following

Re: [R] a knitr question

2014-07-31 Thread Yihui Xie
Great. I also said I see the point of keeping prompts, and that is why the chunk option prompt=TRUE is provided in knitr. I may not agree with your preference, but that does not mean I should stop you completely from having your own preference. Regards, Yihui -- Yihui Xie xieyi...@gmail.com Web:

Re: [R] Multiple plots and postscripts using split function

2014-07-31 Thread David L Carlson
This is one of those times when you would do better to just use a loop. It will be easier to debug and to see what is going on. Replace the sapply() call with for (i in 1:length(ind)) { postscript(names(ind[i])) par(mar=c(6,8,6,5), cex=0.8)

Re: [R] Writing to gzcon with rawConnection

2014-07-31 Thread Ben Sully
Did you ever manage to solve this problem, Jamie? Ben On Friday, 2 May 2014 19:50:27 UTC+1, Jamie Olson wrote: I would like to encode/decode some text with deflate/gzip, but I'm having trouble. Decoding values from a rawConnection is fairly straightforward, but I'm having trouble

Re: [R] interactive labeling/highlighting on multiple xy scatter plots

2014-07-31 Thread Shi, Tao
I looked at ggvis briefly before, but didn't notice its brushing capability.   Now you explained. Thanks, both! Tao On Wednesday, July 30, 2014 9:50 AM, Ramnath Vaidyanathan ramnath.vaidyanat...@mcgill.ca wrote: ggvis is an excellent option to do this kind of stuff. The only limitation

Re: [R] interactive labeling/highlighting on multiple xy scatter plots

2014-07-31 Thread Greg Snow
The brushing may only be available in the development version of ggvis. See here for the example: https://github.com/rstudio/webinars/tree/master/2014-01 On Thu, Jul 31, 2014 at 10:17 AM, Shi, Tao shida...@yahoo.com wrote: I looked at ggvis briefly before, but didn't notice its brushing

Re: [R] Multiple plots and postscripts using split function

2014-07-31 Thread Don McKenzie
While you’re at it, assign length(ind) to a variable before starting the loop. Otherwise length() is called at each iteration. e.g., ind.length - length(ind) for (i in 1:ind.length) { etc. On Jul 31, 2014, at 10:57 AM, David L Carlson dcarl...@tamu.edu wrote: This is one of those times

Re: [R] XLConnect on Linux Mint Maya

2014-07-31 Thread Ista Zahn
Hi Keith, So the plot thickens. How is it that you have R 3.1.1 but apt-get install rJava gives you an old version of the package? This may be potentially difficult to figure out, but you can try some easy things first. If I were you I would start with sudo apt-get remove r-base r-devel sudo

Re: [R] Multiple plots and postscripts using split function

2014-07-31 Thread Jeff Newmiller
The range vector is evaluated at the start of the loop, so it is only evaluated once. ind.length would be an unnecessary extra variable. --- Jeff NewmillerThe . . Go Live...

Re: [R] Multiple plots and postscripts using split function

2014-07-31 Thread William Dunlap
Even better is to replace for(i in 1:length(something)) {} with for(i in seq_along(something)) {} The former gives you 2 iterations, the 2nd probably causing an error, when length(something) is 0. The latter always gives one iteration per element of 'something'. Bill Dunlap TIBCO

Re: [R] XLConnect on Linux Mint Maya

2014-07-31 Thread Keith S Weintraub
Thanks Ista, I will try your procedure next Tuesday. This is going pretty slow because I only work at that machine Tuesday-Thursday. I will let you know how it goes (lucky you!) by private email as I don't think there is any use in bothering all of r-help. After trying your suggestions next

[R] Working with the Animation package in R

2014-07-31 Thread Christofer Bogaso
Hi again, I am trying to create a animation with Animation package. I preferred to create animation with HTML file than through GIF because this requires additional installation of ImageMagick which is not possible with my system. So I just run following code available in help page: saveHTML({

[R] Configuring Rserve for remote access on Windows Server

2014-07-31 Thread Javier Guillen
I am trying to configure Rserve for use with Tableau on a Windows Server 2012, however no remote telnet commands are successful on port 6311. Is there any link or guide you can recommend on configuring this package on a windows environment? Thanks! Javier Guillen [[alternative HTML

Re: [R] Working with the Animation package in R

2014-07-31 Thread Spencer Graves
On 7/31/2014 1:16 PM, Christofer Bogaso wrote: Hi again, I am trying to create a animation with Animation package. I preferred to create animation with HTML file than through GIF because this requires additional installation of ImageMagick which is not possible with my system. So I just run

[R] how to extract word before /// in a data frame contain many thousands rows.

2014-07-31 Thread Stephen HK Wong
Dear All, I appreciate if you can help me out this. I have a data frame contains many thousand of rows, with some rows that has /// symbol, as shown in in row 2, I want to extract word before ///, such as in this case, CDH23. Many thanks. Probe.Set.IDGene.Symbol 1 1552301_a_at

Re: [R] lattice, latticeExtra: Adding moving averages to double y plot

2014-07-31 Thread Duncan Mackay
Hi Anna I have gone back to doubleYScale because I started following the wrong section that I had before so it was quicker to do doubleYScale You need to have 2 lattice objects and components are taken from each below so use the function str on the three objects to see library(lattice)

[R] hist3D (output control)

2014-07-31 Thread rsnell
The script below generates two side by side 3D histograms (OS - Windows, RStudio v 98.507). I'm trying to avoid using a TIFF file editor to cleanup the figure, and would like to create fully reproducible output using R script. Help would be appreciated to: -reverse the direction of the