0

Starting from a .csv I'd like to highlight a single point in a beeswarm plot.

library("beeswarm")

#carico dati
library(readr)
lavororadar <- read_delim("lavororadar.csv", 
                          ";", escape_double = FALSE, trim_ws = TRUE)
View(lavororadar)

# Beeswarm not penalty goal
beeswarm(lavororadar$npgoal, col=?????, pch=19, method="swarm", cex=0.5)

1 Answers1

0

You can set the colour of individual points using the pwcol argument. Here is an example...

beeswarm(rnorm(200),                #some random data
         pwcol = c(1, rep(2, 199)), #first element is colour 1, rest are colour 2
         pch=19, 
         method="swarm", 
         cex=0.5)

So you just need to set a suitable vector of colours to fit your data.

Andrew Gustar
  • 17,295
  • 1
  • 22
  • 32