I am trying to change the value in the column in the dataset but its not changing I am attaching the code and the dataset. Please help me out.
library(ggplot2)
library(plotly)
library(dplyr)
library(data.table)
census_data=read.csv("census.csv")
View(census_data)
#column renaming
colnames(census_data)[1:6]=c("Slno","Age","Working Class", "Citizen Score","Education","Education Number")
colnames(census_data)[7:11]=c("Martial Status","Occupation","Relationship","Race","Sex")
colnames(census_data)[12:16]=c("Capital Gain","Capital Loss","Hrs/Week","Native","Avg Salary")
str(census_data)
#frequency Distribution
table(census_data$`Working Class`)
#mean age
tapply(census_data$Age,census_data$`Working Class`, mean)
tapply(census_data$Age,census_data$`Working Class`, min)
tapply(census_data$Age,census_data$`Working Class`, max)
table(census_data$Education)
#Categorise
census_data$Education=as.character(census_data$Education)
census_data$Education[census_data$Education == "1st-4th"]="Primary School"
census_data$Education[census_data$Education == "5th-6th"] ="Primary School"
census_data$Education[census_data$Education == "7th-8th"] ="Secondary School"
census_data$Education[census_data$Education == "9th"] ="Secondary School"
census_data$Education[census_data$Education == "10th"] ="Secondary School"
census_data$Education[census_data$Education == "11th"] ="Higher Secondary School"
census_data$Education[census_data$Education == "12th"] ="Higher Secondary School"
View(census_data)
table(census_data$Education)
dataset link:- https://www.kaggle.com/datasets/palashgain/census-dataset