s-news
[Top] [All Lists]

setting missing value in a character matrix in S-Plus

To: s-news@lists.biostat.wustl.edu
Subject: setting missing value in a character matrix in S-Plus
From: array chip <arrayprofile@yahoo.com>
Date: Thu, 17 Feb 2005 14:09:41 -0800 (PST)
Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=XbxWEU6974PfNBgiFuB6GswLEC4+pJGc4lvHktda6roO+tPzPiCX3xGd7M4RFppyM9yfAwjTYNJmiUbbYE7+d+Ik3shX23Fujh66wEb+0vrzbayrccvMfv7J0Z2Db/jx8yDcmY8mAbFwgGblbV5zwiU+ZREskuul1WMWPLH32mk= ;
Hi,

how can I set some elements in a character matrix as
missing values (NAs)? for example:

x<-matrix(rep('q',30),nrow=5)
x[x=='q']<-NA

will give me a character matrix with all elements
being "NA", but not missing values NA. The above codes
work prefectly well in R, but do not give me the right
answerin S-Plus. However, the codes work well if the
input matrix x is a numeric matrix.

Thanks


                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250

<Prev in Thread] Current Thread [Next in Thread>