R Project Data Cleaning Notes
R Project Data Cleaning Notes
#Data cleaning in R
setwd("E:\\R programme\\R.Directory")
#Read in Data
library(readr)
#Import the raw data into Rscript
df<-read_csv("Data_Cleaning.csv")
df
View(df)
#Apply the count function from dplyr
library(dplyr)
#count function without pipeline
count(df,Facility)
#With pipe
df %>% count(Facility)
#count JobLevel
count(df,JobLevel)
#Replace sepecific value for spaecific case
str(df)
newdf1<- df %>%
mutate(Facility=replace(Facility,match("EP1202",EmpID),"Beaverton"))