I am getting an error when trying to plot a very simple data frame. It is saying Error: Aesthetics must be either length 1 or the same as the data (10): label
I also attempted to do a reprex here but am getting an odd error message. I'm unsure if this will work:
library(readxl)
library(ggplot2)
library(tidyverse)
library(ggrepel)
library(reprex)
library(readxl)
McDonalds_Restaurants <- read_excel("McDonalds & Restaurants.xlsx",
sheet = "QSR Companies")
View(McDonalds_Restaurants)
summary(McDonalds_Restaurants)
names(McDonalds_Restaurants) <- c("Company_Name", "Employee_Count", "Revenues_in_bn")
ggplot(McDonalds_Restaurants, aes(x = Employee_Count, y = Revenues_in_bn)) +
geom_point(size = 5, color = "#0099f9")
ggplot(McDonalds_Restaurants, aes(x = Revenues_in_bn, y = Employee_Count)) +
geom_point(size = 5, color = "#0099f9") +
geom_label_repel(label = rownames(McDonalds_Restaurants$Company_Name), size = 3.5)