Notes
Notes - notes.io |
# Ramesh Bishukarma
# Srihitha Gujja
# Sowmya Kommalapati
# Poojitha Reddy Mahasamudram
library(tidyverse)
#PART 1
epl13 <- read_csv("data/EPL_13-14.csv")
epl14 <- read_csv("data/EPL_14-15.csv")
epl15 <- read_csv("data/EPL_15-16.csv")
epl <- rbind(epl13,epl14,epl15)
epl_subset <- select(epl,"Season","Team","GF","GA","GD" )
epl_subset_new_col <- mutate(epl_subset,goal_diff = GF - GA )
epl_subset_col_check <- mutate(epl_subset_new_col,goal_check =
goal_diff == GD )
# Yes there is a difference in few values as GD column has ? and not - sign due to which goal check value is effected.
tibble <- filter(epl_subset_col_check,goal_check == F)
#PART 2
titanic <- read_csv("data/titanic_data.csv")
titanic_new <- titanic %>% mutate(survival_status =
ifelse(Survived == 1,"Survived",
"Did not survive" ))
#there are some missing values in age so we are replacing it with mean
titanic_age <- subset(titanic_new, !is.na(Age))
summary_table = titanic_new %>%
mutate(Age_replaced = ifelse(is.na(Age), mean(titanic_age$Age), Age)) %>%
group_by(survival_status) %>%
summarise(avg_age= mean(Age_replaced),
avg_fare = mean(Fare))
# % of passengers who survived broken out by gender and the port from which they embarked
# we are replacing the missing value in embarked column with frequently used value S
survived_data <- titanic_new %>%
mutate(Embarked_updated = ifelse(is.na(Embarked), 'S', Embarked)) %>%
group_by(Sex,Embarked_updated,Survived ) %>%
summarise(cnt = n()) %>%
mutate(percentage = round(cnt / sum(cnt), 1)*100) %>% filter(Survived == 1)
survived_data
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team