Created
January 27, 2018 05:48
-
-
Save JoseRFJuniorLLMs/a8c43ab9a39020db83c0c2ea8c098b2f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Data Preprocessing | |
# Importing the dataset | |
dataset = read.csv('Data.csv') | |
# Taking care of missing data | |
dataset$Age = ifelse(is.na(dataset$Age), | |
ave(dataset$Age, FUN = function(x) mean(x, na.rm = TRUE)), | |
dataset$Age) | |
dataset$Salary = ifelse(is.na(dataset$Salary), | |
ave(dataset$Salary, FUN = function(x) mean(x, na.rm = TRUE)), | |
dataset$Salary) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment