Description Usage Arguments Details Value Note Author(s) References See Also Examples
~~ A concise (1-5 lines) description of what the function does. ~~
1 |
t |
~~Describe |
int |
~~Describe |
~~ If necessary, more details than the description above ~~
~Describe the value returned If it is a LIST, use
comp1 |
Description of 'comp1' |
comp2 |
Description of 'comp2' |
...
~~further notes~~
~Make other sections like Warning with Warning .... ~
~~who you are~~
~put references to the literature/web site here ~
~~objects to See Also as help
, ~~~
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function(t,int=1){
if(int>1){t<-round(t/int);}
t<-sort(t); t.rle<-rle(t); d<-px<-lx<-c();
ts<-1:max(t.rle$values);
for(i in ts){
j<-match(i,t.rle$values);
if(is.na(j)){d<-c(d,0);}else{d<-c(d,t.rle$lengths[j]);}
}
for(i in ts) {
lx<-c(lx,(sum(d)-sum(d[1:i]))/sum(d));
}
for(i in ts) {px<-c(px,lx[i+1]/lx[i]);}
ux<- -log(px); ux[is.infinite(ux)]<-NA; lnux<-log(ux); lnux[is.infinite(lnux)]<-NA;
out<-cbind(ts,d,lx,px,ux,lnux);
colnames(out)<-c("time","deaths","lx","px","ux","lnux");
data.frame(out);
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.