create demogdata from demography package in R
up vote
0
down vote
favorite
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.
r
add a comment |
up vote
0
down vote
favorite
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.
r
Data? Data? Data?
– 42-
Nov 12 at 1:04
@waqas, please provide a dput() of your data. This will make it easier for us to help you.
– wl1234
Nov 12 at 2: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 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 at 11:25
@waqas, use dput(). We don't want to type everything out to try and help you. stackoverflow.com/questions/5963269/…
– wl1234
Nov 12 at 20:03
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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.
r
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.
r
r
asked Nov 11 at 22:07
Waqas
1
1
Data? Data? Data?
– 42-
Nov 12 at 1:04
@waqas, please provide a dput() of your data. This will make it easier for us to help you.
– wl1234
Nov 12 at 2: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 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 at 11:25
@waqas, use dput(). We don't want to type everything out to try and help you. stackoverflow.com/questions/5963269/…
– wl1234
Nov 12 at 20:03
add a comment |
Data? Data? Data?
– 42-
Nov 12 at 1:04
@waqas, please provide a dput() of your data. This will make it easier for us to help you.
– wl1234
Nov 12 at 2: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 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 at 11:25
@waqas, use dput(). We don't want to type everything out to try and help you. stackoverflow.com/questions/5963269/…
– wl1234
Nov 12 at 20:03
Data? Data? Data?
– 42-
Nov 12 at 1:04
Data? Data? Data?
– 42-
Nov 12 at 1:04
@waqas, please provide a dput() of your data. This will make it easier for us to help you.
– wl1234
Nov 12 at 2:49
@waqas, please provide a dput() of your data. This will make it easier for us to help you.
– wl1234
Nov 12 at 2: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 at 11:23
@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 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 at 11:25
@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 at 11:25
@waqas, use dput(). We don't want to type everything out to try and help you. stackoverflow.com/questions/5963269/…
– wl1234
Nov 12 at 20:03
@waqas, use dput(). We don't want to type everything out to try and help you. stackoverflow.com/questions/5963269/…
– wl1234
Nov 12 at 20:03
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53253733%2fcreate-demogdata-from-demography-package-in-r%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Data? Data? Data?
– 42-
Nov 12 at 1:04
@waqas, please provide a dput() of your data. This will make it easier for us to help you.
– wl1234
Nov 12 at 2: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 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 at 11:25
@waqas, use dput(). We don't want to type everything out to try and help you. stackoverflow.com/questions/5963269/…
– wl1234
Nov 12 at 20:03