I have a data frame
> head(custom.cn.data)
Gene Sample_name CN
1: DDX11L1 F02 0.6788844
2: DDX11L1 C02 -0.9924524
3: DDX11L1 A07 -2.3833559
>
I want to convert values in CN column < 0 to Del and >0 to Amp
But I am getting error
> a %>% mutate(q = replace(CN, which(CN<0), Del))
Error in replace(CN, which(CN < 0), Del) : object 'Del' not found
> a$CN <- replace(a$CN, which(a$CN < 0), Del)
Error in replace(a$CN, which(a$CN < 0), Del) : object 'Del' not found
Any help?
Del
andR
looks for an object calledDel
instead of using the string "Del". $\endgroup$