Learn R Programming

⚠️There's a newer version (0.8.21) of this package.Take me there.

sorvi (version 0.4.05)

Finnish Open Government Data Toolkit

Description

Algorithms for Finnish Open Government Data

Copy Link

Version

Install

install.packages('sorvi')

Monthly Downloads

144

Version

0.4.05

License

BSD_2_clause + file LICENSE

Maintainer

Leo Lahti

Last Published

September 30th, 2013

Functions in sorvi (0.4.05)

GetStaticmapGoogleMaps

Load static Google Map
ConvertGADMPosition2Region

Find municipality (kunta), subregion (seutukunta), region (maakunta), or province (laani) for given GADM map coordinates,
GetHSY

Retrieve HSY data
GetMunicipalElectionData2004

GetMunicipalElectionData2004
FindProvince

List province for each municipality in Finland.
ConvertMMLToRData

Convert MML shape objects into RData format. For detailed example, see https://github.com/louhos/sorvi/wiki/Maanmittauslaitos
GenerateMapColours

Generate color indices for shape object with the aim to color
LouhosStoragePath

LouhosStoragePath
GetPopulationRegister

Retrieve population register data
valid.hetu

Validate a Finnish personal identification number (HETU).
ReadXYZ

ReadXYZ: read XYZ coordinate file Routines for 3D landscape visualization contributed by Janne Aukia 2013
NormalizeValues

NormalizeValues: normalize coordinate values (auxiliary function)
GetParliamentaryElectionData

GetParliamentaryElectionData
PreprocessPresidentti2012UserData

Preprocess user answer data for HS vaalikone 2012
read.px

read.px
GetEdustajaData

Hakee tietyn aanestyksen tulokset edustajaittain
Presidentti2012CandidateAnswers2Numeric

For Presidentti2012 candidate answers, form numerical rating in [0, 1] for the answer options (rougly corresponding to conservative-liberal axis)
GetProvinceInfo

Get information of Finnish provinces.
ConvertGADMResolution

Convert GADM map resolution identifiers between strings and integers
GetHKK

Retrieve HKK data
ReadShape

Retrieve shape objects by their file names.
PlotMatrix

Visualize a matrix with one or two-way color scale. TODO: one-way color scale
GetVaalipiiri

Load Vaalipiiri information Useful for mapping election data to other municipality information
LoadData

LoadData
ReadElectionData

Description: Function for reading in Finnish Municipal Election data available from http://192.49.229.35/K2012/s/ehd_listat/kokomaa.htm#ladattavat Data comes divided into 14 Election districts (vaalipiiri).
GetPostalCodeInfo

Get Finnish postal codes vs. municipalities table from Wikipedia.
LoadMML

LoadMML
GetShapeMML

Shows how the MML Shape files have been converted into the Rdata files included in sorvi. For detailed example, see https://github.com/louhos/sorvi/wiki/Maanmittauslaitos The various Finland shape data files obtained from http://www.maanmittauslaitos.fi/aineistot-palvelut/digitaaliset-tuotteet/ilmaiset-aineistot/hankinta have been preprocessed using this script.
PlotSurface

PlotSurface: visualize 3D surface
PreprocessShapeMML

Preprocessing function for MML data
GetPalvelukartta

Access Paakaupunkiseudun Palvelukartta data
strstrip

Remove spaces from a string (single string or vector/list of strings).
GetElectedCandidates

GetElectedCandidates
GetPXTilastokeskus

Get PC Axis data with custom preprocessing for PC Axis files from Statistics Finland (Tilastokeskus) http://www.stat.fi/
ReadASC

ReadASC: read ASC file Routines for 3D landscape visualization contributed by Janne Aukia 2013
SotkanetIndicators

Description: SotkanetIndicators retrieves Sotkanet data corresponding to a specified data identifier from http://www.sotkanet.fi/rest/1.1/indicators
GetMunicipalityInfoStatFi

Get information of Finnish municipalities from Statistics Finland 2013
SotkanetRegions

Description: SotkanetRegions retrieves Sotkanet regions data from http://www.sotkanet.fi/rest/1.1/regions
fi.en.maakunnat

fi.en.maakunnat data documentation
GetElectionResultsPresidentti2012

Load presidential election 2012 results from HS Next
ReadCandidates

Description: Function for reading in Finnish Municipal Election candidate data published by Ministry of justice. As of 27-09-2012, the data and descriptions are available from http://192.49.229.35/K2012/s/ehd_listat/kokomaa.htm#ladattavat
natural.colors

natural.colors: map colors
GetEdustajanAanestykset

Hakee tietyn kansanedustajan aanestykset
GetParliamentVotes

Hakee kaikki aanestykset eduskuntarajapinnasta
SotkanetCollect

Description: SotkanetCollect converts the list object from Sotkanet to a data.frame
Strip

Strip string i.e. remove spaces from the beginning and end
haeHakusanalla

Hakee hakusanalla aanestyksia eduskuntarajapinnasta
GetMunicipalElectionData2008

GetMunicipalElectionData2008
ConversionTableForMunicipalities

ConversionTableForMunicipalities Used to create conversion table between municipality names and codes
HRI.aluejakokartat

HRI.aluejakokartat data documentation
GetThemeMap

Get map theme
ReadParties

Description: Function for reading in Finnish Municipal Election political party data available from http://192.49.229.35/K2012/s/ehd_listat/kokomaa.htm#ladattavat Party data comes divided into 14 Election districts (vaalipiiri).
translations

translations data documentation
GetDataSotkanetSingleIndicator

Description: GetDataSotkanetSingleIndicator retrieves Sotkanet data for given indicator according to the query arguments and combines indicator, region, and overall data into one table
Presidentti2012ConvertOptionsToNumeric

For Presidentti2012 answers, form numerical rating in [0, 1] for the answer options (rougly corresponding to conservative-liberal axis)
ReadDatavaalit

Load data sets from datavaalit.fi web service
ConvertMunicipalityNames

Convert municipality names into standard versions
is.url

Check if the given object is an url string
ConvertMunicipalityCodes

Convert between municipality codes and names
GetMunicipalElectionData2000

GetMunicipalElectionData2000
Presidentti2012RetrieveAnswerText

For Presidentti2012 answers, get answer IDs, text and rating for the given question ID.
GetDataSotkanet

Description: GetDataSotkanet retrieves Sotkanet data according to the query arguments and combines indicator, region, and overall data into one table
GetMunicipalityInfo

Get information of Finnish municipalities from Statistics Finland 2012 and Maanmittauslaitos (C) MML 2011. For details of MML data, see help(GetShapeMML).
MergeSpatial

Merge a list of Spatial*DataFrame objects into one Spatial*DataFrame
GetHRIaluejakokartat

Preprocess 'aluejakokartat' from HRI
Presidentti2012RateChoices

For Presidentti2012 answers, form numerical rating (in integers) for the answer options (rougly corresponding to the index on conservative-liberal axis)
GetWorldbankMigration

Load migration data for given countries from Worldbank
GetOmakaupunki

Access Omakaupunki data
GetGeocodeOpenStreetMap

Get geo code from OpenStreetMap
GetPresidentti2012

Load Presidentti2012 data
GetMunicipalityInfoMML

Get information of Finnish municipalities from Land Survey Finland 2012. (C) Maanmittauslaitos MML 2012. For details of MML data, see help(GetShapeMML).
PreprocessPresidentti2012

Preprocess Presidentti2012 question data
GetGeocodeGoogleMaps

Get geo code from Google Map
vwReg

Description: Draw regression curve with smoothed error bars based on the Visuprintally-Weighted Regression by Solomon M. Hsiang; see http://www.fight-entropy.com/2012/07/visually-weighted-regression.html The R implementation is based on Felix Schonbrodt's code from http://www.nicebread.de/visually-weighted-watercolor-plots-new-variants-please-vote/
set.breaks

Set breaks for color palette. Internal function.
PlotScale

Visualize color scale for PlotMatrix output NOTE: Experimental. To be tested thoroughly.
Presidentti2012GetUserData

Get user answer data for HS vaalikone 2012
hetu

Extract information from a Finnish personal identification number (HETU).
strstrip.single

Remove spaces from a single string
PlotShape

Visualize the specified fields of a shape object on using 1- or 2-way color scale.
ReadAllParties

Description: Wrapper function for ReadParties that gets all 14 districts and returns all data in a single data frame.
sorvi-package

Algorithmic Tools for Open Data in Finland
sotkanet.json_query

Description: retrieves Sotkanet data from the query url
SotkanetData

Description: SotkanetData retrieves Sotkanet data from http://www.sotkanet.fi/rest/1.0/data/csv? according to the query arguments.
korvaa.skandit

Replace special characters with standard ones.
sotkanet.csv_query

Description: retrieves Sotkanet data from the query url
GetGADM

Get map data in GADM format
ReadAllCandidates

Description: Wrapper function for ReadCandidates that gets all 14 districts and returns all data in a single data frame.
MML

MML data documentation
SplitSpatial

Split a Spatial*DataFrame object into a list of Spatial*DataFrames