library("demography")
library("forecast")
Taidata<-read.demogdata("D:/Users/Adina Ameera/Desktop/Taiwan Mortality.txt"
,type = "mortality",label = "Taiwan",skip = 0,
popskip = 0)
Tai1<-extract.ages(Taidata,0:90,combine.upper = FALSE)
Tai2<-extract.years(Tai1,2000:2019)
plot(Taidata)
plot(Taidata,series="male")
plot(Taidata,series="female")
plot(Tai1)
plot(Tai2)
par(mfrow=c(1,2))
plot(Tai2,series="male",main="Taiwan Male")
plot(Tai2,series="female",main="Taiwan Female")
tai.sm1<-smooth.demogdata(Tai1)
error: Error in if (mean(w[[i]], na.rm = TRUE) < 0) stop("There's a problem. Do you have negative rates?") :
missing value where TRUE/FALSE needed
In addition: Warning message:
In max(pop, na.rm = TRUE) : no non-missing arguments to max; returning -Inf