Skip to content
Back to formatted view

Raw Message

Message-ID: <CAM_vju=PBOJGtYLj5btu79e-UTM3a9n-bg9qVyLt_JdHu9kCNw@mail.gmail.com>
Date: 2019-03-21T13:56:43Z
From: Sarah Goslee
Subject: Coding help for data frame.
In-Reply-To: <E9DF8DB7-E840-44F6-8CED-EE9B8ECFB3FD@gmail.com>

I'm sorry, I don't understand what you're trying to do with your
hypothetical data.

Can you expand on what your question is?

Sarah

On Thu, Mar 21, 2019 at 9:54 AM Anaanthan Pillai
<anaanthanpillai at gmail.com> wrote:
>
> Good day,
>
> #I?ve created hypothetical data for drug X and drug Y whereby both drug have the ability to have HbA1c reduction.
>
> set.seed(10)
> drugx= rnorm(50, mean = 0.1, sd=0.02)
>
> set.seed(11)
> drugy= rnorm(50, mean=0.15, sd=0.03)
>
> #And created a data frame, compare drugs (comdrug) of 50 patients for each drug.
>
> comdrug= data.frame("ID"=c(1:50), "DrugX"=drugx, "DrugY"=drugy)
>
> # whereby the data would look like this
>
> head(comdrug)
>
> > head(comdrug)
>   ID      DrugX     DrugY
> 1  1 0.10037492 0.1322691
> 2  2 0.09631495 0.1507978
> 3  3 0.07257339 0.1045034
> 4  4 0.08801665 0.1091204
> 5  5 0.10589090 0.1853547
> 6  6 0.10779589 0.1219755
>
> Is there anyway of coding if I could arrange like this?
>
>
>
> ______________________________________________
> 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.



-- 
Sarah Goslee (she/her)
http://www.numberwright.com