Re: [R] Flexible rbind

2011-03-17 Thread sayan dasgupta
Hi Santosh, May be you looking at something like this merge(d,dNewTests,by="type",all=TRUE) On Thu, Mar 17, 2011 at 1:03 PM, Santosh Srinivas < santosh.srini...@gmail.com> wrote: > Dear All, > > I am trying to create a empty structure that I want to fill gradually > through the code. > I want

Re: [R] grep for strings

2010-12-05 Thread sayan dasgupta
Hi Santosh, you may also try require(stringr) x <- "abcdefghijklcd" str_locate_all(x,"cd") On Sun, Dec 5, 2010 at 1:21 PM, Petr Savicky wrote: > On Sun, Dec 05, 2010 at 08:04:08AM +0530, Santosh Srinivas wrote: > > I am trying to find the function where I can search for a pattern in a > > te

Re: [R] Row-wise recurive function call

2010-11-09 Thread sayan dasgupta
; and provide commented, minimal, self-contained, reproducible code. > > > > -- > Dimitris Rizopoulos > Assistant Professor > Department of Biostatistics > Erasmus University Medical Center > > Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands &g

Re: [R] postForm() in RCurl and library RHTMLForms

2010-11-04 Thread sayan dasgupta
_histvalues.htm"; How do I submit the arguments like FromDate, ToDate, Symbol using postForm() and submit the query to get the similar table. On Fri, Nov 5, 2010 at 6:43 AM, Duncan Temple Lang wrote: > > > On 11/4/10 2:39 AM, sayan dasgupta wrote: > > Hi RUsers, > >

[R] postForm() in RCurl and library RHTMLForms

2010-11-04 Thread sayan dasgupta
="S&P CNX NIFTY", "Indicesdata"="Get Details"), .opts=list(useragent = getOption("HTTPUserAgent"))) But it doesn't give me desired result Also I was trying to use the function getHTMLFormDescription from the package

Re: [R] For loop with ifelse help

2010-09-23 Thread sayan dasgupta
Hi Pele, I think this should work file1$state.sum <- rowSums(file2[file1$state,6:10],0) On Thu, Sep 23, 2010 at 7:46 PM, Steve Lianoglou < mailinglist.honey...@gmail.com> wrote: > Hi Pele, > > On Wed, Sep 22, 2010 at 12:40 PM, Pele wrote: > > > > Hi David - thanks for your suggestion, but I a

Re: [R] Tobit Modelling

2010-08-06 Thread sayan dasgupta
Hi Patrick, Well tobit regression is applicable when there is censoring in the data. Tobit regression in R has been implemented in the R package survival An easy user interface is there in the packages AER and Zelig. On Fri, Aug 6, 2010 at 6:12 AM, Patrick Sessford wrote: > > > Dear R-users, >

Re: [R] Zoo - bug ???

2010-07-13 Thread sayan dasgupta
On Tue, Jul 13, 2010 at 5:27 PM, Gavin Simpson wrote: > On Tue, 2010-07-13 at 17:13 +0530, sayan dasgupta wrote: > > Hi folks, > > > > I am confused whether the following is a bug or it is fine > > > > Here is the explanation > > > > a <- zoo(c(NA,

[R] Zoo - bug ???

2010-07-13 Thread sayan dasgupta
Hi folks, I am confused whether the following is a bug or it is fine Here is the explanation a <- zoo(c(NA,1:9),1:10) Now If I do rollapply(a,FUN=mean,width=3,align="right") I get > rollapply(a,FUN=mean,width=3,align="right") 3 4 5 6 7 8 9 10 NA NA NA NA NA NA NA NA But I shouldn't be

Re: [R] Correlation Matrix

2010-06-10 Thread sayan dasgupta
Hi , you can try using cov2cor(vcov(lm(calorie~height))) to get the correlation matrix of estimated coefficients boltonboy999 wrote: > > Hi everyone, > > This is pretty urgent so if anyone can help that would be great. > > I have a table of information. The categories are weight, height

Re: [R] Computing day-over-day log return for a matrix containing multiple time series

2010-06-06 Thread sayan dasgupta
Hope this helps a <- matrix(runif(150),nrow=3,ncol=50) p2r <- function(x) 100 * diff(log(x)) t(apply(a,1,function(x){p2r(c(x))})) On Mon, Jun 7, 2010 at 8:41 AM, Anyi Zhu wrote: > Hi all, > > > > Thanks a lot for anyone's help in advance. > > > > I am trying to find a way to compute the day

Re: [R] fitting multinomial logistic regression

2010-06-06 Thread sayan dasgupta
To install this package, start R and enter: source("http://bioconductor.org/biocLite.R";) biocLite("globaltest") Hope that helps On Mon, Jun 7, 2010 at 12:15 AM, Ben Bolker wrote: > suman dhara gmail.com> writes: > > > I want to fit a multinomial logistic regression in R.I think mlog

Re: [R] parttioning a matrix corresponding to different levels of y

2010-06-03 Thread sayan dasgupta
Suman take a look if this suffices your purpous x <- data.frame(y=as.factor(sample(0:2,1000,replace=TRUE)),x=runif(1000)) x1 <- x[x$y==0,] x2 <- x[x$y==1,] x3 <- x[x$y==2,] On Fri, Jun 4, 2010 at 10:29 AM, suman dhara wrote: > Sir, > I have a problem regarding partitioning a matrix.I state my pr

Re: [R] Removing columns from data frame referenced by column index

2010-05-31 Thread sayan dasgupta
data(airquality) head(airquality) Suppose you want to remove the 1st and the 3rd column this will do airquality[,-c(1,3)] suman dhara wrote: > > Can you suggest me any way to remove a column of a data frame by the > column > number,not by the column name. > > Thanks, > Suman Dhara > >

Re: [R] subsetting

2010-05-30 Thread sayan dasgupta
try t <- subset(r, (r$time == "0h" & r$strain == "ROC"), select= c(time,strain, gene, deltact)) Do ?"&" to understand the difference between & and && . ANJAN PURKAYASTHA wrote: > > Hi, > I have a data-frame, r (column names below), that needs subsetting: > date, time, strain, gene, deltac

Re: [R] Creating data frames in a loop

2010-05-12 Thread sayan dasgupta
Well you can try for(i in 1:20) { assign(paste("ddat",i,sep="_"),data) other processing... } -- View this message in context: http://r.789695.n4.nabble.com/Creating-data-frames-in-a-loop-tp2195527p2195681.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] scope of a function + lazy evaluation

2010-05-10 Thread sayan dasgupta
On Mon, May 10, 2010 at 3:44 PM, Patrick Burns wrote: > You are missing 'force'. > > See 'The R Inferno' page 90. > > In this case you can define: > > f <- function(y) { force(y); function() y} > > > > On 10/05/2010 11:06, sayan dasgupta wr

[R] scope of a function + lazy evaluation

2010-05-10 Thread sayan dasgupta
Hey guys, I have a doubt here , It is something simple I guess, what am I missing out here ?? f <- function(y) function() y tmp <- vector("list", 5) for (i in 1:5) tmp[[i]] <- f(i) tmp[[1]]() # returns 5; z <- f(6) tmp[[1]]() # still returns 5; it should return 6 "ideally" right ??? Even if I

[R] A distance measure between top-k list

2010-04-22 Thread sayan dasgupta
L, 13L), .Label = c("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P&q

[R] parallel computing--help

2009-12-30 Thread sayan dasgupta
e exists a file RSOCKnode.R on the specified directory SSH is working fine as I have checked system("ssh -l me 'ip to another computer on the network' ls") Works fine and I am getting the list of files on the other computer on my machine Please help! Sayan Da

[R] library(survival)-- cluster

2009-12-10 Thread sayan dasgupta
up error ? Thanks and Regards Sayan Dasgupta [[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 pro

Re: [R] Serial Correlation in panel data regression

2009-12-08 Thread sayan dasgupta
soline) then if I do library(lmtest) coeftest(m1,vcovHC) Will it take account of the heteroskedasticity and serial correlation( within country ) of the data Regards Sayan Dasgupta On Tue, Dec 8, 2009 at 8:29 PM, Millo Giovanni wrote: > Dear Sayan, > > there is a vcovHC method

[R] Serial Correlation in panel data regression

2009-12-07 Thread sayan dasgupta
Dear R users, I have a question here library(AER) library(plm) library(sandwich) ## take the following data data("Gasoline", package="plm") Gasoline$f.year=as.factor(Gasoline$year) Now I run the following regression rhs <- "-1 + f.year + lincomep+lrpmg+lcarpcap" m1<- lm(as.formula(paste("lgaspca

Re: [R] apply on two lists?

2009-11-30 Thread sayan dasgupta
why don't you try this tmp=list(X=x,Y=y) and then lapply(tmp,fun(..)) Peng Yu wrote: > > x=list(a=c(1,2),b=c(3,4,5)) > y=list(a=c(1,2),b=c(3,4,5)) > lapply(seq(along=x),function(i){cbind(x[[i]],y[[i]])}) > > > I need to apply some function on two lists. I have to use the index to > do as shown

Re: [R] How to see any R package code?

2009-11-05 Thread sayan dasgupta
You have to use R CMD REMOVE "Package NAME" to uninstall the package(from Command line) . Then R CMD build brainwaver.tar.gz the R CMD INSTALL brainwaver.tar.gz to re install then the changes you made you be effective Zhijiang Wang wrote: > > >Dear All, >I have modified a .R code (/us

Re: [R] How to see any R package code?

2009-11-05 Thread sayan dasgupta
You have to use R CMD REMOVE "Package NAME" to uninstall the package(from Command line) . Then R CMD build brainwaver.tar.gz the R CMD INSTALL brainwaver.tar.gz to re install then the changes you made you be effective Zhijiang Wang wrote: > > >Dear All, >I have modified a .R code (/us

[R] Package zelig

2009-10-30 Thread sayan dasgupta
x27;x' must be numeric Please help where it is going wrong Thanks and Regards Sayan Dasgupta [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting g