fix to counting problem

This commit is contained in:
agdamsbo 2018-10-11 17:01:00 +02:00
parent f25d7ae34f
commit 59ae3c2f99

View File

@ -51,14 +51,14 @@ strobe_olr<-function(meas,var,adj,data,dec=2){
for (r in 1:length(levels(dat[,2]))){
vr<-levels(dat[,2])[r]
dr<-dat[dat[,2]==vr,]
dr<-dat[dat[,2]==vr&!is.na(dat[,2]),]
n<-as.numeric(nrow(dr))
## Af en eller anden grund bliver der talt for mange med.
# nall<-as.numeric(nrow(dat[!is.na(dat[,2]),]))
nall<-as.numeric(nrow(dat[!is.na(dat[,2]),]))
nl<-levels(m)[r]
# pro<-round(n/nall*100,0)
# rt<-paste0(n," (",pro,"%)")
pro<-round(n/nall*100,0)
n<-paste0(n," (",pro,"%)")
nr<-rbind(nr,cbind(nl,n))
}