Skip to content

Instantly share code, notes, and snippets.

@s-kganz
Created January 22, 2021 20:06
Show Gist options
  • Select an option

  • Save s-kganz/c2534666e369f8e19491bb29d53c619d to your computer and use it in GitHub Desktop.

Select an option

Save s-kganz/c2534666e369f8e19491bb29d53c619d to your computer and use it in GitHub Desktop.
Code to make the bullseye dataset in scutr
set.seed(1234)
x <- runif(1000, min=-1, max=1)
y <- runif(1000, min=-1, max=1)
minor <- as.factor(ifelse(x ** 2 + y ** 2 < 0.5 ** 2, "yes", "no"))
minor.inds <- c(1:length(minor))[minor == "yes"]
minor[sample(minor.inds, 25)] <- "no"
df <- data.frame(x, y, minor)
ggplot(df, aes(x, y)) + geom_point(aes(color=minor))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment