Displaying 1 result from an estimated 1 matches for "nb_param".
Did you mean:
cb_param
2008 May 30
1
Modify string-regular expression
...i = Val_i-2' in a text file
Indeed I have two arrays :
-One for the name of my parameters
-One for the new values for each parameter
I would like to write a loop like this one :
...
SCAN <- scan("File.txt",sep="\n", what="raw",blank.lines.skip=F)
For (i in 1:Nb_param)
{
sub('Param[i] = Value_i-1','Param[i] = Value_i-2', SCAN)
}
...
I Know how to modify a string with sub when it is a fixed string : sub("(K =)([0-9]*)",paste("\\1", Value[i,2]),SCAN)
But i would like to know if it is possible to use the function paste or s...