文書の過去の版を表示しています。
draw.reliability.data.diagram <- function(x,sort=TRUE,...) {
if(is.numeric(x)==TRUE) {
n <- length(x)
if(sort==TRUE) {
x.time <- x[sort.list(x,decreasing=TRUE)]
x.status <- rep(1,n)
id <- c(1:n)
} else {
x.time <- x
x.status <- rep(1,n)
id <- c(1:n)
}
} else if (is.data.frame(x)==TRUE) {
n <- dim(x)[1]
if(sort==TRUE) {
x.time <- x[sort.list(x[,1],decreasing=TRUE),1]
x.status <- x[sort.list(x[,1],decreasing=TRUE),2]
id <- row.names(x)[sort.list(x[,1],decreasing=TRUE)]
} else {
x.time <- x[,1]
x.status <- x[,2]
id <- row.names(x)
}
} else if (is.matrix(x)==TRUE) {
n <- dim(x)[1]
if(sort==TRUE) {
x.time <- x[sort.list(x[,1],decreasing=TRUE),1]
x.status <- x[sort.list(x[,1],decreasing=TRUE),2]
id <- rawnames(x)[sort.list(x[,1],decreasing=TRUE)]
} else {
x.time <- x[,1]
x.status <- x[,2]
id <- rawnames(x)
}
}
plot(x.time,c(1:n),
xlim=c(0,max(x.time)),
type="n",
ylab="#",
xlab="Lifetime data",yaxt="n")
points(x.time,c(1:n),pch=c(1,4)[x.status+1],...)
for( i in c(1:n) ) {
lines(c(0,x.time[i]),c(i,i),...)
}
}