Message-ID: <CAE9stmd6qWnzcqyna9=kUXWKXrEzGhwz=k0h2s2Q4iS4rHyuhg@mail.gmail.com>
Date: 2021-09-03T14:29:07Z
From: AbouEl-Makarim Aboueissa
Subject: Splitting a data column randomly into 3 groups
In-Reply-To: <CABcYAdKHY7vrjGsicgNxB7ggRnYYqe23=onWNd0TpOJ6J2e4gQ@mail.gmail.com>
Hi Richard:
Thank you very much for your help in this matter.
with thanks
abou
______________________
*AbouEl-Makarim Aboueissa, PhD*
*Professor, Statistics and Data Science*
*Graduate Coordinator*
*Department of Mathematics and Statistics*
*University of Southern Maine*
On Fri, Sep 3, 2021 at 10:25 AM Richard O'Keefe <raoknz at gmail.com> wrote:
> Your question is ambiguous.
> One reading is
> n <- length(table$Data)
> m <- n %/% 3
> s <- sample(1:n, n)
> X <- table$Data[s[1:m]]
> Y <- table$Data[s[(m+1):(2*m)]]
> Z <- table$Data[s[(m*2+1):(3*m)]]
>
>
>
>
> On Fri, 3 Sept 2021 at 13:31, AbouEl-Makarim Aboueissa
> <abouelmakarim1962 at gmail.com> wrote:
> >
> > Dear All:
> >
> > How to split a column data *randomly* into three groups. Please see the
> > attached data. I need to split column #2 titled "Data"
> >
> > with many thanks
> > abou
> > ______________________
> >
> >
> > *AbouEl-Makarim Aboueissa, PhD*
> >
> > *Professor, Statistics and Data Science*
> > *Graduate Coordinator*
> >
> > *Department of Mathematics and Statistics*
> > *University of Southern Maine*
> > ______________________________________________
> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
>
[[alternative HTML version deleted]]