, ggplot2 , , . - Hadley, .
pkso$ID<-as.factor(pkso$ID)
pkso$WARD<-as.factor(pkso$WARD)
pkso$WRES<-as.numeric(pkso$WRES.)
dput(pkso)
library(ggplot2)
pksomelt<-melt(pkso, id.vars=c("ID","TIME","TAD","AMT","BL","WARD"))
pksomelt$value<-as.numeric(pksomelt$value)
pksomelt<-subset(pksomelt,variable %in% c("IPRE","DV","PRED"))
pkplot1<-ggplot(pksomelt, aes(TAD, value)) +
geom_point() +
scale_shape(solid = FALSE) +
facet_wrap( ~ variable)
print(pkplot1)
pkplot2<-ggplot(subset(pksomelt, ID == "1"), aes(TAD, value)) +
geom_point() +
scale_shape(solid = FALSE) +
facet_wrap( ~ variable)
print(pkplot2)
i<-ceiling(max(as.numeric(pksomelt$ID))/6)
pkplot3<-ggplot(subset(pksomelt, as.numeric(pksomelt$ID) > (i*0) & as.numeric(pksomelt$ID) < (i*1)+1),
aes(TAD, value)) +
geom_point() +
scale_shape(solid = FALSE) +
facet_grid(ID ~ variable)
print(pkplot3)
pkplot4<-ggplot(subset(pksomelt, as.numeric(pksomelt$ID) > (i*1) & as.numeric(pksomelt$ID) < (i*2)+1),
aes(TAD, value)) +
geom_point() +
scale_shape(solid = FALSE) +
facet_grid(ID ~ variable)
print(pkplot4)
pkplot5<-ggplot(pksomelt, aes(TAD, value)) +
geom_point(aes(colour=ID)) + geom_line(aes(colour=ID)) +
scale_shape(solid = FALSE) +
facet_grid(WARD ~ variable, scales="free")
print(pkplot5)