[R] Coding help for data frame.
Sarah Goslee
@@r@h@go@|ee @end|ng |rom gm@||@com
Thu Mar 21 14:56:43 CET 2019
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 using 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 using 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
More information about the R-help
mailing list