如何在统计模型结果中替换/删除字符串?

时间:2019-02-05 19:59:20

标签: r string replace

我有一个文件,其中包含gls模型(model1)的结果。如何在已保存的模型中将“ DummyTime”的所有元素替换为“时间” /删除“时间”前面的“虚拟”。我尝试了以下多种方法,但是它们不起作用。

library (stringr)
model_recode <- str_remove(model1, "[Dummy]")
model_recode <- replace(model1, function (x) if (x == 'DummyTime')'Time' else x)

任何能为您提供此问题的帮助将不胜感激。

0 个答案:

没有答案