[R] reviews for quality control

2012-08-31 Thread carol white
Hi, It might be a trivial question but I just wonder if you could advise good theoretical tutorials, reviews on NGS (different platforms) quality control like nucleotides quality by cycle, nucleotides frequency by cycle, GC content and distribution, K-mer frequency by cycle as well as quality

Re: [R] apply -- data.frame

2012-08-31 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Sam Steingold Sent: Thursday, August 30, 2012 9:17 PM To: William Dunlap Cc: r-help@r-project.org Subject: Re: [R] apply -- data.frame * William Dunlap jqha...@gvopb.pbz

Re: [R] fitting lognormal censored data

2012-08-31 Thread Berend Hasselman
On 31-08-2012, at 03:54, Salma Wafi wrote: Hi , I am trying to get some estimator based on lognormal distribution when we have left,interval, and right censored data. Since, there is now avalible pakage in R can help me in this, I had to write my own code using Newton Raphson method

Re: [R] apply -- data.frame

2012-08-31 Thread Rui Barradas
Hello, Em 31-08-2012 11:35, Martin Maechler escreveu: Hi Rui, I think when people are asking how to do such basic things in R, the answer should *not* be to use a (non-base / -recommended) package... You're right, that's why I've called it an alternative. but then, you may have really

[R] Class that wraps Data Frame

2012-08-31 Thread Ramiro Barrantes
Hello, I have again a good practices/programming theory question regarding data.frames. One of the fundamental objects that I use is the data frame with a particular set of columns that I would fill or get information from, and an entire system would revolve around getting information from or

Re: [R] fitting lognormal censored data

2012-08-31 Thread Rich Shepard
On Thu, 30 Aug 2012, Salma Wafi wrote: I am trying to get some estimator based on lognormal distribution when we have left,interval, and right censored data. Take a look at the NADA package. For left-censored data you can use cenmle with dist = 'lognormal'. Survival analyses work well for

Re: [R] reviews for quality control

2012-08-31 Thread Bert Gunter
Completely OT for this list. Post elsewhere. -- Bert On Thu, Aug 30, 2012 at 11:13 PM, carol white wht_...@yahoo.com wrote: Hi, It might be a trivial question but I just wonder if you could advise good theoretical tutorials, reviews on NGS (different platforms) quality control like

Re: [R] How to modify the values of the parameters passing via ...

2012-08-31 Thread Bert Gunter
The OP appears to be confused about argument lists and argument passing (which has nothing to do with imputed variables btw). Here is an explanation providing a more explicit explanation than RUI's post. The formal arguments of fun1 are x, y,and z. The formal arguments of fun2 are aa and ... So,

Re: [R] Problem installing Rmpi with Open MPI

2012-08-31 Thread Linh Tran
I took some time to think about it and don't know that it was the case for me. If the openmpi-bin package was missing, I wouldn't have been able to even use openmpi and during my trouble, I would check the mpi software each time I installed it to verify that it worked (using some simple

[R] test Breslow-Day for svytable??

2012-08-31 Thread Diana Marcela Martinez Ruiz
Hi all, I want to know how to perform the test Breslow-Day test for homogeneity of odds ratios (OR) stratified for svytable. This test is obtained with the following code: epi.2by2 (dat = daty, method = case.control conf.level = 0.95, units = 100, homogeneity = breslow.day, verbose =

Re: [R] latex \subfloat{} incompatible with sweave/knitr code

2012-08-31 Thread Liviu Andronic
On Thu, Aug 30, 2012 at 12:50 AM, Yihui Xie x...@yihui.name wrote: Do you know what environments are allowed inside \subfloat{}? The No, not really. From what I can tell, \subfloat{} is provided by the `subfig' package. Here's what their docs have to say about compatibility with verbatim and

Re: [R] test Breslow-Day for svytable??

2012-08-31 Thread John Sorkin
Suggstion: You need to send us more information, i.e. the code that genrated daty, or a listing of the daty structure, and a copy of the listing produced by epi.2by2 John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of

[R] Histogram to KDE

2012-08-31 Thread firdaus.janoos
Hello, I wanted to know if there was way to convert a histogram of a data-set to a kernel density estimate directly in R ? Specifically, I have a histogram [bins, counts] of samples {X1 ... XN} of a quantized variable X where there is one bin for each level of X, and I'ld like to directly get a

[R] Help on numerical object and ifelse function

2012-08-31 Thread Andras Farkas
Dear All,   this is probably an easy one but I can not get a handle on it:   x -c(1,2,3,4,5) y -c(6,7,8,9,10) z -15 w -ifelse(z14,x,y)   this will give me a value of 1 for w. What I would like to get is the whole string of x, so that w would become a numeric object of 5 characters exactly the

[R] loading 'RcmdrPlugin.FactoMineR' pachage in R

2012-08-31 Thread Mahbubeh Parsaeian
- Forwarded Message - From: Mahbubeh Parsaeian mahbobehparsae...@yahoo.com To: r-help@r-project.org r-help@r-project.org Cc: Sent: Friday, 31 August 2012, 17:18 Subject: loading 'RcmdrPlugin.FactoMineR' pachage in R Hi everybody I have a question about loading

Re: [R] dynamic list in aggregate()

2012-08-31 Thread arun
HI, You can also use these in addition to aggregate: tapply(dat$x,INDEX=dat[grp],mean) library(plyr) ddply(dat,.(dat[grp]$a,dat[grp]$d),summarize,mean(x)) #  dat[grp]$a dat[grp]$d ..1 #1  b  c  0.26781378 #2  b  d -0.01994023 #3  c  e 

[R] loading 'RcmdrPlugin.FactoMineR' pachage in R

2012-08-31 Thread Mahbubeh Parsaeian
Hi everybody I have a question about loading 'RcmdrPlugin.FactoMineR' pachage in R. I have installed Rcmdr, FactoMineR and 'RcmdrPlugin.FactoMineR. when I want to load this package, at first a message inform me I should load the following list of packages: FactoMineR, ellipse, lattice, cluster,

Re: [R] Help on numerical object and ifelse function

2012-08-31 Thread Rui Barradas
Hello, w2 - if(z 14) x else y w2 The difference is that ifelse is vectorized and returns an object of the same length as the condition. Since length(z 14) == 1, it only returns x[1] (or y[1], were the condition FALSE). Hope this helps, Rui Barradas Em 31-08-2012 12:55, Andras Farkas

Re: [R] differences between survival models between STATA and R

2012-08-31 Thread Göran Broström
On Mon, Jul 9, 2012 at 3:59 PM, Terry Therneau thern...@mayo.edu wrote: Without more information, we can only guess what you did, or what you are seeing on the page that is different. I'll make a random guess though. There are about 5 ways to paramaterize the Weibull distribution. The

Re: [R] Class that wraps Data Frame

2012-08-31 Thread David Winsemius
On Aug 31, 2012, at 5:57 AM, Ramiro Barrantes wrote: Hello, I have again a good practices/programming theory question regarding data.frames. One of the fundamental objects that I use is the data frame with a particular set of columns that I would fill or get information from, and an

Re: [R] Problem installing Rmpi with Open MPI

2012-08-31 Thread Dirk Eddelbuettel
On 31 August 2012 at 07:14, Linh Tran wrote: | I took some time to think about it and don't know that it was the case | for me. If the openmpi-bin package was missing, I wouldn't have been | able to even use openmpi and during my trouble, I would check the mpi | software each time I installed

Re: [R] Class that wraps Data Frame

2012-08-31 Thread Bert Gunter
To add to what David said ... Of course, there are already S3 getters and setters methods for data frames ([.data.frame and [-.data.frame )*. These could clearly be extended -- i.e. the data.frame class could be extended and appropriate S3 methods written. Whether you use S3 or S4 depends on the

Re: [R] apply -- data.frame

2012-08-31 Thread Sam Steingold
* David Winsemius qjvafrz...@pbzpnfg.arg [2012-08-30 10:14:34 -0700]: str( as.data.frame( do.call(rbind, strsplit(c(a,1,b,2,c,3), ,) ) , stringsAsFactors=FALSE) ) 'data.frame': 3 obs. of 2 variables: $ V1: chr a b c $ V2: chr 1 2 3 do.call/rbind appeared to be TRT. I tried it and

Re: [R] latex \subfloat{} incompatible with sweave/knitr code

2012-08-31 Thread Yihui Xie
OK, then this turns out to be a pure LaTeX problem. Thanks for the experiments and examples, and they worked very well for me. It seems subcaption is on the radar of LyX 2.1 now. Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: 515-294-2465 Web: http://yihui.name Department of Statistics,

Re: [R] Histogram to KDE

2012-08-31 Thread David L Carlson
Using a data.frame x with columns bins and counts: x - structure(list(bins = c(3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5), counts = c(1, 1, 2, 3, 6, 18, 19, 23, 8, 10, 6, 2, 1)), .Names = c(bins, counts), row.names = 4:16, class = data.frame) This will

Re: [R] test Breslow-Day for svytable??

2012-08-31 Thread David Winsemius
On Aug 31, 2012, at 7:20 AM, Diana Marcela Martinez Ruiz wrote: Hi all, I want to know how to perform the test Breslow-Day test for homogeneity of odds ratios (OR) stratified for svytable. This test is obtained with the following code: epi.2by2 (dat = daty, method = case.control

Re: [R] Class that wraps Data Frame

2012-08-31 Thread Martin Morgan
I guess there are two issues with data.frame. It comes with more than you probably want to support (e.g., list and matrix- like subsetter [, the user expecting to be able to independently modify any column). And it comes with less than you'd like (e.g., support for a 'column' of S4 objects).

Re: [R] apply -- data.frame

2012-08-31 Thread William Dunlap
It is hard to help when you don't give an example of your input data and what you want to be computed (in a form one can source or copy into an R session). Is the following something like what you are doing? Suppose you have a function that takes a file name and returns a list of things of

Re: [R] Help on numerical object and ifelse function

2012-08-31 Thread arun
Hi, Try this: z1-c(z,z,z,z,z)  ifelse(z114,x,y) #[1] 1 2 3 4 5 A.K. - Original Message - From: Andras Farkas motyoc...@yahoo.com To: r-help@r-project.org r-help@r-project.org Cc: Sent: Friday, August 31, 2012 7:55 AM Subject: [R] Help on numerical object and ifelse function Dear All,  

[R] splits with 0s in middle columns

2012-08-31 Thread Sapana Lohani
Hi, A column of my df looks like A 10/20/30 40/20 60/10/10/5 80/10 I want to split it such that the last column has the last composition and if there are not enough the middle columns get the 0s. That way my df would look like A1 A2 A3 A4 10 20 0 30 40 0 0 20 60 10 10 5 80 0 0 10 How can

[R] Creating an array from correlation matrices

2012-08-31 Thread Max Frisch
Hello everyone, a hopefully easy to solve problem from an R novice... I try to calculate a number of correlation matrices that finally should be combined in a three-dimensional array. Here the my code with an R dataset as an example. --- ## Creation an array of

[R] Conditional merging in R if then statement

2012-08-31 Thread ramoss
1)I am wandering how the following SQL statement can be written in R language w/o using sqldf: create table detail2 as select a.* from detail a, pdetail b where a.TDATE=b.TDATE and(a.STIM = b.STIM and a.STIM =b.MAXTIM) 2) when try if then in R it only applies to the 1st row not to

Re: [R] Creating an array from correlation matrices

2012-08-31 Thread Rui Barradas
Hello, You create a 3d array X and then index it as if it were 1d. Correction: TS - EuStockMarkets [...etc...] for (t in T[1:(length(T)-n)]){ X[ , , t] - cor(TS[t:(t+n), 1:ncol(TS)], use = pairwise.complete.obs) } # Calculate correlation matrices Also, 't' and 'T' are not good names, the

Re: [R] splits with 0s in middle columns

2012-08-31 Thread Rui Barradas
Hello, Try the following. A - c( 10/20/30, 40/20, 60/10/10/5, 80/10) fun - function(X){ xname - deparse(substitute(X)) s - strsplit(X, /) n - max(sapply(s, length)) tmp - numeric(n) f - function(x){ x - as.numeric(x) m - length(x) tmp[n] - x[m]

Re: [R] apply -- data.frame

2012-08-31 Thread Sam Steingold
* William Dunlap jqha...@gvopb.pbz [2012-08-31 18:38:52 +]: Is the following something like what you are doing? yes, absolutely, thanks a lot! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://pmw.org.il http://dhimmi.com

Re: [R] Conditional merging in R if then statement

2012-08-31 Thread David Winsemius
On Aug 31, 2012, at 10:11 AM, ramoss wrote: 1)I am wandering how the following SQL statement can be written in R language w/o using sqldf: create table detail2 as select a.* from detail a, pdetail b where a.TDATE=b.TDATE and(a.STIM = b.STIM and a.STIM =b.MAXTIM) 2) when

[R] how to find the index of points selected from a scatter plot?

2012-08-31 Thread Michael
Hi all, I am using locator to select the points from a scatter plot... This is all fine. But the problem is that the locator only returns the axis values of the selected points. Instead, I would like to get the index of these select points... The axis values are real-values so it's a bit hard

Re: [R] splits with 0s in middle columns

2012-08-31 Thread Rui Barradas
Hello, It means you should update your version of R. paste0 was introduced with R 2.15.0 as is the shorter equivalent of paste(..., sep = ) I'm sending you a small correction just in case some of the elements in A only have 1 element. fun - function(X){ xname - deparse(substitute(X))

Re: [R] how to find the index of points selected from a scatter plot?

2012-08-31 Thread Bert Gunter
?which ## as in ix - which(x==values) -- Bert On Fri, Aug 31, 2012 at 2:09 PM, Michael comtech@gmail.com wrote: Hi all, I am using locator to select the points from a scatter plot... This is all fine. But the problem is that the locator only returns the axis values of the selected

Re: [R] how to find the index of points selected from a scatter plot?

2012-08-31 Thread Peter Ehlers
On 2012-08-31 16:03, Bert Gunter wrote: ?which ## as in ix - which(x==values) -- Bert Or maybe ?identify. Peter Ehlers On Fri, Aug 31, 2012 at 2:09 PM, Michael comtech@gmail.com wrote: Hi all, I am using locator to select the points from a scatter plot... This is all fine. But

[R] using apply with sparse matrix from package Matrix

2012-08-31 Thread Jennifer Lyon
Hi: I was trying to use apply on a sparse matrix from package Matrix, and I get the error: Error in asMethod(object) : Cholmod error 'problem too large' at file ../Core/cholmod_dense.c, line 106 Is there a way to apply a function to all the rows without bumping into this problem? Here is a

Re: [R] test Breslow-Day for svytable??

2012-08-31 Thread Thomas Lumley
On Sat, Sep 1, 2012 at 4:27 AM, David Winsemius dwinsem...@comcast.net wrote: On Aug 31, 2012, at 7:20 AM, Diana Marcela Martinez Ruiz wrote: Hi all, I want to know how to perform the test Breslow-Day test for homogeneity of odds ratios (OR) stratified for svytable. This test is obtained

Re: [R] predict.lm(...,type=terms) question

2012-08-31 Thread jjthaden
The error is generated in the last line of code shown here from predict.lm predict.lm function (object, newdata, se.fit = FALSE, scale = NULL, df = Inf, interval = c(none, confidence, prediction), level = 0.95, type = c(response, terms), terms = NULL, na.action = na.pass, pred.var

Re: [R] Conditional merging in R if then statement

2012-08-31 Thread Jeff Newmiller
1) just because you don't use sqldf doesn't make it better. merge only does the join, not the conditions, so you have to apply them after merge. Untested (you should provide a complete example): result - merge ( detail, pdetail, by=TDATE, suffixes=c(.a,.b) ) result - subset ( result, STIM.a =

Re: [R] predict.lm(...,type=terms) question

2012-08-31 Thread jjthaden
On Aug 30, 2012, at 4:35 PM, David Windemius wrote: David said my newdata data frame 'new' must have a column named 'area'. It did. Nonetheless predict.lm throws an error with type = terms and newdata = new. I see nothing in the predict.lm documentation that bars this usage. Is there a bug?

[R] R package fields: Thin-plate splines question

2012-08-31 Thread Rebecca Clark
Greetings, R helpers, I have been using the Tps() function in the fields package to model response surfaces for some dietary research in crickets. Overall, I have *three* independent variables of interest, two continuous variables (protein and carbohydrate) and one categorical variable

Re: [R] splits with 0s in middle columns

2012-08-31 Thread arun
Hi, Try this: dat1-read.table(text= 10/20/30 40/20 60/10/10/5 80/10 ,sep=,header=FALSE,stringsAsFactors=FALSE) dat2-gsub((.*)/(.*),\\1 0 0 \\2, gsub((.*)/(.*)/(.*),\\1 \\2 0 \\3, gsub((.*)/(.*)/(.*)/(.*),\\1 \\2 \\3 \\4,dat1$V1))) dat3-data.frame(do.call(rbind,strsplit(dat2, )))  

Re: [R] splits with 0s in middle columns

2012-08-31 Thread arun
HI, You can also use ifelse: dat1-read.table(text= 10/20/30 40/20 60/10/10/5 80/10 ,sep=,header=FALSE,stringsAsFactors=FALSE) dat2-ifelse(nchar(gsub([^/],,dat1$V1))==1,gsub((.*)/(.*),\\1 0 0 \\2,dat1$V1),ifelse(nchar(gsub([^/],,dat1$V1))==2,gsub((.*)/(.*)/(.*),\\1 \\2 0