Skip to content
Back to formatted view

Raw Message

Message-ID: <81B1D521-D4BE-451D-BC74-38B17F9D2EBE@auckland.ac.nz>
Date: 2009-01-28T19:53:44Z
From: Rolf Turner
Subject: Get median of each column
In-Reply-To: <4980B45D.4000204@gmx.de>

On 29/01/2009, at 8:39 AM, Stephan Kolassa wrote:

> Assuming your data are in a data.frame called dataset,
>
> apply(dataset,2,median)
>
> should work. Look at
>
> ?apply

Note that apply() works with ***matrices***.  The foregoing code will
work, given that all columns of ``dataset'' are numeric, due to the
fact that apply will *coerce* a data frame to a matrix.

However it should always be remembered that

	DATA FRAMES ARE NOT MATRICES!!!

cheers,

	Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}