[BioC] how to replace NA by 1

Sean Davis sdavis2 at mail.nih.gov
Fri Jan 20 04:35:25 CET 2012


On Thu, Jan 19, 2012 at 10:31 PM, wang peter <wng.peter at gmail.com> wrote:
> i have a vector
>> start
> [1]  4  5  6 NA
> i want to replace NA by 1
>
> but that didnot work
> gsub(NA, 1, as.character(start), ignore.case = T)

start[is.na(start)]=1



More information about the Bioconductor mailing list