You can try something about like this: merge(transform(x, V1 = gsub("^[A-Z]", "", x$V1), V3 = gsub("[A-Z]$", "", x$V1)), data.frame(V1 = LETTERS[1:3], V3 = LETTERS[1:3], V2 = 1), by = c("V1", "V3"), all = TRUE)
On Tue, Aug 4, 2009 at 8:35 AM, Ismail, Riyad <riyad.ism...@sappi.com>wrote: > Hi > > > > I have dataset that consists of two columns > > > > AB 0.102 > > > > AC -0.002 > > > > BA -0.102 > > > > BC 0.270 > > > > CA 0.002 > > > > CB -0.270 > > > > > > I wish to create a matrix so that I can eventually plot the data. > > > > > > > > A > > B > > C > > A > > 1 > > 0.102 > > -0.002 > > B > > -0.102 > > 1 > > 0.27 > > C > > 0.002 > > -0.27 > > 1 > > > > > > > > Any help or guidance would be greatly appreciated > > > > > > > > Dr Riyad Ismail > > GIS / Remote Sensing Analyst > > > Sappi Forests (Reg No 1976/02426/07) > > Tel +27 (0)33 347 6650 > > Fax +27 (0)33 347 6790 > > E-mail: riyad.ism...@sappi.com > > > > > The opinions contained in this message are those of the sender only and do > not reflect those of Sappi Limited or any of its subsidiary or associated > companies. > > "This message, including any attachment(s), may contain information which > is private, privileged or confidential and is intended solely for the use of > the individual or entity named in this message. If you are not the intended > recipient of this message, please notify the sender thereof and > destroy/delete the message. Neither the sender nor Sappi Limited (including > its subsidiaries and associated companies, jointly referred to as 'Sappi') > shall incur any liability resulting directly or indirectly from accessing > any of the attached files which may contain a virus or the like. Any > opinions, statements, conclusions and other information contained in this > message and/or its attachment(s) that do not relate or refer to the official > business of Sappi Limited or any of its subsidiary or associated companies > shall be regarded as neither provided nor approved by any Sappi company. > Views expressed in this message or its attachment(s) may not necessarily be > those of Sappi and Sappi cann! > ot be held liable for any direct or indirect loss or injury resulting from > the contents of a message and/or its attachments." > > > Directors names > > A list of Sappi companies and the names of their directors can be retrieved > from > http://www.sappi.com/SappiWeb/Investor+info/Corporate+governance/Board+resumes > > > > > ##################################################################################### > Scanned by MailMarshal - Marshal's comprehensive email content security > solution. > Download a free evaluation of MailMarshal at www.marshal.com > > ##################################################################################### > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.