Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-25 Thread Kevin W
Here's another offering of an attempt to create unique colors. These are light/medium colors...no dark colors. cols - matrix(c(0, 0, .90, # gray .3, 0, .70, .6, 0, .50, 0, .15, 1, # red 0, .30, 1, 0, .45, 1,

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-14 Thread Jim Lemon
Ross Culloch wrote: Hi Kingsford, Thanks yet again for your help! I have tried this, and once again i have failed! I have put the code that i've used below (i'm sure you'll note some bad practice) if that is any use to help explain where i'm going wrong, it seems to run fine and feeds back just

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-14 Thread Ross Culloch
Hi Jim, that works, which is great!!! Alexis also gave me an answer that works if you wanted to look at that post, but that was based on adding colours to existing Sets from BrewerColor. However, your answer is the first i've got where you can actuall pick your entire palette, it's something that

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-14 Thread Kingsford Jones
On Fri, Mar 13, 2009 at 7:58 AM, Ross Culloch ross.cull...@dur.ac.uk wrote: Hi Kingsford, Thanks yet again for your help! I have tried this, and once again i have failed! I have put the code that i've used below (i'm sure you'll note some bad practice) It doesn't appear you changed the

[R] Selecting / creating unique colours for behavioural / transitional data

2009-03-13 Thread Ross Culloch
Dear all, This seems like a simple problem but i've searched the help files and tried various options but failed, so apologies in advance for asking what i'm sure is an easy thing to do! In short, I have displayed behavioural data using the TraMineR package such that there is a colour change

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-13 Thread Ross Culloch
Hi Kingsford, Thanks for the reply - some of the sets/palettes in the RColorBrewer are ideal, but the problem with the problem i have is that they only go up to 12 colours, and i need 15 colours - so i assume the only thing i can do is create my own palette, but i'm having limited success in

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-13 Thread Kingsford Jones
One option for creating your own palette is #install.packages('epitools') mycols - colors.plot(locator = TRUE) then left-click on 15 colors of your liking and then right-click 'Stop'. mycols will be a data.frame with the third column containing the color names. Kingsford On Fri, Mar 13, 2009

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-13 Thread Ross Culloch
Many thanks yet again for your reply, thanks for that method, i gave it a go and i checked 'mycols' and sure enough it had selected the chosen colours and listed their names, but when i used it for making the graph warnigs informed me that the supplied colour in not numeric or character. Ross

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-13 Thread hadley wickham
Thanks for the reply - some of the sets/palettes in the RColorBrewer are ideal, but the problem with the problem i have is that they only go up to 12 colours, and i need 15 colours - so i assume the only thing i can do is create my own palette, but i'm having limited success in trying to work

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-13 Thread Ross Culloch
Hi Oliver, Thanks very much for your reply. I have tried your script, but when the script for the graph runs it comes up with several error messages repeating that 'supplied colour is not numeric or character' Olivier Delaigue wrote: library(colorRamps) image(matrix(1:150, 10), col =

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-13 Thread Kingsford Jones
On Fri, Mar 13, 2009 at 7:19 AM, Ross Culloch ross.cull...@dur.ac.uk wrote: Many thanks yet again for your reply, thanks for that method, i gave it a go and i checked 'mycols' and sure enough it had selected the chosen colours and listed their names, but when i used it for making the graph

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-13 Thread Ross Culloch
Hi Hadley, Many thanks for your post. You're not wrong - i'm certainly finding it challenging, but i assumed it was because i was making some basic errors. My data are 15 types of behaviour, e.g. resting, alert, locomotion, etc. so i need to use 15 colours to tell each appart in a barplot which

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-13 Thread Ross Culloch
Hi Kingsford, Thanks yet again for your help! I have tried this, and once again i have failed! I have put the code that i've used below (i'm sure you'll note some bad practice) if that is any use to help explain where i'm going wrong, it seems to run fine and feeds back just what you noted it

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-13 Thread Olivier Delaigue
library(colorRamps) image(matrix(1:150, 10), col = blue2green2red(15)) Regards, Olivier Delaigue Ross Culloch wrote: Dear all, This seems like a simple problem but i've searched the help files and tried various options but failed, so apologies in advance for asking what i'm sure is

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-13 Thread Alexis Gabadinho
Hi Ross, If you really need 15 colors, maybe you can use the Set3 palette provided by RColorBrewer (this is the one used by TraMineR up to 12 states) and add yourself 3 more colors ? For example (you can mix the hexadecimal color numbers from the RColorBrewer palette and real color names in

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-13 Thread Ross Culloch
Hi Alexis, In my opinion you are nothing short of genius! That worked a treat, i thought it would be something simple, but i could not find the script or an example anywhere!!! That was a massive help and has salvaged my day! :clap: Thanks very much to everyone else that helped, it was much

Re: [R] Selecting / creating unique colours for behavioural / transitional data

2009-03-13 Thread Alexis Gabadinho
Hi Ross, If you really need 15 colors, maybe you can use the Set3 palette provided by RColorBrewer (this is the one used by TraMineR up to 12 states) and add yourself 3 more colors ? For example (you can mix the hexadecimal color numbers from the RColorBrewer palette and real color names in