Chapter 30 Class Analysis

30.1 Meteorites Class Count

30.1.1 Top 20 Class Of Meteorites by Count

We plot the Twenty most occcuring Meteorities in a flipped bar plot.

MeteoritesCount = MetLandings %>%
    group_by(recclass) %>%
    summarise(Count = n()) %>%
    arrange(desc(Count)) %>%
    ungroup() %>%
    mutate(recclass = reorder(recclass,Count)) %>%
    head(20) 

MeteoritesCount %>%
    
    ggplot(aes(x = recclass,y = Count)) +
    geom_bar(stat='identity',colour="white", fill = fillColor) +
    geom_text(aes(x = recclass, y = 1, label = paste0("(",Count,")",sep="")),
              hjust=0, vjust=.5, size = 4, colour = 'black',
              fontface = 'bold') +
    labs(x = 'Meteorites Class', 
         y = 'Count', 
         title = 'Meteorites Class and Count') +
    coord_flip() + 
    theme_bw()

30.1.2 Top 20 Meteorites and their Counts

kable(head(MeteoritesCount,6),"html") %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive")) %>%
  scroll_box(width = "800px")
recclass Count
L6 6583
H5 5611
H4 3335
H6 3232
L5 2746
LL5 1897

30.2 Top 20 Class Of Meteorites by Mass

30.2.1 Median Mass

We plot the Twenty most heavy Meteorities based on their median mass in a flipped bar plot.

MetHeavyMed = MetLandings %>%
    mutate(mass = mass/1e3) %>%
    group_by(recclass) %>%
    summarise(MassMed = median(mass)) %>%
    arrange(desc(MassMed)) %>%
    ungroup() %>%
    mutate(recclass = reorder(recclass,MassMed)) %>%
    head(20)
    
  
  MetHeavyMed %>%
    ggplot(aes(x = recclass,y = MassMed)) +
    geom_bar(stat='identity',colour="white", fill = fillColor) +
    geom_text(aes(x = recclass, y = 1, label = paste0("(",round(MassMed),")",sep="")),
              hjust=0, vjust=.5, size = 4, colour = 'black',
              fontface = 'bold') +
    labs(x = 'Meteorites Class', 
         y = 'Mass Median', 
         title = 'Meteorites Class and Mass Median') +
    coord_flip() + 
    theme_bw()

30.2.2 Median Mass Tabular Data

kable(head(MetHeavyMed,6),"html") %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive")) %>%
  scroll_box(width = "800px")
recclass MassMed
Iron, IC 683
Mesosiderite-A3/4 320
Mesosiderite-C 218
CR-an 114
Mesosiderite-B4 100
Iron, IIIAB-an 63

30.2.3 Mean Mass

We plot the Twenty most heavy Meteorities based on their mean mass in a flipped bar plot.

MetHeavyMean = MetLandings %>%
    mutate(mass = mass/1e3) %>%
    group_by(recclass) %>%
    summarise(MassMean = mean(mass)) %>%
    arrange(desc(MassMean)) %>%
    ungroup() %>%
    mutate(recclass = reorder(recclass,MassMean)) %>%
    head(20) 

   MetHeavyMean %>%
    
    ggplot(aes(x = recclass,y = MassMean)) +
    geom_bar(stat='identity',colour="white", fill = fillColor) +
    geom_text(aes(x = recclass, y = 1, label = paste0("(",round(MassMean),")",sep="")),
              hjust=0, vjust=.5, size = 4, colour = 'black',
              fontface = 'bold') +
    labs(x = 'Meteorites Class', 
         y = 'Mass Mean', 
         title = 'Meteorites Class and Mass Mean') +
    coord_flip() + 
    theme_bw()

30.2.4 Mean Mass Tabular Data

kable(head(MetHeavyMean,6),"html") %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive")) %>%
  scroll_box(width = "800px")
recclass MassMean
Iron, IVB 4322.8329
Iron, IIIE 2409.6104
Iron, IAB-MG 1470.2724
Iron, IC 991.1222
Iron, IAB-ung 769.3243
Mesosiderite-A1 698.2063