Skip to content
Back to formatted view

Raw Message

Message-ID: <CAAmySGOqbKdEZosMyBT=8=+E_ziRm1gFc7ArQqpc29GA-k=58g@mail.gmail.com>
Date: 2012-10-17T11:23:21Z
From: R. Michael Weylandt
Subject: z.test for dataframe
In-Reply-To: <CAC4E5Y9E-7WxmxGebw9uFHfwtCkbG8ZYcWJKn85Ykuf2OO2edw@mail.gmail.com>

On Wed, Oct 17, 2012 at 7:45 AM, Balqis <aehan3616 at gmail.com> wrote:
> Sep=cbind(kIp,k02p,k04p,k07p)
> Sep=as.data.frame(Sep)
>

I see Rui has already taken a stab at your question, but I just want
to chime in to say the preceeding is really a terrible idiom. It would
be much _much_ better to write

Sep = data.frame(klp, k02p, k04p, k07p)

data.frame() is the function for making data.frames(). If you cbind()
things together, you usually wind up with a matrix which requires all
its elements to be of one type. This, of course, defeats the entire
point of data frames which is to allow different columns to have
different points.

Cheers,
Michael