mirror of
https://github.com/agdamsbo/daDoctoR.git
synced 2024-11-21 19:30:22 +01:00
fix to counting problem
This commit is contained in:
parent
f25d7ae34f
commit
59ae3c2f99
@ -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))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user