Rainer Tischler
2008-Oct-30 16:04 UTC
[R] summarize rows in a matrix differing only in one value
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hi,=0A=0AI'd like to replace rows in a matrix which differ only in their
values for one numerical column ("Vx") by a single row in which the
value for Vx is replaced by the median of Vx in the original rows. Vx is always
the same column.=0ASo far, I got the reduced matrix without the Vx-column
using:=0A=0Areduced_mat <- unique(original_mat[,-indVx])=0A=0Awhere
"indVx" stands for the number of the Vx-column. Now I still need to
get the column with the corresponding medians for the unified entries. How can I
do this efficiently (i.e. without for-loops, etc.)?=0A=0AMany thanks in
advance,=0ARainer=0A=0AWikipediaWictionaryChambers (UK)Google imagesGoogle
defineThe Free DictionaryJoin exampleWordNetGoogleUrban
DictionaryAnswers.comrhymezone.comMerriam-Webster<>0=0Awvcidfjoguarm=0A=0A=0A