search for: monthly_returns

Displaying 2 results from an estimated 2 matches for "monthly_returns".

2010 Mar 24
3
string problems in R
...is still alive.) v.fundno What i need to do next is using the v.fundno I got to query from another table "Monthly_return" to get the mret coresponding to every v.fundno. I have only a basic idea of the code: for (i in 1:length(v.fundno)){ gmret<-sqlQuery(channel,"select mret from Monthly_returns where crsp_fundno = toString(v.fundno[i])") } gmret R gave me an error with undefined function "toString" I know there should be some details added in to get it right,like define an object or how to convert number to string.. I would be appreciated if anyone gives me any clue about...
2010 Mar 30
1
dataframe in loop
...ll alive.) v.fundno What i need to do next is using the v.fundno I got to query from another table "Monthly_return" to get the mret coresponding to every v.fundno. I have only a basic idea of the code: for (i in 1:length(v.fundno)){ gmret<-sqlQuery(channel,paste("select mret from Monthly_returns where crsp_fundno =",test[i],'and caldt > 19900630 order by caldt')) } The loop doesn't work:( I realize it might be the problem that I didnt define the dataframe, but my limited knowledge cant help me find out how.. I will give you guys a example of my data: head(v.fund...