title: “Assignment 5” author: “peipeiwu” date: “2019 April4”
Provide a list of employees in descending order on last name.
library (tidyverse)
## Warning: package 'tidyverse' was built under R version 3.5.3
## -- Attaching packages --------------------- tidyverse 1.2.1 --
## v ggplot2 3.1.0 v purrr 0.3.2
## v tibble 2.0.1 v dplyr 0.8.0.1
## v tidyr 0.8.3 v stringr 1.4.0
## v readr 1.3.1 v forcats 0.4.0
## Warning: package 'ggplot2' was built under R version 3.5.3
## Warning: package 'tidyr' was built under R version 3.5.3
## Warning: package 'purrr' was built under R version 3.5.3
## Warning: package 'dplyr' was built under R version 3.5.3
## Warning: package 'stringr' was built under R version 3.5.3
## Warning: package 'forcats' was built under R version 3.5.3
## -- Conflicts ------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(readxl)
## Warning: package 'readxl' was built under R version 3.5.3
CustomerT <- read_excel("C:/Users/frank/Downloads/CustomerT.xlsx")
library(readxl)
EmployeeT <- read_excel("C:/Users/frank/Downloads/EmployeeT.xlsx")
sorted_by_lastname_desc <- EmployeeT %>%
arrange(desc(EmployeeLastName))
head(sorted_by_lastname_desc, n = 5)
## # A tibble: 5 x 8
## EmployeeID EmployeeRegionID EmployeeRole EmployeeFirstNa~
## <dbl> <dbl> <chr> <chr>
## 1 6 1 Manager Desiree
## 2 3 2 Sales Rep Sam
## 3 9 1 Sales Rep Noah
## 4 2 2 Sales Rep Roger
## 5 4 2 Sales Rep Chloe
## # ... with 4 more variables: EmployeeLastName <chr>, EmployeeSSN <chr>,
## # EmployeePhoneNumber <chr>, EmployeeEMailAddress <chr>
Note that the echo = FALSE
parameter was added to the code chunk to prevent printing of the R code that generated the plot.