Week 3 Assignment- Fortune 500 Companies

Dataset and Context

The data used in this presentation/website can be found here: https://hifld-geoplatform.opendata.arcgis.com/datasets/fortune-500-corporate-headquarters/explore?location=41.765007%2C-113.147529%2C3.79

This data is part of Homeland Infrastructure Foundation-Level Data (HIFLD), and it is free to access in a number for formats.

The dataset represents demographic information on the Fortune 500 list of companies from 2017. This data includes revenue, location, profit, and more, which are all available give that they are publicly traded.

I have chosen to plot a 3D scatter because they’re pretty and fun to move around:

x, y, and z are Revenue, profit, and number of employees, respectively

I hope you enjoy playing a bit with this figure. It was a lot of fun to create.

Today’s date: 11/16/2022

The Plot:

f500 <- read.csv("./data/Fortune_500.csv") ##reading in data.frame

f500$PROFIT_PER_EMPLOYEE <- (f500$PROFIT*1000000)/f500$EMPLOYEES
f500$REVENUE_PER_EMPLOYEE <- (f500$REVENUES*1000000)/f500$EMPLOYEES
#f500 <- f500[,c(6,7,9,10,11,12,13,14,15,16,25)] ##subsetting important info only
head(f500, n=10)
library(plotly)
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
plot_ly(f500, x= ~REVENUES, y= ~PROFIT, z= ~EMPLOYEES, type="scatter3d", color= ~RANK) %>%
  layout(title= "Relationship between profit, revenue, and # Employees")
## No scatter3d mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode