Displaying 20 results from an estimated 2000 matches similar to: "col2rgb, factors & documentation"
2004 Oct 07
3
How to use alpha transparency channel for colors?
The release notes for R 2.0.0 states:
It is now possible to specify colours with a full alpha
transparency channel via the new 'alpha' argument to the
rgb() and hsv() functions, or as a string of the form "#RRGGBBAA".
NOTE: most devices draw nothing if a colour is not opaque,
but PDF and Quartz devices will render semitransparent colours.
A new argument
2000 Mar 29
1
pre summary: mapping of colornames into hsv?
Hi Martin,
Great that you follow this. My original intention was to be able to
translate colornames to hsv because this would allow using colornames to cut
out a certain part of the colorwheel for colorcoding (HSV component H, see
my code below)
I think internally we might have colors represented as
Colornames, ColorIntegers, ColorHexcodes, ColorRGBs, ColorHSVs (ColorCMYs?)
however the R-user
2007 May 21
3
Selecting complementary colours
Dear r-helpers,
I wonder whether, given the "#rrggbb" representation of a colour, there is a
simple way to select the complementary colour, also expressed as a "#rrggbb"
string.
Any suggestions would be appreciated.
John
--------------------------------
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
2009 Oct 13
2
General means of matching a color specification to an official R color name
Hello List Dwellers:
I?ve looked around quite a bit, but don?t quite see an answer that I
understand.
I?m looking for a way to take any kind of color specification (rgb, hsv,
hcl, hex) and match it to the n-nearest R official color names. Clearly it
is easy to interconvert different specification schemes and color spaces,
but matching to the name seems a bit trickier. Seems like if one has a
2006 Aug 01
2
rgb and col2rgb color conversion/modification/shading
I want to get a lighter shade of a color...I have a lot of colored objects and
want each one printed as a foreground against a slightly lighter background.
I thought I could try something like changing the alpha channel by first
converting it to rgb.
But prior to trying that, I'm stuck with how to get the color after converting
using col2rgb() to be interpreted again as a color, rather than
2023 Jul 23
2
col2rgb() function
Hello I have a palette vector of colour blind colours (in hexadecimal)
which I?m using for plots, but they are not see-through, and as I wanted to
overlay some histograms I wanted to convert these colours to rgb, when you
can set the opacity.
I have found the function col2rgb(), which works in the sense that it gives
a vector of numbers but these don?t work directly in rgb because they are
too
2023 Jul 23
1
col2rgb() function
Does adjustcolor() help?
cb8<- c("#000000", "#E69F00", "#56B4E9", "#009E73","#F0E442", "#0072B2",
"#D55E00", "#CC79A7")
plot(0,0,xlim=c(1,8),ylim=c(0,1))
points(1:8,rep(0.5,8),col=cb8,pch=19,cex=2)
points(1:8,rep(0.75,8),col=adjustcolor(cb8, alpha.f = 0.3), pch=19,cex=2)
On 2023-07-23 2:15 p.m., Nick Wray
2023 Jul 23
2
col2rgb() function
Thanks That works nicely Nick
On Sun, 23 Jul 2023 at 19:26, Ben Bolker <bbolker at gmail.com> wrote:
> Does adjustcolor() help?
>
> cb8<- c("#000000", "#E69F00", "#56B4E9", "#009E73","#F0E442", "#0072B2",
> "#D55E00", "#CC79A7")
> plot(0,0,xlim=c(1,8),ylim=c(0,1))
>
2023 Jul 23
1
col2rgb() function
Just one addition which may or may not be useful: The color palette you
use is also known as "Okabe-Ito" and it is the default set of colors in
the palette.colors() function. This function also has an optional alpha
argument. So if you want to generate these colors with an alpha of 0.3 you
can also do:
palette.colors(8, alpha = 0.3)
or more explicitly
palette.colors(8, palette =
2023 Jul 23
1
col2rgb() function
Nick,
I've also made colors transparent by pasting the hex equivalent of, say,
0.3*256 = 76.9 to the hex color code. e.q. for black it might be
"#0000004d" and the 4d is 77 in hex. That way you don't need to convert
back and forth so much. If col is "#000000" the transparent version is
tcol <- paste0(col,"4d")
This would work in one step on a whole
2008 Mar 30
2
Definition of "wrapper"?
I think I more or less understand what a ?wrapper? is, but I?d like to hear
how more experienced R users define it, and especially I'd like to know if
there is a formal definition. In my reading, it seems like there are a
fairly wide range of meanings, but they are all conceptually similar.
I've looked in a couple of the classic R texts, the extensions and
developers' manuals, and R
2023 Jan 12
2
Background for word
Dear,
I am having a lucky day. I am programming in RStudio and when I type
"black" (quotation signs included, the word turn into a word with black
ground. Couldn't get rid of the background----copying to Word, Excel,
text editor and paste back to Rstudio, the word is still in black
background? Help!
??? dv.group<-c("black","othrrace");
2002 May 31
2
Matrix-like plot
Dear List,
I have a 47 species * 83 samples matrix containing percentage abundance
data. I have two cluster analyses one of the samples and one of the
species, and have ordered the rows and columns of the species by samples
matrix according to these two cluster analyses. So far so good!
Now what I want to do is create a plot with the species dendrogram at
the top of the plot, the samples
2009 Nov 16
4
Where are usages like "== 2L" documented?
Gurus:
I keep seeing other people?s code that contain ideas like
If (x == 2L)
X[-1L]
X - 1L
I have some idea of what?s going on, but where is the use of concepts like
?2L? documented?
Thanks, Bryan
*************
Bryan Hanson
Acting Chair
Professor of Chemistry & Biochemistry
DePauw University, Greencastle IN USA
2010 Nov 29
3
Replacing several rows of a matrix at once
Hello Folks. This must be a silly question with a (not) obvious (to me)
answer.
Consider this:
tmp <- matrix(1:200, nrow = 20)
vec <- 300:309
tmp[9,] <- vec # replacing one row works fine
p <- c(3, 11, 17)
tmp[p,] <- vec
# replacing multple rows pastes the values down a column and recycles vec.
What I want to do is replace multiple rows simultaneously at once. I
suppose I can
2008 Aug 18
2
Fwd: Parsing XML or KML into CSV /Using R for geocoding , OR problem
Hi,
I have a data file in a KML format which is Google Earth's format for
geographic data. I need to import it into a csv file . How can I do that.
KML format is just like XML format .example below
Which R module with deal with an OR problem (like transportation problem
using geo coded data as in the example below)
Regards,
Ajay
www.decisionstats.com
-
<?xml version="1.0"
2009 Aug 06
2
making scatter plot points fill semi-transparent
hi all,
i have a simple scatter plot, and i'd like to make it so the scatter
plot colors are slightly transparent. i see in a previous post that
someone mentioned the "alpha" parameter, but i am not sure how it can
be used with the 'plot' function [*].
for example, suppose i have:
plot(mydata$column1, mydata$column2, col="red", cex=1)
i now want to make it so
2010 Mar 06
2
memory error in for loop
hi,
I have been attempting to run this script and am getting some strange
results. The script connects to a database and retrieves a series of
tables, using sequential sql statements. I have tested all of the sql
statements in the PostGreSQL terminal and they all return the desired
results. I place each table into a list and run a FOR loop for 'i' in
the list. The script generates
2010 Mar 14
2
Why doesn't vec[-real.number] give an error or warning? Kids do the darndest things!
Hi all...
My students were conflating grepping for a value in a vector to get the
index, and then removing it with [-index], for instance like this:
set.seed(17)
v <- rnorm(20)
s <- v[-1.18]
They were trying to remove the 12th value in v, which is -1.18 or so.
But the result is, as documented in ?Extract, to coerce 1.18 to the next
lowest integer, and remove the 1st value of v, not the
2011 Jun 23
2
plotmath: unexpected SPECIAL
Hello R Masters and the Rest of Us:
The first of these works fine, the 2nd is accepted but too literal
(the "%->%" is shown in the plot label and in the wrong position).
The 3rd throws and error due to "unexpected SPECIAL". Would someone
recommend a way to format this? I want the two phrases connected by a
right arrow.
TIA, these things always elude me. Bryan