Skip to content

Instantly share code, notes, and snippets.

@benilton
Created May 31, 2012 21:42
Show Gist options
  • Save benilton/2846511 to your computer and use it in GitHub Desktop.
Save benilton/2846511 to your computer and use it in GitHub Desktop.
## Conjunto de dados
x = structure(list(pop = c(23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L,
23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L,
23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L,
23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L), ind = c(12L,
12L, 14L, 14L, 18L, 18L, 20L, 20L, 21L, 21L, 22L, 22L, 24L, 24L,
25L, 25L, 26L, 26L, 27L, 27L, 28L, 28L, 29L, 29L, 31L, 31L, 32L,
32L, 33L, 33L, 34L, 34L, 36L, 36L, 42L, 42L, 49L, 49L, 51L, 52L,
52L, 58L, 58L, 59L, 59L), morph = c("long", "long", "long", "long",
"long", "long", "long", "long", "long", "long", "semi-M_AL",
"semi-M_AL", "long", "long", "short", "short", "long", "long",
"long", "long", "short", "short", "long", "long", "short", "short",
"long", "long", "long", "long", "short", "short", "short", "short",
"semi-M_AL", "semi-M_AL", "middle", "middle", "semi-M_AL", "middle",
"middle", "semi-M_AL", "semi-M_AL", "middle", "middle"), anther = c("S",
"M", "S", "M", "S", "M", "S", "M", "S", "M", "C", "L", "S", "M",
"C", "L", "S", "M", "S", "M", "C", "L", "S", "M", "C", "L", "S",
"M", "S", "M", "C", "L", "C", "L", "C", "L", "C", "L", "L", "C",
"L", "C", "L", "C", "L"), pollen_total = c(12300, 5400, 4200,
8925, 6000, 2500, 18625, 8750, 10350, 2950, 9300, 6750, 5600,
3525, 4875, 2775, 14400, 6650, 20250, 16625, 2000, 3400, 4950,
750, 24750, 14700, 14662.5, 10500, 22000, 8250, 12950, 14400,
5250, 3125, 1500, 6750, 20700, 21000, 500, 30250, 1000, 9900,
7700, 29400, 8250), pollen_size = c(39, 48.2, 39.4, 50.4, 42,
38.2, 40.2, 48, 38, 49, 37.6, 56, 33.2, 43.8, 49.4, 52.6, 36,
50.4, 39.6, 49.8, 51.6, 52.4, 38.2, 47.2, 52, 60.2, 34.8, 45.6,
48, 43, 49.8, 55, 50.2, 60, 55.4, 48.4, 42.2, 59.8, 44.6, 39.4,
59.2, 35, 55.2, 31.4, 51)), .Names = c("pop", "ind", "morph",
"anther", "pollen_total", "pollen_size"), class = "data.frame", row.names = c(NA,
-45L))
## carregando o pacote para graficos
library(ggplot2)
## gerando o grafico de densidades sobrepostas
ggplot(x, aes(x=pollen_size, fill=anther))+geom_density(alpha=.3)
## usando histogramas (ma ideia, na minha opiniao)
ggplot(x, aes(x=pollen_size, fill=anther))+geom_histogram(binwidth=1, alpha=.3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment