This function creates a spider plot with all the 8 dimensions of the SF-36 questionnaire indicating the HRQoL score of each observation.
a data frame with each column relative to observations of each dimension. The columns of the data frame must be introduced in the following order:
logical parameter, if
HRQoLplot has a data frame object as input, and an optional
legend logical input. The data frame must have observations of the HRQoL taken by the SF-36 and the columns of the data frame will refer to each domain of the SF-36, hence the data frame must have eight columns. Each axis of the plot refers to an especific HRQoL domain, so the order of the data frame columns must be as it is showed in the arguments section. The HRQoL score of each observation (row) of the data frame is drawn with a line of a different color in the plot.
This function depends on the function
radarchart of the package
fmsb created by Minato Nakazawa.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
set.seed(5) # We insert the columns in the order that has been determined: n <- c(4,3,20,20,8,9,20,13) k=3 p=runif(8,0,1) phi <- runif(8,1,3) dat <- data.frame( RP=rBB(k,n,p,phi), RE=rBB(k,n,p,phi), PF=rBB(k,n,p,phi), VT=rBB(k,n,p,phi), SF=rBB(k,n,p,phi), BP=rBB(k,n,p,phi), GH=rBB(k,n,p,phi), MH=rBB(k,n,p,phi)) rownames(dat) <- c("ID1", "ID2", "ID3") HRQoLplot(dat,TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.