I have actually tried a lot to solve the following problem, and I have read a lot about it. But still, I can not manage it
Look at this example:
time < - Sample (1: 300, 20) test & lt; - c (0, 0,0, NA, 0, 0, 3, 0, 0, NA, 0,0, 3, 0, 0, NA, 0, 0, 3, 0) LE
< P> Now I want to enter the value in the last (LE) column. The price is dependent on the conditions in the second column (test). If it is NA or 3, then it can remain empty right now, but my problem value is 0. If the value of the row is 0, but "C" for "3" and "C" for the remainder, then "a" should be entered in the row. Therefore the output should look like this:
head (df, 8) time test 1 271 c 2 147 0 a3 277 a4 247 na NA 5 82 0 C6 133 AA 7 231 3 NA 8 110 0 B
Thanks for the help! Try
Comments
Post a Comment