Displaying 2 results from an estimated 2 matches for "lst1new".
Did you mean:
dat1new
2013 Jun 08
0
data
...the dimensions of those rows and the first row dimension was minimum (after I applied the first #constraint).? I guess you wanted to select only a pair of rows (dummy=0 and dummy=1) for each lists.
fun1<- function(dat,percent,number){???
??? lst1<- split(dat,list(dat$year,dat$industry))
??? lst1New<- lapply(lst1,function(x) x[!(all(x$dummy==0)|all(x$dummy==1)),])
??? lst2<- lst1New[lapply(lst1New,nrow)>0]
??? lst3<- lapply(lst2,function(x){
??? ??? ??? ??? lapply(x$dimension,function(y){
??? ??? ??? ??? ? x1<- x[(y < (x$dimension+(x$dimension*percent))) & (y > (x$dime...
2013 Apr 13
2
Comparison of Date format
...lt;- colnames(DataB)[2];x}))
res<-join(dataNew,DataB,by=c("Date.Accident","ID"),type="right")
?res
#? Date.Accident ID Status
#1????? 3-Sep-01? 1????? A
#2???? 20-Jan-05? 1?? <NA>
#3???? 26-Feb-04? 1????? C
#4????? 6-Mar-02? 2????? A
#or you can split by ID
lst1New<-lapply(unique(DataA$ID),function(i){x1<- DataA[DataA$ID==i,]; x2<- DataB[DataB$ID==i,]; do.call(rbind,lapply(seq_len(nrow(x2)),function(i) {x3<- unlist(mapply(function(x,y) which(x==y), x1[,3:4],x2[i,2])); x4<- if(length(x3)==2) x1[x3[which.min(x3)],!names(x1)%in%names(x3[which.max(...