Re: [R] splitting a string column into multiple columns faster

2013-06-07 Thread arun
HI, Tried it on 1e5 row dataset: l1<- letters[1:10] s1<-sapply(seq_along(l1),function(i) paste(rep(l1[i],3),collapse="")) set.seed(24) x1<-data.frame(x=paste(paste0(sample(s1,1e5,replace=TRUE),sample(1:15,1e5,replace=TRUE)),paste0(sample(s1,1e5,replace=TRUE),sample(1:15,1e5,replace=TRUE)),paste0(s

[R] Regression Tolerance Intervals - Dr. Young's Code

2013-06-07 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello, Below is a reproducible example to generate the output by using Dr. Young's R code on the above subject . As commented below, the issue is that part of the code (regtol.int and plottol) does not seem to work. I would appreciate receiving your advice toward resolving the issue. Thanks

Re: [R] recode: how to avoid nested ifelse

2013-06-07 Thread Joshua Wiley
I still argue for na.rm=FALSE, but that is cute, also substantially faster f1 <- function(x1, x2, x3) do.call(paste0, list(x1, x2, x3)) f2 <- function(x1, x2, x3) pmax(3*x3, 2*x2, es, 0, na.rm=FALSE) f3 <- function(x1, x2, x3) Reduce(`+`, list(x1, x2, x3)) f4 <- function(x1, x2, x3) rowSums(cbind(

Re: [R] splitting a string column into multiple columns faster

2013-06-07 Thread arun
HI, May be this helps: res<-data.frame(x=x,read.table(text=gsub("[A-Za-z]","",x[,1]),sep="_",header=FALSE),stringsAsFactors=FALSE) res #   x V1 V2 V3 #1 aaa1_bbb1_ccc3  1  1  3 #2 aaa2_bbb3_ccc2  2  3  2 #3 aaa3_bbb2_ccc1  3  2  1 A.K. - Original Message - From: Dimitri Liakho

Re: [R] recode: how to avoid nested ifelse

2013-06-07 Thread Neal Fultz
I would do this to get the highest non-missing level: x <- pmax(3*cg, 2*hs, es, 0, na.rm=TRUE) rock chalk... -nfultz On Fri, Jun 07, 2013 at 06:24:50PM -0700, Joshua Wiley wrote: > Hi Paul, > > Unless you have truly offended the data generating oracle*, the > pattern: NA, 1, NA, should be a da

[R] splitting a string column into multiple columns faster

2013-06-07 Thread Dimitri Liakhovitski
Hello! I have a column in my data frame that I have to split: I have to distill the numbers from the text. Below is my example and my solution. x<-data.frame(x=c("aaa1_bbb1_ccc3","aaa2_bbb3_ccc2","aaa3_bbb2_ccc1")) x library(stringr) out<-as.data.frame(str_split_fixed(x$x,"aaa",2)) out2<-as.data.

Re: [R] recode: how to avoid nested ifelse

2013-06-07 Thread Joshua Wiley
Hi Paul, Unless you have truly offended the data generating oracle*, the pattern: NA, 1, NA, should be a data entry error --- graduating HS implies graduating ES, no? I would argue fringe cases like that should be corrected in the data, not through coding work arounds. Then you can just do: x <-

[R] recode: how to avoid nested ifelse

2013-06-07 Thread Paul Johnson
In our Summer Stats Institute, I was asked a question that amounts to reversing the effect of the contrasts function (reconstruct an ordinal predictor from a set of binary columns). The best I could think of was to link together several ifelse functions, and I don't think I want to do this if the e

Re: [R] SPlus script

2013-06-07 Thread William Dunlap
> Very interesting. But what explicitly happens with ***source()*** > in Splus??? Here are some examples where I use the exprs argument instead of making a tempory file and source the file. I don't know what you are looking for. (The OP never showed any calls to the functions in defined in his s

[R] optim() over bogus parameters

2013-06-07 Thread Ryan Dew
Hello, I'm optimizing a log-likelihood function using the built-in optim() function with the default method. The model is essentially a Weibull distribution where the rate parameter changes based on a single covariate, coded 1 or 0 (that is, when the indicator is 1, the rate parameter changes to a

Re: [R] estimation of covariance matrix of a bivariate normal distribution using maximization of the log-likelihood

2013-06-07 Thread Rolf Turner
See in line below. On 08/06/13 00:00, Hertzog Gladys wrote: Dear all, I’m new in R and I’m trying to estimate the covariance matrix of a bivariate normal distribution by maximizing the log-likelihood. The maximization really has to be performed with the non-linear minimization routine (nlm).

Re: [R] SPlus script

2013-06-07 Thread Rolf Turner
Very interesting. But what explicitly happens with ***source()*** in Splus??? cheers, Rolf On 08/06/13 11:33, William Dunlap wrote: foo <- function(x) { sin(42) x^2 } foo(3) [1] 9 The value of sin(42) is never seen. This is true in b

Re: [R] SPlus script

2013-06-07 Thread William Dunlap
> foo <- function(x) { > sin(42) > x^2 > } > > foo(3) > [1] 9 > > The value of sin(42) is never seen. This is true in both R and S+. Only the return value of a function is available for autoprinting and sin(42) is not the return value. Perhaps you are rem

Re: [R] Trying to install NADA in R 3.0.0

2013-06-07 Thread Rich Shepard
On Fri, 7 Jun 2013, Janh Anni wrote: Try contacting Dr Dennis Helsel, the developer at dhel...@practicalstats.com I don't know what OS David's using, nor if R-3.0.0 is an upgrade or a new installation, but I had no issues when upgrading R from the last 2.x version. The existing NADA in the s

Re: [R] SPlus script

2013-06-07 Thread Rolf Turner
On 07/06/13 23:05, Duncan Murdoch wrote: > On 13-06-06 6:22 PM, Rolf Turner wrote: >> On 07/06/13 03:19, Scott Raynaud wrote: >>> I actually had tried placing arguments in the call but it didn't >>> work. However, I did >>> not think about writing it to a variable and printing. That seems >>>

Re: [R] Trying to install NADA in R 3.0.0

2013-06-07 Thread Janh Anni
Try contacting Dr Dennis Helsel, the developer at dhel...@practicalstats.com On Fri, Jun 7, 2013 at 1:47 PM, David Doyle wrote: > Hello folks, > > I’m trying to install the NADA package in R 3.0.0 > > > It has been archived so I tried to downloading it and installing it > locally. I get > > >

[R] It seams that fast99 function (sensitivity package) does not work out for norm distribution.

2013-06-07 Thread Marino David
Dear all mailing listers, Does Anyone have the same problem as mine when using the fast99 (extended-FAST method) to perform SA of model with norm distribution inputs? See the simple example given following. Any suggestion will be greatly appreciated. Thank you! Marino # Simple example # 1.

Re: [R] matched samples, dataframe, panel data

2013-06-07 Thread arun
Hi, If i replace `lst3` with: lst1<-split(final3,list(final3$year,final3$industry)) lst2<-lst1[lapply(lst1,nrow)>0] lst3<-lapply(lst2,function(x) lapply(x$dimension,function(y) {x1<-x[(y< (x$dimension+x$dimension*0.1)) & (y> (x$dimension-x$dimension*0.1)),]; x1[abs(diff(x1$dimension))<200,]})) #

Re: [R] matched samples, dataframe, panel data

2013-06-07 Thread Cecilia Carmo
Maybe the final result is the same, but I want to impose it on final3, when we are matching the firms. Thanks, Cecília De: arun [smartpink...@yahoo.com] Enviado: sexta-feira, 7 de Junho de 2013 23:04 Para: Cecilia Carmo Cc: R help Assunto: Re: [R] match

Re: [R] matched samples, dataframe, panel data

2013-06-07 Thread arun
HI, Do you want to impose this on 'res' on 'final3'? If it is on `res`: res1<-do.call(rbind,lapply(split(res,(1:nrow(res)-1)%/%2+1),function(x) x[abs(diff(x$dimension))<200,])) row.names(res1)<-1:nrow(res1) nrow(subset(res1,dummy==0)) #[1] 14  nrow(subset(res1,dummy==1)) #[1] 14  head(res1) #  fi

Re: [R] gamm in mgcv random effect significance

2013-06-07 Thread Gavin Simpson
On Fri, 2013-06-07 at 13:12 -0700, William Shadish wrote: > Dear R-helpers, > > I'd like to understand how to test the statistical significance of a > random effect in gamm. I am using gamm because I want to test a model > with an AR(1) error structure, and it is my understanding neither gam >

Re: [R] matched samples, dataframe, panel data

2013-06-07 Thread Cecilia Carmo
Thank you very much. I apologize but I want to ask only one more thing: How to do if I want in addition to impose that the diffence between dimensions doesn't exced an absolute value, for example, 200. Firm 1 continues matching with firm 5 in year 2000 because 2189-2120=69, and 69 is < 10%x212

[R] gamm in mgcv random effect significance

2013-06-07 Thread William Shadish
Dear R-helpers, I'd like to understand how to test the statistical significance of a random effect in gamm. I am using gamm because I want to test a model with an AR(1) error structure, and it is my understanding neither gam nor gamm4 will do the latter. The data set includes nine short interr

[R] RCOde need urgent HELP

2013-06-07 Thread felice
hey i need help with a case in my R project. i have a vector Rt with returns from day 1 till day t now i want to form a new vector r= which is rt = Xt − Xt−1 then i want to definde positive and negative aggregates r(n)+ _t= 1/n (rt +...+rt−n) I {(rt+...+ rt−n) ≥0} r(n)− _t= 1/n (rt +...+rt−n) I

Re: [R] SQL queries in R

2013-06-07 Thread andrija djurovic
myconn<-odbcConnect("testdata") sql.select<-paste("select UNIT_ID from UNITS where (UNIT_TYPE='",unit,"' and COMMUNITY='",property,"')",sep="") unit_ids<-sqlQuery(myconn,sql.select,as.is=TRUE) This should works if myconn and sql.select are defined properly Andrija On Jun 7, 2013 9:58 PM, "Sneha

Re: [R] SQL queries in R

2013-06-07 Thread Sneha Bishnoi
tried as.is ,gives an error, [1] "01000 10054 [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (send())." [2] "[RODBC] ERROR: Could not SQLExecDirect 'select UNIT_ID from UNITS where (UNIT_TYPE='1X1' and COMMUNITY='SAN1193')'" On Fri, Jun 7, 2013 at 3:21 PM, andrija djurovic wrote:

Re: [R] rJava is not loading

2013-06-07 Thread Dimitri Liakhovitski
Thanks again, Brian. Indeed, I had Java for 32 bits. Replaced it and rJava is working now. On Thu, Jun 6, 2013 at 10:58 AM, Prof Brian Ripley wrote: > On 06/06/2013 15:52, Dimitri Liakhovitski wrote: > >> Thank you very much, Brian. >> It's clearly christal clear - but one needs a christal ball

Re: [R] Horizontal labels on a plot

2013-06-07 Thread David Winsemius
On Jun 7, 2013, at 8:38 AM, Shane Carey wrote: > Hi, > > I have a plot with horizontal lables on the x-axis. For example: > Devonian volcanic rocks > n=2 > > with n=2 on a new line. How do I centre n=2 under the " Devonian volcanic > rocks " > label? > > This was my code: text(axis_text, par(

[R] Package 'ChoiceModelR' - Xbetas.csv? Rbetas.csv? betadraws?

2013-06-07 Thread Dimitri Liakhovitski
Hope to get some clarity from the creators of a (wonderful) package ChoiceModelR. I am using the main function 'choicemodelr'. Everything works. ?choicemodelr says "average of MCMC draws of unit-level model coefficients are written to Xbetas.csv" Question 1: Is this a typo? The real file created

Re: [R] SQL queries in R

2013-06-07 Thread andrija djurovic
?sqlQuery as.is - argument Andrija On Jun 7, 2013 9:10 PM, "Sneha Bishnoi" wrote: > Hey all! > > I am trying to select a bunch of id's (data type -character) from a table > and store them in a variable in R > But when i do this, it automatically truncates the leading zero's in id's > even though

Re: [R] glm.nb error

2013-06-07 Thread Daofeng Li
Thanks for all your help. I will try to fix this. Very helpful. Best, Daofeng On Fri, Jun 7, 2013 at 11:25 AM, Sarah Goslee wrote: > As Marc already pointed out, take a close look at this part of your loop: > > R> i <- 6 > R> > R> y <- as.numeric(data[i,-1]) > R> y > [1] 3 3 3 3 4 4 4 4 > R> g

Re: [R] Distance-based non-parametric ANOVA

2013-06-07 Thread Mikhail Umorin
Thank you for the reference. Very helpful Mikhail On Friday, June 07, 2013 12:06:22 R Heberto Ghezzo, Dr wrote: > You better see the original book > Permutation methods - Mielke Jr Paul J, Berry Kenneth J. The programs in > Fortran for the tests are in www.stat.colostate.edu/permute > > R.Hebert

Re: [R] glm.nb error

2013-06-07 Thread Daofeng Li
Thanks Marc...still didn't get it... Tried this... > str(group) num [1:8] 1 1 1 1 0 0 0 0 > fit=glm.nb(y~group) Error in while ((it <- it + 1) < limit && abs(del) > eps) { : missing value where TRUE/FALSE needed > group <- c('1','1','1','1','0','0','0','0') > str(group) chr [1:8] "1" "1" "1" "

Re: [R] glm.nb error

2013-06-07 Thread Daofeng Li
Thank you Sarah and Marc for your fast and nice response. Apology for didn't include all information. I have a input file like following: gene1 18 15 13 13 16 9 20 24 gene2 15 8 8 7 0 12 18 4 gene3 10 9 8 12 9 11 12 12 gene4 4 0 4 3 0 5 0 0 gene5 0 1 0 0 1 5 1 0 gene6 3 3 3 3 4 4 4 4 gene7 0 4 0

[R] SQL queries in R

2013-06-07 Thread Sneha Bishnoi
Hey all! I am trying to select a bunch of id's (data type -character) from a table and store them in a variable in R But when i do this, it automatically truncates the leading zero's in id's even though they are of character type. code is :- >myconn<-odbcConnect("testdata") >sql.select<-paste("

Re: [R] glm.nb error

2013-06-07 Thread Daofeng Li
Sorry Sarah. > dput(dat) structure(list(gene = structure(c(1L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 2L), .Label = c("gene1", "gene10", "gene2", "gene3", "gene4", "gene5", "gene6", "gene7", "gene8", "gene9"), class = "factor"), b1 = c(18L, 15L, 10L, 4L, 0L, 3L, 0L, 4L, 11L, 6L), b2 = c(15L, 8L,

Re: [R] Distance-based non-parametric ANOVA

2013-06-07 Thread Mikhail Umorin
I shall use this from now on. Thank you. On Friday, June 07, 2013 19:19:55 Pascal Oettli wrote: Hello, You also can use the package "sos" >findFn('non-parametric multivariate ANOVA') Regards,Pascal 2013/6/7 Mikhail Umorin Hello, I am comparing treatments by comparing within group to be

Re: [R] Clogit R and Stata

2013-06-07 Thread Richard Beckett
From: peter dalgaard Cc: "r-help@r-project.org" Sent: Friday, June 7, 2013 11:12 AM Subject: Re: [R] Clogit R and Stata Here is the R output: Call: coxph(formula = Surv(rep(1, 1404L), sftpcons) ~ sftptv2a3 + sftptv2a4 +      sftptv2a5 + sftptv2a2 + sf

Re: [R] Distance-based non-parametric ANOVA

2013-06-07 Thread Mikhail Umorin
Yes. vegan and TreMineR. Thank you! On Friday, June 07, 2013 10:52:02 Jose Iparraguirre wrote: > Hi Mikhail, > > After a cursory online search using simply " A new method for non-parametric > multivariate analysis" + CRAN + R, I got the following three packages which > include this paper in their

[R] Trying to install NADA in R 3.0.0

2013-06-07 Thread David Doyle
Hello folks, I’m trying to install the NADA package in R 3.0.0 It has been archived so I tried to downloading it and installing it locally. I get > utils:::menuInstallLocal() package ‘NADA’ successfully unpacked and MD5 sums checked But then when I load it I get > library(NADA) Error in l

[R] coxme p-values

2013-06-07 Thread David Costantini
Hi there does anybody know if the p-values in coxme are given one- or two-tailed by default? Thank you David -Messaggio originale- Da: r-help-boun...@r-project.org per conto di r-help-requ...@r-project.org Inviato: gio 06/06/2013 11.00 A: r-help@r-project.org Oggetto: R-help Digest, Vo

Re: [R] matched samples, dataframe, panel data

2013-06-07 Thread arun
Sorry, it included a case with both values for dummy were 1. lst7<-lapply(lst6,function(x) {lst<-lapply(x,function(y) y[sum(y$dummy)==1,]);lst[lapply(lst,nrow)>0]})  res<-do.call(rbind,lapply(lst7,function(x) do.call(rbind,x)))  row.names(res)<-1:nrow(res) nrow(subset(res,dummy==0)) #[1] 22  nro

Re: [R] glm.nb error

2013-06-07 Thread Sarah Goslee
As Marc already pointed out, take a close look at this part of your loop: R> i <- 6 R> R> y <- as.numeric(data[i,-1]) R> y [1] 3 3 3 3 4 4 4 4 R> group [1] 1 1 1 1 0 0 0 0 R> fit <- glm.nb(y~group) Error in while ((it <- it + 1) < limit && abs(del) > eps) { : missing value where TRUE/FALSE neede

Re: [R] matched samples, dataframe, panel data

2013-06-07 Thread Cecilia Carmo
Sorry, Something is not ok, because when I do > nrow(subset(res,res$dummy==0)) [1] 22 > nrow(subset(res,res$dummy==1)) [1] 24 There the number o observatios in the two subsets is not equal. Thanks again, Cecília De: arun [smartpink...@yahoo.com] En

Re: [R] Conditional coloring of area between curves

2013-06-07 Thread William Dunlap
> that's exactly what I was looking for! That code has some problems if your time series do not cross at the time points. E.g., Duncan's code with some diagnostic plotting is: f0 <- function (site1, site2, x = time(site1), check = FALSE) { stopifnot(length(x) == length(site1), length(

Re: [R] glm.nb error

2013-06-07 Thread Sarah Goslee
Hi, On Fri, Jun 7, 2013 at 11:36 AM, Daofeng Li wrote: > Thank you Sarah and Marc for your fast and nice response. > Apology for didn't include all information. > > I have a input file like following: > > gene1 18 15 13 13 16 9 20 24 > gene2 15 8 8 7 0 12 18 4 > gene3 10 9 8 12 9 11 12 12 > gene4

Re: [R] glm.nb error

2013-06-07 Thread Marc Schwartz
On Jun 7, 2013, at 10:36 AM, Daofeng Li wrote: > Thank you Sarah and Marc for your fast and nice response. > Apology for didn't include all information. > > I have a input file like following: > > gene1 18 15 13 13 16 9 20 24 > gene2 15 8 8

Re: [R] matched samples, dataframe, panel data

2013-06-07 Thread Cecilia Carmo
That's it, the first one! Thank you very much, Cecília Carmo De: arun [smartpink...@yahoo.com] Enviado: sexta-feira, 7 de Junho de 2013 16:43 Para: Cecilia Carmo Cc: R help Assunto: Re: [R] matched samples, dataframe, panel data Hi, Not sure if this is

Re: [R] matched samples, dataframe, panel data

2013-06-07 Thread arun
Hi, Not sure if this is what you wanted.  res<-do.call(rbind,lapply(lst6,function(x) do.call(rbind,x)))  row.names(res)<-1:nrow(res) # this combines the list of lists to a data.frame res[1:4,] #  firm year industry dummy dimension #1    1 2000   20 0  2120 #2    5 2000   20 1 

[R] Horizontal labels on a plot

2013-06-07 Thread Shane Carey
Hi, I have a plot with horizontal lables on the x-axis. For example: Devonian volcanic rocks n=2 with n=2 on a new line. How do I centre n=2 under the " Devonian volcanic rocks " label? This was my code: text(axis_text, par("usr")[three], labels = paste(LABELS, " \n ", " n =", t(t(name.count[,t

Re: [R] matched samples, dataframe, panel data

2013-06-07 Thread arun
Hi, May be this helps:  lst1<-split(final3,list(final3$year,final3$industry)) lst2<-lst1[lapply(lst1,nrow)>0] lst3<-lapply(lst2,function(x) lapply(x$dimension,function(y) x[(y< (x$dimension+x$dimension*0.1)) & (y> (x$dimension-x$dimension*0.1)),])) lst4<-lapply(lst3,function(x) x[lapply(x,nrow)==2

Re: [R] glm.nb error

2013-06-07 Thread Marc Schwartz
On Jun 7, 2013, at 9:44 AM, Daofeng Li wrote: > Dear R Community, > > I have encountered a problem while using the R function glm.nb. > The code that produce the error was following two lines: > > group=c(1,1,1,1,0,0,0,0) > fit=glm.nb(y~group) > > While the y contains 8 sets of number like: >

Re: [R] glm.nb error

2013-06-07 Thread Sarah Goslee
Hi, On Fri, Jun 7, 2013 at 10:44 AM, Daofeng Li wrote: > Dear R Community, > > I have encountered a problem while using the R function glm.nb. > The code that produce the error was following two lines: > > group=c(1,1,1,1,0,0,0,0) > fit=glm.nb(y~group) > > While the y contains 8 sets of number li

Re: [R] Clogit R and Stata

2013-06-07 Thread peter dalgaard
On Jun 7, 2013, at 15:34 , Richard Beckett wrote: > Sorry to once again write a message but I'm once again stumped and am having > no luck finding a solution anywhere else. > > > This question requires some finesse in both R and STATA so hopefully I will > be able to get an answer here. I am

[R] glm.nb error

2013-06-07 Thread Daofeng Li
Dear R Community, I have encountered a problem while using the R function glm.nb. The code that produce the error was following two lines: group=c(1,1,1,1,0,0,0,0) fit=glm.nb(y~group) While the y contains 8 sets of number like: gene2750 1 0 0 1 5 1

[R] ROC Curves for Neural Networks

2013-06-07 Thread Richard Beckett
Trying to plot an ROC curve to determine effectiveness of a neural network model in R.  using the neuralnet package I created nn1a:  nn1a<-neuralnet(warstns ~ aigenlz+ p2l+anoclinv2+flinstab+mill+minconl+fllgdppclz+lpoplz+floil+flmtnestz+c_peaceyears, data=na.omit(dfram1), hidden=4)  then usin

Re: [R] Bionconductor help

2013-06-07 Thread Martin Morgan
On 06/07/2013 07:16 AM, arun wrote: Hi, You would get better response if you post at Bioconductor mailing list. http://www.bioconductor.org/help/mailing-list/ Agreed, though in this case I think ReadAffyData <- function( filename ) { ... Data <- ReadAffy( sampleNames=as.character( Cov$

Re: [R] How to get a subscript of a vector?

2013-06-07 Thread arun
Hi, ?which()  which(A==2) #[1]  3  7 10 A.K. Suppose there is a vector A <- c(1,3,2,6,7,8,2,1,3,2). Now, I want to get the subscript of elements of A which equal 2. How can I do it ? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] increase outlier size on boxplot

2013-06-07 Thread Shane Carey
Great, thanks Sarah On Fri, Jun 7, 2013 at 3:46 PM, Sarah Goslee wrote: > Hi Shane, > > On Fri, Jun 7, 2013 at 10:36 AM, Shane Carey wrote: > > Hi, > > > > Does anybody know how to increase boxplot outlier symbol size? And also > the > > line from min/max to outlier > > If you read the help fo

Re: [R] increase outlier size on boxplot

2013-06-07 Thread Sarah Goslee
Hi Shane, On Fri, Jun 7, 2013 at 10:36 AM, Shane Carey wrote: > Hi, > > Does anybody know how to increase boxplot outlier symbol size? And also the > line from min/max to outlier If you read the help for boxplot, it will send you to the help for bxp for more information on custom plotting. ?bxp

[R] increase outlier size on boxplot

2013-06-07 Thread Shane Carey
Hi, Does anybody know how to increase boxplot outlier symbol size? And also the line from min/max to outlier Thanks -- Shane [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] Get count by day for particular coulmn

2013-06-07 Thread Sarah Goslee
Hi, On Fri, Jun 7, 2013 at 7:38 AM, R_Antony wrote: > here i have a dataframe > > for eg:- > DATETIMECOL_A COL_B COL_C COL_D > 1/1/2007 0:01 0 3 0 0 > 1/1/2007 0:02 0 0 3 0 > 1/1/2007 0:03 0 3 0 0 > ...

Re: [R] Bionconductor help

2013-06-07 Thread arun
Hi, You would get better response if you post at Bioconductor mailing list. http://www.bioconductor.org/help/mailing-list/ A.K. - Original Message - From: Payal Urs To: r-help@r-project.org Cc: Sent: Friday, June 7, 2013 6:12 AM Subject: [R] Bionconductor help Hi I am trying to do so

Re: [R] Evaluation of function names...

2013-06-07 Thread Bert Gunter
Thank you. That answers my question. -- Bert On Fri, Jun 7, 2013 at 7:09 AM, Prof Brian Ripley wrote: > On 07/06/2013 14:49, Bert Gunter wrote: >> >> Folks: >> >> Feel free to provide me a link or reference instead of an answer. >> >> Preamble: >> >> f <- function() function(x)rnorm(x) >> g <- f

[R] Get count by day for particular coulmn

2013-06-07 Thread R_Antony
here i have a dataframe for eg:- DATETIMECOL_A COL_B COL_C COL_D 1/1/2007 0:01 0 3 0 0 1/1/2007 0:02 0 0 3 0 1/1/2007 0:03 0 3 0 0 ... . ... ...

Re: [R] Evaluation of function names...

2013-06-07 Thread Prof Brian Ripley
On 07/06/2013 14:49, Bert Gunter wrote: Folks: Feel free to provide me a link or reference instead of an answer. Preamble: f <- function() function(x)rnorm(x) g <- f() g(3) ## [1] -0.4448492 -0.2379978 -0.4537394 ## But rnorm <- function()1 ## nasty nasty g(3) ## Error in rnorm(x) : unused a

Re: [R] subset with non logical rules

2013-06-07 Thread sisseck.net
aah perfect, exactly what i was looking for! Thank you On Fri, Jun 7, 2013 at 3:24 PM, arun kirshna [via R] wrote: > HI, > Try: > ?split() > > source("http://www.openintro.org/stat/data/cdc.R";) > str(cdc) > #'data.frame':2 obs. of 9 variables: > # $ genhlth : Factor w/ 5 levels "excel

Re: [R] generating a bar chart with two axis for co-linear variable

2013-06-07 Thread Sudha Krishnan
Arun, Perfect, this is what I was looking for. Thanks, Sudha Krishnan -Original Message- From: arun [mailto:smartpink...@yahoo.com] Sent: Friday, June 07, 2013 2:36 AM To: Sudha Krishnan Cc: R help Subject: Re: [R] generating a bar chart with two axis for co-linear variable HI, Not s

[R] cannot load pbdMPI package after compilation

2013-06-07 Thread Antoine Migeon
Hello, I try to install pbdMPI. Compilation successful, but load fails with segfault. Is anyone can help me? R version 3.0.0 pbdMPI version 0.1-6 Intel compiler version 13.1.1 OpenMPI version 1.6.4-1 CPU Intel x86_64 # R CMD INSTALL pbdMPI_0.1-6.tar.gz .. checking for gcc... icc -std=gnu99

[R] Bionconductor help

2013-06-07 Thread Payal Urs
Hi I am trying to do some data analysis using R and Bioconductor. I have a function to read my data called "ReadAffyData" and a function to plot the data called "preqc". I want to know if there is any way I can extract information (read: Data) from the ReadAffyData function into preqc in order t

[R] Problem with ODBC connection

2013-06-07 Thread Christofer Bogaso
Hello again, I am having problem with ODBC connection using the RODBC package. I am basically trying to read the attached Excel-2003 file using RODBC package. Here is my code: > head(sqlFetch(odbcConnectExcel("d:/1.xls"), ""), 30); odbcCloseAll() Criteria s d fd f

[R] Clogit R and Stata

2013-06-07 Thread Richard Beckett
Sorry to once again write a message but I'm once again stumped and am having no luck finding a solution anywhere else. This question requires some finesse in both R and STATA so hopefully I will be able to get an answer here. I am much more adept in R and am trying to replicate the results of

Re: [R] Add prediction interval forest plot (package "meta")

2013-06-07 Thread Michael Dewey
At 12:39 07/06/2013, Bernd Weiß wrote: Am 07.06.2013 13:17, schrieb Michael Dewey: At 19:34 06/06/2013, Bernd Weiss wrote: Dear all, I am struggling to add a prediction interval to a forest plot that was created with forest.meta(), package "meta". I checked the source of forest.meta() and rea

Re: [R] matched samples, dataframe, panel data

2013-06-07 Thread Cecilia Carmo
Again my problem, better explained. #I have a data panel of thousands of firms, by year and industry and #one dummy variable that identifies one kind of firms (1 if the firm have an auditor; 0 if not) #and another variable the represents the firm dimension (total assets in thousand of euros) #

Re: [R] Get count by day for particular coulmn

2013-06-07 Thread arun
HI, Please dput() the example data. """ Could anyone give a help ASAP ?" You have been posting for long time and your many posts show this "ASAP". I know that you got comments to that and also advised to dput() the data.  Formatting your data took some time.  Would it be better to follow th

[R] Evaluation of function names...

2013-06-07 Thread Bert Gunter
Folks: Feel free to provide me a link or reference instead of an answer. Preamble: f <- function() function(x)rnorm(x) g <- f() g(3) ## [1] -0.4448492 -0.2379978 -0.4537394 ## But rnorm <- function()1 ## nasty nasty g(3) ## Error in rnorm(x) : unused argument(s) (x) ## of course f <- function

Re: [R] subset with non logical rules

2013-06-07 Thread arun
HI, Try: ?split() source("http://www.openintro.org/stat/data/cdc.R";)  str(cdc) #'data.frame':    2 obs. of  9 variables: # $ genhlth : Factor w/ 5 levels "excellent","very good",..: 3 3 3 3 2 2 2 2 3 3 ... # $ exerany : num  0 0 1 1 0 1 1 0 0 1 ... # $ hlthplan: num  1 1 1 1 1 1 1 1 1 1 ...

Re: [R] arima time series in R

2013-06-07 Thread Prof Brian Ripley
On 07/06/2013 12:21, Aakanksha Dahiya01 wrote: Hi Could just anyone explain me the coefficients in the output of arima model The person who wrote the help page already did, but that is hardly 'just anyone'. timeseriesarima <- arima(series, order=c(1,1,2)) timeseriesarima Series: series

Re: [R] Add prediction interval forest plot (package "meta")

2013-06-07 Thread Bernd Weiß
Am 07.06.2013 13:17, schrieb Michael Dewey: At 19:34 06/06/2013, Bernd Weiss wrote: Dear all, I am struggling to add a prediction interval to a forest plot that was created with forest.meta(), package "meta". I checked the source of forest.meta() and realized that it is heavily relying on grid

[R] arima time series in R

2013-06-07 Thread Aakanksha Dahiya01
Hi Could just anyone explain me the coefficients in the output of arima model timeseriesarima <- arima(series, order=c(1,1,2)) > timeseriesarima Series: series ARIMA(1,1,2) Coefficients: ar1 ma1 ma2 0.9744 -1.7695 0.7873 s.e. 0.0310 0.0481 0.0426 sigma^2 estimated

Re: [R] Add prediction interval forest plot (package "meta")

2013-06-07 Thread Michael Dewey
At 19:34 06/06/2013, Bernd Weiss wrote: Dear all, I am struggling to add a prediction interval to a forest plot that was created with forest.meta(), package "meta". I checked the source of forest.meta() and realized that it is heavily relying on grid. I am lacking any experience with grid graph

Re: [R] SPlus script

2013-06-07 Thread Duncan Murdoch
On 13-06-06 6:22 PM, Rolf Turner wrote: On 07/06/13 03:19, Scott Raynaud wrote: I actually had tried placing arguments in the call but it didn't work. However, I did not think about writing it to a variable and printing. That seems to have done the trick. Funny, I don't remember having to

Re: [R] R help on loops

2013-06-07 Thread Berend Hasselman
Please, please do not use html formatted mail. It is clearly requested by the mailing list The code of your last mail is a mess and when replying it becomes even more of a mess. I told you to do siml[g,] <- optm(perm=20) See the comma after g. and not what you are now doing with siml[g]<-op

Re: [R] R help on loops

2013-06-07 Thread Berend Hasselman
On 07-06-2013, at 11:57, Laz wrote: > Dear Berend, > > I have made some changes but I still get errors: > > For reproducibility, > Rspatswap() is a function which originally returns a single value. For > example Rspatswap(...) and you get 0.8 > > So, run Rspatswap() 20 times and store all

Re: [R] Distance-based non-parametric ANOVA

2013-06-07 Thread Pascal Oettli
Hello, You also can use the package "sos" >findFn('non-parametric multivariate ANOVA') Regards, Pascal 2013/6/7 Mikhail Umorin > Hello, > > I am comparing treatments by comparing within group to between group > distances like > described in > > MJ Anderson. 2001. A new method for non-param

Re: [R] R help on loops

2013-06-07 Thread Laz
Hi, I am almost getting there, but still have errors. Thanks for your help. I have tried improving but I get the following errors below: >itn<-function(it){ +siml<-matrix(NA,ncol=5,nrow=it) +for(g in 1:it){ +siml[g]<-optm(perm=20)[g] +} +siml +} >itn(3) [,1] [,2] [,3] [,4] [,5] [1,

Re: [R] Distance-based non-parametric ANOVA

2013-06-07 Thread Jose Iparraguirre
Hi Mikhail, After a cursory online search using simply " A new method for non-parametric multivariate analysis" + CRAN + R, I got the following three packages which include this paper in their references: vegan, mefa, and TraMineR. I don't know whether they deal with the procedure you are after

Re: [R] Conditional coloring of area between curves

2013-06-07 Thread Roland Pape
Hi Duncan, that's exactly what I was looking for! The series have common times, so that's no problem. Thanks a lot! Roland Von: Duncan Murdoch [murdoch.dun...@gmail.com] Gesendet: Donnerstag, 6. Juni 2013 18:45 An: Roland Pape Cc: r-help@r-project.org Bet

Re: [R] R help on loops

2013-06-07 Thread Laz
Dear Berend, For reproducibility, Rspatswap() is a function which originally returns a single value. For example Rspatswap(...) and you get 0.8 So, run Rspatswap() 20 times and store all the values. Then from these 20 values, calculate the calculate average, sd,se,min,max to get something si

[R] matched samples, dataframe, panel data

2013-06-07 Thread Cecilia Carmo
I R-helpers #I have a data panel of thousands of firms, by year and industry and #one dummy variable that separates the firms in two categories: 1 if the firm have an auditor; 0 if not #and another variable the represents the firm dimension (total assets in thousand of euros) #I need to creat

Re: [R] R help on loops

2013-06-07 Thread Berend Hasselman
On 07-06-2013, at 10:59, Laz wrote: > Dear R users, > > I am stuck here: My first function returns a vector of 5 values. > In my second function, I want to repeat this, a number of times, say 10 > so that I have 10 rows and five columns but I keep on getting errors. > > See the code and resul

Re: [R] boot, what am I doing wrong?

2013-06-07 Thread Jorge I Velez
Hi there, You need a function for your statistic: > boot(x, function(x, index) mean(x[index]), R = 1000) ORDINARY NONPARAMETRIC BOOTSTRAP Call: boot(data = x, statistic = function(x, index) mean(x[index]), R = 1000) Bootstrap Statistics : original biasstd. error t1* 0.40696

Re: [R] R help on loops

2013-06-07 Thread Laz
Dear R users, I am stuck here: My first function returns a vector of 5 values. In my second function, I want to repeat this, a number of times, say 10 so that I have 10 rows and five columns but I keep on getting errors. See the code and results below: optm <-function(perm, verbose = FALSE) {

[R] boot, what am I doing wrong?

2013-06-07 Thread Rguy
I am getting started with the boot package and boot command. As a first step I tried the following. Something is wrong, but i can't see what. Any advice would be much appreciated. > x = runif(10) > mean(x) [1] 0.467626212374307 > boot(x, mean, R=100) Error in mean.default(data, original, ...) :

[R] Function nlme::lme in Ubuntu (but not Win or OS X): "Non-positive definite approximate variance-covariance"

2013-06-07 Thread Giuseppe Pagnoni
Dear all, I am estimating a mixed-model in Ubuntu Raring (13.04¸ amd64), with the code: fm0 <- lme(rt ~ run + group * stim * cond, random=list( subj=pdSymm(~ 1 + run), subj=pdSymm(~ 0 + stim)), data=mydat1) When I check the

Re: [R] Identifying breakpoints/inflection points?

2013-06-07 Thread dchristop
You can try this: library(inflection) #you have to instsall package inflection first a<-findiplist(cbind(year),cbind(piproute),1) a The answer: [,1] [,2] [,3] [1,]5 35 1986.0 [2,]5 30 1983.5 shows that the total inflection point is between 1983 and 1986, if we treat data as fi

Re: [R] sample size determination - comparing means for different size samples

2013-06-07 Thread Rui Barradas
Hello, At an R prompt, type ?power.t.test Hope this helps, Rui Barradas Em 06-06-2013 20:58, Rebecca Greenblatt escreveu: Looking to determine sample sizes for both my experimental and control groups (I want only a small portion of my participants in my experimental condition) in order to co

[R] 5 remaining places on stats course in Edmonton

2013-06-07 Thread Highland Statistics Ltd
There are 5 remaining places on the following course: Data exploration, regression, GLM & GAM. With introduction to R When: 26 - 30 August 2013. Where: Edmonton, Canada For details, see: http://www.highstat.com/statscourse.htm Course flyer: http://www.highstat.com/Courses/Flyer2013_09Canada.pd