1

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.

Lasarus9
  • 83
  • 9
  • 3
    Welcome to SO! Can you provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)? – markus Feb 05 '19 at 20:02
  • Did you take a look at the str_replace function. https://www.rdocumentation.org/packages/stringr/versions/1.3.1/topics/str_replace – Jeris Feb 05 '19 at 20:04

0 Answers0