Solution 2) does not work because jjdat is a matrix and the solution assumes
it is a data frame. (Your original question described it as a "dataset", I
think, which in S terms is somewhat ambiguous.)
One fix is to replace jjdat by data.frame(jjdat). With this change I think
it may be preferable to 1) on efficiency grounds as it uses paste() in a
vectorized way and not in an apply() loop.
Bill Venables.
--
-----Original Message-----
From: Christian Hoffmann [mailto:christian.hoffmann@wsl.ch]
Sent: Friday, July 23, 1999 6:40 PM
To: s-news@wubios.wustl.edu
Subject: [S] Re: S-News Digest V1 #511
Hi there,
I tried it out and got the following:
jjdat <-
matrix(c(1,2,3,4,2,3,4,5,1,2,3,4,4,5,6,7,8,6,4,2,1,2,3,4,4,5,6,7),ncol=4,byr
ow=T);jjdat
1)
jjdat[!duplicated(apply(jjdat,1,paste,collapse=",")),]
works.
2)
Venables, Bill:
jjdat[!duplicated(do.call("paste", c(as.list(jjdat), list(sep ="\t")))), ]
does not work, because do.call(paste,..) concatenates everything into one
string:
(or is there something missing??)
Christian W. Hoffmann
Swiss Federal Institute for Forest, Snow and Landscape Research
CH-8903 Birmensdorf, Switzerland
phone: ++41-1-739 22 77 fax : ++41-1-739 22 15 e-mail: Hoffmann@WSL.CH
WWW: http://www.wsl.ch/land/dynamics/modeling/hoffmann.htm
FTP: ftp://ftp.wsl.ch/pub/hoffmann/
I prefer WWW pages which can be viewed best with *any* browser, contain
*no* cookies, *no* Java, *no* frames, and *no* required images !
*******************************************************
Do not miss the TOTAL ECLIPSE OF THE SUN on
1999 August 11, 12:35 MEST (at Stuttgart).
The center line will pass through Metz, Karlsruhe, Stuttgart, Muenchen, into
Austria up to Romania
duration of totality will be 2min 20sec. See the corona, protuberances !!
The southern limit of totality will pass through Offenburg, Lake Starnberg,
Berchtesgaden.
Zuerich will see the diameter of the sun being covered by 97.4%,
reducing sun light to about 1/60. See no corona, protuberances :-(
Information at:
http://www.astroinfo.org/eclipse/
********************************************************
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news
|