Displaying 1 result from an estimated 1 matches for "tempmon".
2006 May 01
4
efficiency in merging two data frames
...r (i in 1:length(id$PERMNO))
id$fy[[i]]<-account$FYR[id$GVKEY[[i]]==account$GVKEY][[1]]
return$GVKEY=rep(0,length(return$PERMNO))
return$fyy=rep(0,length(return$PERMNO))
return$fyq=rep(0,length(return$PERMNO))
for (i in i:length(return$PERMNO)) {
temp<-id$PERMNO==return$PERMNO[[i]];
tempmon<-id$fy[temp][[1]];
if (return$month[[i]]<-tempmon) {
return$fyy[[i]]<-return$year[[i]];
return$fyq[[i]]<-4-(tempmon-return$month[[i]])%/%3;
}
else{
return$fyy[[i]]<-return$year[[i]]+1;
return$fyq[[i]]<-(return$month[[i]]-tempmon-1)%/%3;
}
return$GVKEY[[i]]<-...