| densityauc {vulcan} | R Documentation |
This function will calculate the AUC of a density object generated by the
'density' function.
densityauc(dens, window)
dens |
a density object |
window |
a vector with two values, specifying the left and right borders for the AUC to be calculated |
a numeric value for the density AUC
set.seed(1)
a<-rnorm(1000)
d<-density(a)
window<-c(2,3)
da<-densityauc(d,window)
plot(d,main='')
abline(v=window,lty=2)
title(paste0('AUC between lines=',da))