evanodell / parlitools Goto Github PK
View Code? Open in Web Editor NEWA collection of useful tools for UK politics
Home Page: http://docs.evanodell.com/parlitools
License: Other
A collection of useful tools for UK politics
Home Page: http://docs.evanodell.com/parlitools
License: Other
Hello.
My name is James Prentice and I am a Sussex University PhD student. I am currently studying British politics elections and have been using the parlitools package on R to create maps for sometime now and it is great. I have never had any problems with the package until today. I thought I would contact you as your name was on the package details document I found online.
Today I have got the error message of
“ Error in open.connection(con, "rb") : HTTP error 404 “
when trying to download the constituency data. Have others had this issue recently? Could it be the location of the data has moved its web address location or could this be a problem with my internet/ computer? Sadly this error message prevents my code producing the maps I have produced as the MP data can not be downloaded and the colours on the map can not be attached to them.
I have downloaded all the updates for the packages and have restarted my computer and internet connection to make sure it was nothing basic like this and the same error message is produced.
If you have any time to get back to me I would be very grateful.
Hello, I'm getting an CRS error when joining data to the base map -- is there a workaround for this? thank you!
> west_trump_no <- dplyr::left_join(west_hex_map, trump_no, by = "gss_code") #Joining to base map
gives error:
old-style crs object detected; please recreate object with a recent sf::st_crs()
Hi,
I am a student and have been working on some UK elections analyses recently, and to aid in doing this I have been attempting to use your package. Unfortunately, after having seemingly succeeded in installing it, when I try to load the package I get:
Error: package or namespace load failed for ‘parlitools’ in namespaceExport(ns, exports):
undefined exports: st_agr<-, st_crs<-, st_geometry<-, st_precision<-, .degAxis, .get_layout, .image_scale, .image_scale_factor, .stop_geos, NA_agr_, NA_bbox_, NA_crs_, NA_m_range_, NA_z_range_, as_Spatial, gdal_crs, gdal_inv_geotransform, gdal_metadata, gdal_polygonize, gdal_rasterize, gdal_read, gdal_subdatasets, gdal_utils, gdal_write, get_key_pos, plot_sf, rawToHex, read_sf, sf.colors, sf_add_proj_units, sf_extSoftVersion, sf_proj_info, sf_project, st_agr, st_area, st_as_binary, st_as_grob, st_as_sf, st_as_sfc, st_as_text, st_axis_order, st_bbox, st_bind_cols, st_boundary, st_buffer, st_cast, st_centroid, st_collection_extract, st_combine, st_contains, st_contains_properly, st_convex_hull, st_coordinates, st_covered_by, st_covers, st_crop, st_crosses, st_crs, st_difference, st_dimension, st_disjoint, st_distance, st_drivers, st_drop_geometry, st_equals, st_equals_exact, st_filter, st_geometry
I also get a warning for some S3 methods as well.
I have tried various methods but nothing seems to have solved it. Of course this may well not be the right place to put this (am new to this so apologies if so), but I hoped as the person who created the package you would have some insight. So if you are able to offer any advice I would be most grateful.
@evanodell rgdal was archived yesterday, so please do move to submit an updated version of parlitools as soon as possible. See https://github.com/r-spatial/evolution https://r-spatial.github.io/evolution/ for details.
I just installed parlitools
from CRAN and attempted to run the current_mps()
function but received an error.
I ran this code:
library(parlitools)
current_mps <- parlitools::current_mps()
And received this error:
Error:
! Assigned data `as.character(df$DateOfBirth)` must be compatible with existing data.
✖ Existing data has 650 rows.
✖ Assigned data has 0 rows.
ℹ Only vectors of size 1 are recycled.
Run `rlang::last_error()` to see where the error occurred.
Warning message:
Unknown or uninitialised column: `DateOfBirth`.
And this is the related output of rlang::last_trace()
:
Backtrace:
▆
1. ├─parlitools::current_mps()
2. │ ├─base::`$<-`(`*tmp*`, "DateOfBirth", value = `<chr>`)
3. │ └─tibble:::`$<-.tbl_df`(`*tmp*`, "DateOfBirth", value = `<chr>`)
4. │ └─tibble:::tbl_subassign(...)
5. │ └─tibble:::vectbl_recycle_rhs_rows(...)
6. │ ├─base::withCallingHandlers(...)
7. │ └─vctrs::vec_recycle(value[[j]], nrow)
8. ├─vctrs:::stop_recycle_incompatible_size(...)
9. │ └─vctrs:::stop_vctrs(...)
10. │ └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = vctrs_error_call(call))
11. │ └─rlang:::signal_abort(cnd, .file)
12. │ └─base::signalCondition(cnd)
13. └─tibble (local) `<fn>`(`<vctrs___>`)
14. └─rlang::cnd_signal(...)
I also attempted to call council_seats()
and received the following error:
> council_seats <- council_seats(councillors = TRUE)
Error in `council_data[c("id", "ons code", "name", "type")]`:
! Can't subset columns that don't exist.
✖ Column `type` doesn't exist.
And this is the related output of rlang::last_trace()
:
Backtrace:
▆
1. ├─parlitools::council_seats(councillors = TRUE)
2. │ ├─council_data[c("id", "ons code", "name", "type")]
3. │ ├─readr:::`[.spec_tbl_df`(...)
4. │ ├─base::NextMethod(`[`)
5. │ └─tibble:::`[.tbl_df`(council_data, c("id", "ons code", "name", "type"))
6. │ └─tibble:::vectbl_as_col_location(...)
7. │ ├─tibble:::subclass_col_index_errors(...)
8. │ │ └─base::withCallingHandlers(...)
9. │ └─vctrs::vec_as_location(j, n, names, call = call)
10. └─vctrs (local) `<fn>`()
11. └─vctrs:::stop_subscript_oob(...)
12. └─vctrs:::stop_subscript(...)
13. └─rlang::abort(...)
Possibly helpful for debugging, this is my sessionInfo()
:
> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Ventura 13.2.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] parlitools_0.4.1 kableExtra_1.3.4 forcats_0.5.2 stringr_1.5.0 dplyr_1.0.10 purrr_0.3.5 readr_2.1.3 tidyr_1.2.1 tibble_3.1.8
[10] ggplot2_3.4.0 tidyverse_1.3.2
I would submit a PR but I don't know how to debug this! Sorry. Just flagging as it seems like this is a problem with the package
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.