Displaying 2 results from an estimated 2 matches for "gmret".
Did you mean:
mret
2010 Mar 24
3
string problems in R
...to get crsp_fundno of G-style
mutual funds which 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....
2010 Mar 30
1
dataframe in loop
...o get crsp_fundno
of G-style
mutual funds which 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,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 o...