how to replace NA by 1
1
0
Entering edit mode
wang peter ★ 2.0k
@wang-peter-4647
Last seen 10.3 years ago
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) -- shan gao Room 231(Dr.Fei lab) Boyce Thompson Institute Cornell University Tower Road, Ithaca, NY 14853-1801 Office phone: 1-607-254-1267(day) Official email:sg839 at cornell.edu Facebook:http://www.facebook.com/profile.php?id=100001986532253
• 685 views
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 4 months ago
United States
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
ADD COMMENT

Login before adding your answer.

Traffic: 525 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6