Colours in R

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Colours in R

Leandro Marino
Hi list,


 I will help an person that will use some graphics of R in internet.

But this pearson want to specify the colours. This person want me to create
an pallete of colours like that:


Name of color - Code - Colour
White -   0xFFFFFF - color white (like an box with this color)

I know that is possible with R, but i don't know how.

Thanks for the advance.


Atenciosamente,
Leandro Lins Marino
Centro de Avaliação
Fundação CESGRANRIO
Rua Santa Alexandrina, 1011 - 2º andar
Rio de Janeiro, RJ - CEP: 20261-903
( (21) 2103-9600 R.:236
( (21) 8777-7907
* [hidden email]
"Aquele que suporta o peso da sociedade
    é precisamente aquele que obtém
 as menores vantagens". (SMITH, Adam)

P  Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO
AMBIENTE

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Colours in R

Duncan Murdoch
On 7/17/2008 10:25 AM, Leandro Marino wrote:

> Hi list,
>
>
>  I will help an person that will use some graphics of R in internet.
>
> But this pearson want to specify the colours. This person want me to create
> an pallete of colours like that:
>
>
> Name of color - Code - Colour
> White -   0xFFFFFF - color white (like an box with this color)
>
> I know that is possible with R, but i don't know how.

The colors() function returns all of the names.

The ?col2rgb has examples that produce text tables like what you want,
but doing it graphically will be hard:  there are 150 different colours
to show.  There's some code in the ?rainbow examples that displays a
smaller number of colours.

Duncan Murdoch


>
> Thanks for the advance.
>
>
> Atenciosamente,
> Leandro Lins Marino
> Centro de Avaliação
> Fundação CESGRANRIO
> Rua Santa Alexandrina, 1011 - 2º andar
> Rio de Janeiro, RJ - CEP: 20261-903
> ( (21) 2103-9600 R.:236
> ( (21) 8777-7907
> * [hidden email]
> "Aquele que suporta o peso da sociedade
>     é precisamente aquele que obtém
>  as menores vantagens". (SMITH, Adam)
>
> P  Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO
> AMBIENTE
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

RES: Colours in R

Leandro Marino
I know that!

But i will select about 10 colurs and show him....


But he needs in that format!

thanks@

-----Mensagem original-----
De: Duncan Murdoch [mailto:[hidden email]]
Enviada em: quinta-feira, 17 de julho de 2008 11:32
Para: Leandro Marino
Cc: R-Help@R-Project. Org
Assunto: Re: [R] Colours in R


On 7/17/2008 10:25 AM, Leandro Marino wrote:
> Hi list,
>
>
>  I will help an person that will use some graphics of R in internet.
>
> But this pearson want to specify the colours. This person want me to
create
> an pallete of colours like that:
>
>
> Name of color - Code - Colour
> White -   0xFFFFFF - color white (like an box with this color)
>
> I know that is possible with R, but i don't know how.

The colors() function returns all of the names.

The ?col2rgb has examples that produce text tables like what you want,
but doing it graphically will be hard:  there are 150 different colours
to show.  There's some code in the ?rainbow examples that displays a
smaller number of colours.

Duncan Murdoch


>
> Thanks for the advance.
>
>
> Atenciosamente,
> Leandro Lins Marino
> Centro de Avaliação
> Fundação CESGRANRIO
> Rua Santa Alexandrina, 1011 - 2º andar
> Rio de Janeiro, RJ - CEP: 20261-903
> ( (21) 2103-9600 R.:236
> ( (21) 8777-7907
> * [hidden email]
> "Aquele que suporta o peso da sociedade
>     é precisamente aquele que obtém
>  as menores vantagens". (SMITH, Adam)
>
> P  Antes de imprimir pense em sua responsabilidade e compromisso com o
MEIO
> AMBIENTE
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Odp: Colours in R

PIKAL Petr
In reply to this post by Leandro Marino
Hi

Maybe there is some neat function for it but

apply(data.frame(t(col2rgb(colours()[1:10]))),1,function(x)
paste(as.character.hexmode(x),collapse=""))

gives you hex values for colours specified.

Then you can use colours()[1:10] to get names (or you can invent your own)
and you can print real colours in a plot by using filled rectangle.

Regards
Petr


[hidden email] napsal dne 17.07.2008 16:25:39:

> Hi list,
>
>
>  I will help an person that will use some graphics of R in internet.
>
> But this pearson want to specify the colours. This person want me to
create

> an pallete of colours like that:
>
>
> Name of color - Code - Colour
> White -      0xFFFFFF - color white (like an box with this color)
>
> I know that is possible with R, but i don't know how.
>
> Thanks for the advance.
>
>
> Atenciosamente,
> Leandro Lins Marino
> Centro de Avaliação
> Fundação CESGRANRIO
> Rua Santa Alexandrina, 1011 - 2º andar
> Rio de Janeiro, RJ - CEP: 20261-903
> ( (21) 2103-9600 R.:236
> ( (21) 8777-7907
> * [hidden email]
> "Aquele que suporta o peso da sociedade
>     é precisamente aquele que obtém
>  as menores vantagens". (SMITH, Adam)
>
> P  Antes de imprimir pense em sua responsabilidade e compromisso com o
MEIO
> AMBIENTE
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Colours in R

Earl F. Glynn
In reply to this post by Leandro Marino
"Leandro Marino" <[hidden email]> wrote in message
news:[hidden email]...
But this pearson want to specify the colours. This person want me to create
an pallete of colours like that:


Name of color - Code - Colour
White -   0xFFFFFF - color white (like an box with this color)

This page shows an R color chart and how to make one:
http://research.stowers-institute.org/efg/R/Color/Chart/index.htm

In particular, pp. 2-8 of this PDF shows the color name, hex value, and
separate decimal RGB components:
http://research.stowers-institute.org/efg/R/Color/Chart/ColorChart.pdf

efg

Earl F Glynn
Bioinformatics
Stowers Institute for Medical Research

______________________________________________
[hidden email] 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.