I have a file included the result of a gls model (model1). How can I replace all elements of "DummyTime" as "Time"/remove "Dummy" in front of "Time" in my saved model. I've tried many ways as follows but they are not working.
library (stringr)
model_recode <- str_remove(model1, "[Dummy]")
model_recode <- replace(model1, function (x) if (x == 'DummyTime')'Time' else x)
Any help you could provide for this question would be appreciated in advance.