I have a long data frame in R with a column called "Well." Each well occurs more than once in that column. For a small subset of those wells, I want to add a value to an empty column called "Trypan."
So my df looks something like this, but very long.
Well | Trypan |
---|---|
A12 | NA |
B12 | NA |
C12 | NA |
... | NA |
A12 | NA |
B12 | NA |
C12 | NA |
I want to assign a value in the trypan column that is the same for every well called A12. I don't want to write a whole vector or make a new df and attach/melt it though, that's a pain.
I want to do something as simple as "if well = A12, Trypan = 90." But I cannot figure out that syntax!
I have in fact tried googling this but it seems like other people are asking different questions that I cannot apply to my problem. My apologies for this very basic question.