I am new to R
Help would be appreciated:)
I have a variable below
myvariable <- "somefunction(var1,var2)"
The above stated variable will always change but the pattern remains the same
a function name followed by two values seperated by “,” in brackets
I want to replace
var1 with newVar1
var2 with newVar2
The value to be changed with also remains the same.
In this case it is newVar1 and newVar2.
Need to write a script such that
the desired output is
myvariable <- "somefunction(newVar1 ,newVar2)"
Source: Stack Overflow