library(tidyverse)
library(ggplot2)
library(scales)
library(directlabels)
library(reshape2)
library(forecast)
library(readxl)
df <- read_excel("G:/cleaned.xlsx")
df2<-df%>%
mutate(total_indians= (df2$`Total Male Indians`+df2$`Total Female Indians`))%>%
mutate(total_chinese= (df2$`Total Male Chinese`+ df2$`Total Female Chinese`))%>%
mutate(total_malays= (df2$`Total Male Malays`+ df2$`Total Female Malays`))%>%
mutate(Percentage_change_population = round((((df$`Total Population`- lag(df$`Total Population`))/ lag(df$`Total Population`))*100), digits=2))
df2<-df2%>%
mutate(chinese_population_change = round((((df2$total_chinese- lag(df2$total_chinese))/ lag(df2$total_chinese))*100), digits=2))%>%
mutate(indians_population_change = round((((df2$total_indians- lag(df2$total_indians))/ lag(df2$total_indians))*100), digits=2))%>%
mutate(malays_population_change = round((((df2$total_malays- lag(df2$total_malays))/ lag(df2$total_malays))*100), digits=2))pe or paste code here
error: problem with mutate(), applied to function