tests/testthat/test-geom_feature.R

context("geom_feature")

test_that("a simple plot with features is drawn without errors", {
  expect_no_error( {
    library(ggplot2)
    p <- ggplot(example_genes, aes(xmin = start, xmax = end, y = molecule, fill = gene)) +
      geom_feature(data = example_features, aes(x = position, y = molecule, 
                                                forward = forward)) +
      geom_gene_arrow() +
      facet_wrap(~ molecule, scales = "free", ncol = 1) +
      scale_fill_brewer(palette = "Set3") +
      theme_genes()
    print(p)
  } )
})

Try the gggenes package in your browser

Any scripts or data that you put into this service are public.

gggenes documentation built on Sept. 8, 2023, 5:43 p.m.