Data Handling in R - Introduction To Dplyr
Data Handling in R - Introduction To Dplyr
conflicts = FALSE)
dplyrs <- function(){
# print(getwd())
# print(list.files())
# Task 1:
hflights <- read.csv("hflights.csv")
print(dim(hflights))
# Task 2.
# Use the functions head () and tail () to take a look
print(head(hflights))
print(tail(hflights))
# Task 3:
print(head(hflights, 20 ))
# Task 4:
# glimpse () is like a transposed version of print.
glimpse(hflights)
# Task 5:
# Perform the following tasks:
# A. Create a data frame hflights1 which will have first fifty rows of the data
set hflights
d <- hflights[c(1:50),]
# C. To see how tbl behaves like data frames, save the UniqueCarrier column of
hflights tbl
# as an object named carriers, by using standard R syntax and print it.
# Task 6:
# Perform the following tasks:
# B. Add a new column Carrier to hflights which will contain the actual Carrier
name by referring abrCarrier and the UniqueCarrier column of hflights.
dplyrs()