-
Notifications
You must be signed in to change notification settings - Fork 14
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
Differing number of rows error #54
Comments
Hi Aidan - thank for letting us know. I haven't actively worked on this project for a while, but I will take a look this week and get back to you :) |
Thank you! I will keep working on it as well, and let you know if I find anything! |
As far as I can tell, the issue arises in the parliament_data function somewhere around here: if (!is.null(election_data)) { The party_seats variable is returning 435, but the rep(row.names(election_data) is returning zero. |
I think I'm close as far as identifying the location of the problem, when I run an opposing benches election I get different errors Error in -group : invalid argument to unary operator |
I am attempting to build an R app that pulls election data from my SQL database and creates visualizations using the ggparliament package. I have built in methods for filtering the data to one house-country-year dataframe, which has all of the necessary variables for running the parliament_data() function. However, when I attempt to run my dataframe through this function, I get the "Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 0, 435" message, which prevents me from successfully creating the dataframe needed to create the plot. I have tried dozens of different iterations, removing all extraneous columns and NA values, but for some reason I cannot seem to get past this issue.
This is a screenshot of the dataframe I am attempting to pass through the function. I have even tried formatting the column names and order to be identical to the examples, but the error persists.
Please let me know if anyone else has had a similar problem, or if there is a workaround I have not tried yet. Some of the code and the data are proprietary for my work so I cannot share everything but happy to provide some additional information if needed. Thank you!
The text was updated successfully, but these errors were encountered: