-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utility.tables() not working with unspecified arguments passed to utility.tab() #26
Comments
Dear Lotte,
Sorry I've been slow in getting to this. I've been busy on other projects and I guess Beata has been too.
I'm not very expert at how the ... method of passing arguments works, but I wonder if setting this as
an explicit parameter of utility.tables might not do the trick. What do you think Beata?
Should be fairly easy to fix.
On anotehr matter, I promised Robin Mitra that I would implement his negative binomial method
for catall in the next version of synthpop. I'll try to look at this some time soon and let you know
when I have had a go.
Best Gillian
Gillian M Raab
Research Fellow (part-time)
Scottish Centre for Administrative Data Research
My core working days are Tuesdays and Thursdays
Though I sometimes swap them for other days
07748 678 551
…________________________________
From: LotteVanUtrecht ***@***.***>
Sent: 10 October 2022 14:14
To: bnowok/synthpop ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [bnowok/synthpop] utility.tables() not working with unspecified arguments passed to utility.tab() (Issue #26)
This email was sent to you by someone outside the University.
You should only click on links or attachments if you are certain that the email is genuine and the content is safe.
Dear Beata and Gillian,
The august update of synthpop added a new visualization for the S_pMSE's in utility.tables(). I'm a fan of the new format, but it seems to have broken the functionality of passing "..." arguments to the utility.tab function. For example, the following code used to work, but now gives an error:
`> ods <- SD2011[1:1000, c("sex", "age", "edu", "marital", "region", "income")]
s1 <- syn(ods)
t1 <- utility.tables(s1, ods, tables = "twoway",max.table=1e7)
Error in continuous_scale(aesthetics, "gradient", seq_gradient_pal(low, :
unused argument (max.table = 1e+07)`
It seems to me that arguments contained in "..." are passed to both utility.tab() and to scale_fill_gradient(). Since scale_fill_gradient() does not contain a max.table argument, this causes utility.tables() to give an error. There doesn't seem to be a problem the other way around. For example, this line outputs a purple table without causing an errors because of passing an unused argument to utility.tab().
t2 <- utility.tables(s1, ods, tables = "twoway",high="purple")
Looking at the documentation for scale_fill_gradient() and continuous_scale(), the problem seems to be that scale_fill_gradient() will pass on any argument contained in ... to continuous_scale(), but continuous_scale() accepts only a set number of predefined arguments.
Unfortunately, I can't think of an elegant way to fix this. Explicitly making a preselection of accepted arguments to pass to scale_fill_gradient() would work for now, but will cause problems if the specific arguments in the ggplot2 functions ever change.
Best,
Lotte
—
Reply to this email directly, view it on GitHub<#26>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AE3HB7CPVQBPRZZ4GTA7P33WCQJC7ANCNFSM6AAAAAARBK2C7M>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th’ ann an Oilthigh Dhun Eideann, claraichte an Alba, aireamh claraidh SC005336.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dear Beata and Gillian,
The august update of synthpop added a new visualization for the S_pMSE's in utility.tables(). I'm a fan of the new format, but it seems to have broken the functionality of passing "..." arguments to the utility.tab function. For example, the following code used to work, but now gives an error:
ods <- SD2011[1:1000, c("sex", "age", "edu", "marital", "region", "income")]
s1 <- syn(ods)
t1 <- utility.tables(s1, ods, tables = "twoway",max.table=1e7)
Error in continuous_scale(aesthetics, "gradient", seq_gradient_pal(low, : unused argument (max.table = 1e+07)
It seems to me that arguments contained in "..." are passed to both utility.tab() and to scale_fill_gradient(). Since scale_fill_gradient() does not contain a max.table argument, this causes utility.tables() to give an error. There doesn't seem to be a problem the other way around. For example, this line outputs a purple table without causing any errors.
t2 <- utility.tables(s1, ods, tables = "twoway",high="purple")
Looking at the documentation for scale_fill_gradient() and continuous_scale(), the problem seems to be that scale_fill_gradient() will pass on any argument contained in ... to continuous_scale(), but continuous_scale() accepts only a set number of predefined arguments.
Unfortunately, I can't think of an elegant way to fix this. Explicitly making a preselection of accepted arguments to pass to scale_fill_gradient() would work for now, but will cause problems if the specific arguments in the ggplot2 functions ever change.
Best,
Lotte
The text was updated successfully, but these errors were encountered: