Displaying 1 result from an estimated 1 matches for "ratio3".
Did you mean:
ratio
2004 Sep 01
3
coercing a string naming to a variable name and return value
...aste. The problem is following: In a data frame, there are
12 columns whose title vary only by a digit, all other part being equal. I
would like to compute a operation on a subset these variables and parse them
in turn.
the data frame "basin.param" contains columns called ratio1, ratio2,
ratio3...
in each of these ratios I want to retain only values above 0. This could be
put like this
crit<- which(basin.param$ratio1 > 0)
basin.param$ratio1[crit] + basin.param$val[crit]
OK, so what if I want to increment from ratio1 to ratio3 automatically and
return the value of the variable repr...