Hello everyone,
I'm having some trouble with the forest_model package
library(forestmodel)
#> Loading required package: ggplot2
#> Registered S3 methods overwritten by 'ggplot2':
#> method from
#> [.quosures rlang
#> c.quosures rlang
#> print.quosures rlang
set.seed(500)
Data1 <- data.frame(
TXT_MoD = sample(0:1,20, replace = TRUE),
W_Male = sample(0:1,20, replace = TRUE),
Tumor_Stage = sample(1:3,20, replace = TRUE),
W_AGE_60 = sample(c(1, 0), 20, replace = TRUE)
)
print(forest_model(glm(TXT_MoD ~ W_Male + W_AGE_60 + Tumor_Stage, data =Data1, family = "binomial")))
#> Warning: Ignoring unknown aesthetics: x
Created on 2019-06-17 by the reprex package (v0.3.0)
Here is the output:-
How can I change the column names so that I can include something with a space or has a character?
I want to rename the columns
"Male Gender"
"Age>60"
"Tumor Stage"
I tried renaming the columns using colnames but it didn't work:
colnames(Data1)[colnames(Data1)=="W_Male"] <- "Male Gender"
#> Error in colnames(Data1)[colnames(Data1) == "W_Male"] <- "Male Gender": object 'Data1' not found
colnames(Data1)[colnames(Data1)=="W_AGE_60"] <- "Age>60"
#> Error in colnames(Data1)[colnames(Data1) == "W_AGE_60"] <- "Age>60": object 'Data1' not found
Created on 2019-06-17 by the reprex package (v0.3.0)
print(forest_model(glm(TXT_MoD ~ 'Male Gender' + 'Age>60' + Tumor_Stage, data =Data1, family = "binomial")))
#> Error in forest_model(glm(TXT_MoD ~ "Male Gender" + "Age>60" + Tumor_Stage, : could not find function "forest_model"
Created on 2019-06-17 by the reprex package (v0.3.0)
Ideas?