'Substitute string in whole code below - Rstudio
I have a code:
Rstudio Code:
tt0 <- mean(tab[tab$Treatment == 1 & tab$Event == 0, 23])
tt1 <- mean(tab[tab$Treatment == 1 & tab$Event == 1, 23])
rt1 <- mean(na.omit(tab[tab$Treatment == 1 & tab$Event == 1, 15]))
rt0 <- mean(na.omit(tab[tab$Treatment == 1 & tab$Event == 0, 15]))
rt1 <- mean(na.omit(tab[tab$Treatment == 1 & tab$Event == 1, 15]))
mt1 <- mean(tab[tab$Treatment == 1 & tab$Event == 1, 21])
mt0 <- mean(tab[tab$Treatment == 1 & tab$Event == 0, 21])
Now, let's say that I want to substitute a string "tabrob" in place of everywhere you see "tab" in the code, how can I do that?
Solution 1:[1]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | TarJae |

