example plot

This commit is contained in:
AG Damsbo 2022-09-30 15:13:04 +02:00
parent 4d4d15d3e6
commit 2c5677dc36
2 changed files with 22 additions and 0 deletions

BIN
.DS_Store vendored

Binary file not shown.

22
2 Longterm/grotta_bars.R Normal file
View 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)