library(ggplot2)
library(dplyr)
library(tidyverse)
library(readxl)
#Read data
f <- read_excel("/Users/huayuzhang/Downloads/GEOG379/Difference.xlsx")
#Data cleaning
f <- f %>% select(c(1,11)) %>% as.data.frame() %>%
slice(-c(1,2, 22))
colnames(f) <- cbind("year", "cells")
f$year <- as.factor(f$year)
f$cells <- as.numeric(f$cells)
# Create barplot for the difference of two datasets
p <- ggplot(f, aes(x = year, y = cells)) +
geom_bar(stat = "identity") +
ggtitle("The difference of cells between two datasets")
p
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.