surv3d | R Documentation |
Do a 3d plot of spatial survival data
surv3d(
spp,
ss,
lwd = 2,
lcol = "black",
lalpha = 1,
pstyle = c("point", "text"),
psize = c(20, 10),
pcol = c("red", "black"),
ptext = c("X", ""),
palpha = 1,
title = "Spatial Survival",
basegrid = TRUE,
baseplane = TRUE
)
spp |
A spatial points data frame |
ss |
A Surv object (with right-censoring) |
lwd |
Line width for stems |
lcol |
Line colour for stems |
lalpha |
Opacity for stems |
pstyle |
Point style "point" or "text" |
psize |
Vector of length 2 for uncensored/censored points size |
pcol |
Vector of length 2 for uncensored/censored points colours |
ptext |
Vector of length 2 for uncensored/censored text characters |
palpha |
Opacity for points/text |
title |
Main title for plot |
basegrid |
add a grid at t=0 |
baseplane |
add a plane at t=0 |
Uses rgl graphics to make a spinny zoomy plot
nothing
Barry S Rowlingson
## Not run:
require(sp)
require(survival)
d = data.frame(
x=runif(40)*1.5,
y = runif(40),
age=as.integer(20+30*runif(40)),
sex = sample(c("M","F"),40,TRUE)
)
coordinates(d)=~x+y
d$surv = Surv(as.integer(5+20*runif(40)),runif(40)>.9)
clear3d();surv3d(d,d$surv,baseplane=TRUE,basegrid=TRUE)
clear3d();surv3d(d,d$surv,baseplane=TRUE,basegrid=TRUE,pstyle="t",lalpha=0.5,lwd=3,palpha=1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.