Last answered:

16 Apr 2020

Posted on:

15 Apr 2020

0

R programmig

code- library(tidyverse)
install.packages("ggthemes")
library(ggthemes) emp <- read.csv("employee-data.csv",skip = 23, stringsAsFactors = T)
emp <- as.tibble(emp)
emp
emp$gender <- as.factor(emp$gender)
emp$title <- as.factor(emp$title) error- > emp$gender <- as.factor(emp$gender)
Error in `$<-.data.frame`(`*tmp*`, gender, value = integer(0)) :
replacement has 0 rows, data has 177
In addition: Warning message:
Unknown or uninitialised column: 'gender'.
1 answers ( 0 marked as helpful)
Instructor
Posted on:

16 Apr 2020

0
Hi Viraj,  you need to make sure you load the employee data set correctly. Your error shows a column might be empty, which shouldn't be the case.   Best,  Eli

Submit an answer