mirror of
https://github.com/agdamsbo/daDoctoR.git
synced 2024-11-25 05:01:54 +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]))){
|
for (r in 1:length(levels(dat[,2]))){
|
||||||
vr<-levels(dat[,2])[r]
|
vr<-levels(dat[,2])[r]
|
||||||
dr<-dat[dat[,2]==vr,]
|
dr<-dat[dat[,2]==vr&!is.na(dat[,2]),]
|
||||||
n<-as.numeric(nrow(dr))
|
n<-as.numeric(nrow(dr))
|
||||||
|
|
||||||
## Af en eller anden grund bliver der talt for mange med.
|
## 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]
|
nl<-levels(m)[r]
|
||||||
# pro<-round(n/nall*100,0)
|
pro<-round(n/nall*100,0)
|
||||||
# rt<-paste0(n," (",pro,"%)")
|
n<-paste0(n," (",pro,"%)")
|
||||||
nr<-rbind(nr,cbind(nl,n))
|
nr<-rbind(nr,cbind(nl,n))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user