R with hexadecimal flowers

I have a CSV file with 3 columns, X values, Y values, and corresponding hexadecimal (#RRGGBB) values. I tried to create a scatter / bubble graph with the insides of bubbles colored according to hexadecimal values.

symbols(year, logtrans, circles=size, inches=0.05, bg=intel2$HexLogClock)

intel2 $ HexLogClock contains hexadecimal values.

Sorry again for the noob question, any help is appreciated.

+3
source share
3 answers

I think your problem might be in non-character hexadecimal values. Make sure they are the first. See the example below:

year <- 1:5
logtrans <- log(year)
size <- rep(15,5)
intel2 <- data.frame(HexLogClock=c("#330000", "#FFFFCC", "#660000", "#FF0000", "#00FF00"),stringsAsFactors=FALSE)
symbols(year, logtrans, circles=size, inches=0.05, bg=intel2$HexLogClock)

stringsAsFactors=FALSE, read.csv , .

, :

intel2$HexLogClock <- as.character(intel2$HexLogClock)
+8

, intel2$HexLogClock factor. class(intel2$HexLogClock). ( ), HexLogClock (1 = ), , , , ..

, intel2$HexLogClock , :

intel2$HexLogClock <- as.character(intel2$HexLogClock)

, .

:

symbols(year, logtrans, circles=size, inches=0.05, 
        bg=as.character(intel2$HexLogClock))
+2

I think I misunderstand, if so, let me know, but you can just specify the hexadecimal values col, as in:

barplot(1:3, axes=FALSE, col=c("#330000", "#FFFFCC", "660000"))
0
source

All Articles