Re: [R] vectorized sub, gsub, grep, etc.

2015-07-31 Thread John Thaden
Adam,   You reopened an old thread noting its age, but did you begin at its beginning? > Subject: vectorized sub, gsub, grep, etc.> Date: Oct 7, 2008 > R pattern-matching and replacement functions are > vectorized: they can operate on vectors of targets. > However, they can only use one pattern an

[R] Error when compiling R-2.5.1 / *** [d-p-q-r-tests.Rout] Fehler 1

2015-07-31 Thread Joerg Kirschner
Hi everyone, I am new to Linux and R - but I managed to build R-2.5.1 from source to use it in Genepattern. Genepattern does only support R-2.5.1 which I could not find anywhere for installation via apt-get or in the Ubuntu Software-Centre (I am using Ubuntu 14.04 (Trusty Tahr) 32-bit) But after d

Re: [R] Clarification on Simulation and Iteration

2015-07-31 Thread David Winsemius
On Jul 31, 2015, at 8:41 PM, Christopher Kelvin wrote: > Thanks Dave. > > What I actually want is to obtain say 10, different sets of (n=50) data for > every 10,000 iterations I run. You will realise that the current code > produces one set of data (n=50). I want 10 different sets of 50 observ

Re: [R] vectorized sub, gsub, grep, etc.

2015-07-31 Thread Adam Erickson
I'm not sure I understand your question. Both functions return "" "CD" "" because they perform exact string matching. The first demonstrates how string or character replacements can be vectorized, while the second merely demonstrates how Rcpp can accelerate this type of operation. Cheers, Adam

Re: [R] Clarification on Simulation and Iteration

2015-07-31 Thread David Winsemius
On Jul 31, 2015, at 6:36 PM, Christopher Kelvin via R-help wrote: > Dear All, > I am performing some simulations for a new model. I run about 10,000 > iterations with a sample of 50 datasets and this returns one set of 50 > simulated data. > > Now, what I need to obtain is 10 sets of the 50 s

Re: [R] Clarification on Simulation and Iteration

2015-07-31 Thread Christopher Kelvin via R-help
Thanks Dave. What I actually want is to obtain say 10, different sets of (n=50) data for every 10,000 iterations I run. You will realise that the current code produces one set of data (n=50). I want 10 different sets of 50 observations at one run. I hope this makes sense. Chris Guure On Sa

[R] Clarification on Simulation and Iteration

2015-07-31 Thread Christopher Kelvin via R-help
Dear All, I am performing some simulations for a new model. I run about 10,000 iterations with a sample of 50 datasets and this returns one set of 50 simulated data. Now, what I need to obtain is 10 sets of the 50 simulated data out of the 10,000 iterations and not just only 1 set. The model i

Re: [R] x11() hangs in 3.2.1

2015-07-31 Thread Steven Backus
marc_schwa...@me.com writes: > First, just an FYI, that this would be better posted to R-SIG-Fedora: > https://stat.ethz.ch/mailman/listinfo/r-sig-fedora Thanks, I'll give it a try. > Can you run: > capabilities() > in a terminal session and see what it shows for X11: Yes, here is the outp

Re: [R] x11() hangs in 3.2.1

2015-07-31 Thread Rich Shepard
On Fri, 31 Jul 2015, Marc Schwartz wrote: Can you run: capabilities() FWIW, on Slackware-14.1 I've had no issues with X11(). capabilities() jpeg pngtiff tcltk X11aqua TRUETRUETRUETRUETRUE FALSE h

Re: [R] Exclude 2014 data from mean

2015-07-31 Thread Bert Gunter
This is very basic. Have you made **any** effort to learn R -- e.g. by going through an R tutorial? If not, please do this before posting further. This will save you -- and foks on this list, probably -- a lot of grief in the long (or even short) run. Also, if/when you do post further, post in pla

Re: [R] Exclude 2014 data from mean

2015-07-31 Thread Marc Schwartz
> On Jul 31, 2015, at 1:49 PM, Adam Jauregui wrote: > > Hello R-help, > > I am trying to compute the mean of a quarterback's career fantasy football > stats, but I wish to exclude his 2014 stats from the mean, as that will be > the test data for the model I am trying to build for my academic un

Re: [R] Exclude 2014 data from mean

2015-07-31 Thread Sarah Goslee
Hi Adam, Possibly subset() or & would be helpful. Or even aggregate(), depending on your ultimate goal. Without a reproducible example that includes some sample data provided using dput() (fake is fine), the code you used, and some clear idea of what output you expect, it's impossible to figure o

Re: [R] x11() hangs in 3.2.1

2015-07-31 Thread Marc Schwartz
> On Jul 31, 2015, at 2:22 PM, Steven Backus wrote: > > I'm on RHEL 6.6, R version 3.2.1 Patched (2015-07-30 r68761) -- > "World-Famous Astronaut". Issuing the x11() command hangs R and > does not complete. A window is partially drawn then freezes. > Does anyone know of a solution? > > Thanks

[R] x11() hangs in 3.2.1

2015-07-31 Thread Steven Backus
I'm on RHEL 6.6, R version 3.2.1 Patched (2015-07-30 r68761) -- "World-Famous Astronaut". Issuing the x11() command hangs R and does not complete. A window is partially drawn then freezes. Does anyone know of a solution? Thanks, Steve -- Steven J. BackusComputer System

[R] Exclude 2014 data from mean

2015-07-31 Thread Adam Jauregui
Hello R-help, I am trying to compute the mean of a quarterback's career fantasy football stats, but I wish to exclude his 2014 stats from the mean, as that will be the test data for the model I am trying to build for my academic undergrad research. The code for figuring out the mean of his Yds fo

Re: [R] Using latticeExtra as.layer function with different number of plot panels

2015-07-31 Thread sbihorel
Thanks David, I was hoping for something a little bit more generic and less case-by-case basis. Sebastien On 7/30/2015 3:51 PM, David Winsemius wrote: On Jul 30, 2015, at 8:37 AM, sbihorel wrote: Hi, When the as.layer function is used to overaly 2 lattice plots, there seems to be an assum

Re: [R] R parallel / foreach - aggregation of results

2015-07-31 Thread jim holtman
Try this chance to actually return values: library(doParallel) Simpar3 <- function(n1) { L2distance <- matrix(NA, ncol=n1, nrow=n1) data <- rnorm(n1) diag(L2distance)=0 cl <- makeCluster(4) registerDoParallel(cl) x <- foreach(j=1:n1) %dopar% { library(np) datj <- data

Re: [R] How to simulate informative censoring in a Cox PH model?

2015-07-31 Thread Greg Snow
Daniel, Basically just responding to your last paragraph (the others are interesting, but I think that you are learning as much as anyone and I don't currently have any other suggestions). I am not an expert on copulas, so this is a basic understanding, you should learn more about them if you cho

Re: [R] trojan with R download

2015-07-31 Thread Marc Schwartz
> On Jul 31, 2015, at 5:55 AM, tom walk wrote: > > > > > I am working in China for a month and needed to download an earlier version > of R in order to use Deseq2 and its requirements. The download got to the > last few seconds and hung up. A trojan was found. It could be coincidence > tha

Re: [R] question about implementation of the R

2015-07-31 Thread Marc Schwartz
> On Jul 31, 2015, at 8:38 AM, Beka Biashvili via R-help > wrote: > > Dear Sir/MadamPlease provide me with the information how to implement R, what > is a steps of implementation and obligations, difficulties and etc. > thank you in advance Mr. Beka Biashvili > Quality Management System I wo

[R] trojan with R download

2015-07-31 Thread tom walk
I am working in China for a month and needed to download an earlier version of R in order to use Deseq2 and its requirements. The download got to the last few seconds and hung up. A trojan was found. It could be coincidence that it happened when I was downloading R, or perhaps a man in the mi

[R] question about implementation of the R

2015-07-31 Thread Beka Biashvili via R-help
Dear Sir/MadamPlease provide me with the information how to implement R, what is a steps of implementation and obligations, difficulties and etc. thank you in advance Mr. Beka Biashvili Quality Management System ISO 9001:2008 Lead Auditor 18 Lortkipanidze street, Tbilisi, Georgia. mob: +

Re: [R] R parallel / foreach - aggregation of results

2015-07-31 Thread Jon Skoien
Martin, I think the main problem is that you are trying to assign your results to the result matrix inside the foreach loop. Parallel functions in R are generally not good at updating parts of matrices from the different workers in this way. Instead, using e.g. foreach, each loop of the forea

[R] R parallel / foreach - aggregation of results

2015-07-31 Thread Martin Spindler
Dear all, when I am running the code attached below, it seems that no results are returned, only the predefined NAs. What mistake do I make? Any comments and help is highly appreciated. Thanks and best, Martin Simpar3 <- function(n1) { L2distance <- matrix(NA, ncol=n1, nrow=n1) data <- rn

Re: [R] Looping help

2015-07-31 Thread Jim Lemon
Hi April, You need nested loops for something like this qs<- c(0,0.25,0.5,1,2,4,8,16,32,64) nrows<-dim(Data)[1] nqs<-length(qs) D.mat<-SE.mat<-matrix(NA,nrow=nrows,ncol=nqs) for(row in 1:nrows) { for(qval in 1:nqs) { # perform your calculation and set D.mat[row,qval] and SE.mat[row,qval] to the

Re: [R] R parallel - slow speed

2015-07-31 Thread Martin Spindler
Thank you very much to you both for your help. I knew that parallelizing has some additional "overhead" costs, but I was surprised be the order of magnitude (it was 10 times slower.) Therefore I thought I made some mistake or that there is a more clever way to do it. Best, Martin     Gesendet

Re: [R] R parallel - slow speed

2015-07-31 Thread Martin Spindler
Thank you very much for your help.   I tried it under Unix and then the parallel version was faster than under Windows (but still slower than the non parall version). This is an important point to keep in mind. Thanks for this.   Best,   Martin     Gesendet: Donnerstag, 30. Juli 2015 um 14:56 U