The documentation has been rewritten. The Italian example in the README previously requested presidential elections, of which Italy has none, and now requests lower-house elections.
Since SAGE v2.0, the archive includes regional, local, and
upper-house elections, referendums, and other elections, in addition to
national legislative and presidential elections.
sage_load() returns all of these elections unless
election_type is set, and its help page now says
so.
In countries whose rows contain a polygon_id column
(since SAGE v2.0), join the polygons returned by
sage_polygons() to the results on country,
year, and polygon_id. The NAME
columns can match two different areas when two elections in the same
year used the same names. The help page of sage_polygons()
now describes this join.
When the source is the public bucket and the installed
arrow includes GCS support, sage_columns() now
reads the schemas of the Parquet files using the random-access GCS
reader of Arrow, instead of downloading six whole partitions (about 298
MB). On a cold cache, the function is roughly two to four times faster.
When arrow has no cloud filesystem, the function downloads
the partitions as before (thanks, @dshkol, #118).
A trailing slash on a remote source
("gs://sage-archive/parquet/") no longer produces a doubled
separator and an error for a missing object. Remote sources are now
normalized once, in .sage_source().
Sources of the form
http://storage.googleapis.com/... now use the same faster
path as https:// sources.
The package now includes a small excerpt of the archive (Iceland
and Samoa, 26 KB) in extdata/mini_archive, which the
examples use in order to run without network access.
When the index of the archive cannot be read, the error message now states which source was tried and whether the likely cause is a remote source that cannot be reached.
Added documentation for all exported functions, a test suite, and a LICENSE file.
sage_load(),
sage_countries(), sage_years(),
sage_columns(), sage_polygons(),
sage_preference_votes(), and
sage_set_source().