Course Hero Logo

DATA HANDLING USING R DPLYR VERBS AND FUNCTIONS.rtf - DATA...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 2 out of 2 pages.

DATA HANDLING USING R DPLYR VERBS AND FUNCTIONSdplyr_verbs <- function (){#Write your code herelibrary(dplyr)hflights <- read.csv("hflights.csv")a <- filter(hflights,FlightNum==428 |FlightNum==460)print(a)hflights1 <- head(hflights,20)b<-select(hflights,FlightNum,contains("Time"),starts_with("Time"), ends_with("Time"))print(b)c <- mutate(hflights1, velocity = Distance/AirTime *60)print(c)d <- arrange(hflights1,desc(ArrDelay))print(d)
by_UniqueCarrier <- group_by(hflights,UniqueCarrier)e <- summarize(by_UniqueCarrier,n_flights = n(), n_canc = sum(UniqueCarrier == NA) )
End of preview. Want to read all 2 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
NoProfessor
Tags
Write

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture