Re: [R] string problems in R

2010-03-26 Thread muting
Thank you I am waiting for the R to finish running the loop..I hope it will work.. muting Quoting "jholtman [via R]" : > > > > try this: > > x <- lapply(v.fundno, function(.fund){ >sqlQuery(channel, paste("select mret from monthly_return where > crsp_fundno =", >.fund, 'and caldt >

Re: [R] string problems in R

2010-03-26 Thread muting
Hi Charlie: I tried gmret<-sqlQuery(channel, paste( "select mret from Monthly_returns where crsp_fundno =", v.fundno[1] ) ) It works well.. I think you got my problem solved,R just need time to run the loop, not dead.. Thank you very much Muting -- View this message in context: http:/

Re: [R] string problems in R

2010-03-26 Thread jim holtman
try this: x <- lapply(v.fundno, function(.fund){ sqlQuery(channel, paste("select mret from monthly_return where crsp_fundno =", .fund, 'and caldt > 19700630 order by caldt') }) result <- do.call(rbind, x) On Fri, Mar 26, 2010 at 2:07 PM, muting wrote: > > Hi Charlie > > Thank you fo

Re: [R] string problems in R

2010-03-26 Thread muting
Hi Charlie Thank you for your advice, but it makes my R dead... My head(v.fundno) is > head(v.fundno) [1] "2899" "2903" "2960" "3094" "3095" "3211" I tried to plug in the specific value like 2890 and 2960 : gmret.2899<-sqlQuery(channel,"select caldt, mret from Monthly_returns where crsp_fundno

Re: [R] string problems in R

2010-03-24 Thread Sharpie
Muting Zhang wrote: > > Hello all > > I have been working on my thesis using R. I am a newbie to R and met a > problem > that bothered me for a while due to my lack of acquaintance of R. > > I am using R to query from SQL. I got a list of crsp_fundno of G-style > mutual > funds which is still