PhysicalActivityandStrokeOu.../2 Longterm/grotta_bars.R

27 lines
833 B
R
Raw Normal View History

2022-09-30 15:13:04 +02:00
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)
2022-10-05 14:54:13 +02:00
cc<-dta[complete.cases(dta),]
talos <- cc[sample(1:nrow(cc),200),] |> select(-mrs_0)
save(talos,file="talos.rda")