knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(jsonlite)
library(shiny)
library(lab5group8)

Using the population package

Introduction

This package is an excercise in building a package, working with web-API's, and creating an app using Shiny. Specifically, this package contains two functions population.R and app.R.

population

You can create an object of the class population with the following command:

popul <- population$new()

It has two methods:

popul$municipalities()

returns a list of all municipalities in the dataset.

popul$population_data("Stockholm")

returns a dataframe with the year and the population size in that year for a specified municipality. In this case Stockholm.

app

You can run the shiny app by running this command: runGitHub("Jorisvdoorn/lab5group8", "<your github username>", subdir = "R/")



Jorisvdoorn/lab5group8 documentation built on Oct. 30, 2019, 8:02 p.m.