0

I am struggling with using demogdata in R demography package. my code is as below

demogdata("Mx","Exposures",ages = 0:105, years= 1961:2016, "mortality","UK", "Male")

Mx and Exposures are my text files(dataset) which contains death rates and exposures from ages 0:105 and for years 1961:2016. the rows and columns in both are the same. i am getting the following error message

Error in if (nrow(pop) != p | ncol(pop) != n) stop("data and pop are of different size") : argument is of length zero

the other code i tried is as below

demogdata(Mx,Exposures,ages = 0:105, years= 1961:2016, "mortality","UK", "Male") Blockquote

and get the following error Error in demogdata(Mx, Exposures, ages = 0:105, years = 1961:2016, "mortality", : Number of ages doesn't match data

Any help is appreciated.

Waqas
  • 1
  • Data? Data? Data? – IRTFM Nov 12 '18 at 01:04
  • @waqas, please provide a dput() of your data. This will make it easier for us to help you. – william3031 Nov 12 '18 at 02:49
  • @wl1234 for Mx, V1 V2 V3 V4 V5 1 age 1961.000 1962.000 1963.000 1964.000 2 0 0.025 0.025 0.025 0.023 3 1 0.002 0.001 0.002 0.001 4 2 0.001 0.001 0.001 0.001 5 3 0.001 0.001 0.001 0.001 – Waqas Nov 12 '18 at 11:23
  • @wl1234 for exposures, V1 V2 V3 V4 V5 1 age 1961.0 1962.0 1963.0 1964.0 2 0 402.4 416.9 423.5 430.2 3 1 382.8 401.7 414.5 420.9 4 2 374.5 383.4 401.7 412.7 5 3 366.1 375.9 384.1 401.4 – Waqas Nov 12 '18 at 11:25
  • @waqas, use dput(). We don't want to type everything out to try and help you. https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – william3031 Nov 12 '18 at 20:03

0 Answers0