This is not a homework assistance forum. You really need to use the resources
provided by your educational institution for that. Please read the Posting
Guide, and note for future reference that HTML email distorts your R code so it
is not appropriate on this list.
As regards your question, you may need to review the Introduction to R document
that comes with R. Then you might as well get started learning how to use the
help system, paying close attention to the first argument and (return) value for
the rainbow function.
?rainbow
?"["
Also, the str function can help you decipher bits of code:
str(rainbow)
str(rainbow(50))
str(rainbow (50)[46])
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live
Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Agony <agony_jah at yahoo.com> wrote:>Dear all,
>
>
>Could anyone help me annotate and decode the below codes?
>Many thanks in advance.
>Best,
>
>
>coverage.col <- rep(0, length(mean))
>coverage.col[coverage=="a"] <-? rainbow(50)[30]
>coverage.col[coverage=="b"] <-? rainbow(50)[15]
>coverage.col[coverage=="c"] <- rainbow(50)[8]
>coverage.col[coverage=="d"] <-? rainbow(50)[46]
>
>?
>what does it mean by (50)[30] et al.?
>what will be happend after using these codes?
>
>Based on what they could be selected?
>
>
>and also:
>if(variable=="a" & fOnly==0){
>? NF? <- length(unique(uid[fasting==1]))
>? NnF <- length(unique(uid[fasting==0]))
>}
> [[alternative HTML version deleted]]
>
>
>
>------------------------------------------------------------------------
>
>______________________________________________
>R-help at r-project.org mailing list
>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.