I want to replace row 22907, column 1 with a string. The column is made up of factors. Column 1 in the dataframe is called geneID. I have tried the following:
df[22907,1] == 'CDEF'
But that gave the following error:
Warning message: In
[<-.factor
(*tmp*
, iseq, value = "OKSM") : invalid factor level, NA generated
I understand how to replace all NA's with a value, however I am only looking to replace this specific one.
Edit: Pretty sure this question is not a duplicate of the one linked - we got similar errors however the base question was different. This explains how to replace a single value in a dataframe.