example plot
This commit is contained in:
parent
4d4d15d3e6
commit
2c5677dc36
22
2 Longterm/grotta_bars.R
Normal file
22
2 Longterm/grotta_bars.R
Normal file
@ -0,0 +1,22 @@
|
||||
library(rankinPlot)
|
||||
|
||||
?rankinPlot::grottaBar
|
||||
|
||||
dta<-read.csv("/Volumes/Data/exercise/source/background.csv",colClasses = "character", na.strings = c("NA","","unknown"))[,c("rtreat","mrs_0","mrs_1","mrs_6","hypertension","diabetes","civil")]
|
||||
|
||||
df <- dta |> select(c("rtreat","mrs_0","mrs_1","mrs_6")) |> pivot_longer(cols = -rtreat)
|
||||
|
||||
x<-table(mRS=df$value,
|
||||
Group=df$rtreat,
|
||||
Time = df$name)
|
||||
|
||||
grottaBar(x,groupName="Group",
|
||||
scoreName = "mRS",
|
||||
strataName="Time",
|
||||
colourScheme ="custom"
|
||||
) +
|
||||
scale_fill_viridis_d(direction=-1)
|
||||
|
||||
dta |> select(-c("mrs_0","mrs_1")) |> generic_stroke(group = "rtreat", score = "mrs_6", variables = c("hypertension","diabetes","civil"))
|
||||
|
||||
library(stRoke)
|
Loading…
Reference in New Issue
Block a user