-
-
Save RCura/e464ee64d599ffcc32e7 to your computer and use it in GitHub Desktop.
clem2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(shiny) | |
| shinyUI(fluidPage( | |
| tags$head(tags$link(rel="shortcut icon", href="favicon.png")), | |
| titlePanel("MetaZipf"), | |
| titlePanel(h4("Open Meta Analysis of Zipf's law for cities")), | |
| navlistPanel( | |
| tabPanel("Test", | |
| selectInput( | |
| "plotType", "Plot Type", | |
| c(Scatter = "scatter", | |
| Histogram = "hist")), | |
| # Only show this panel if the plot type is a histogram | |
| conditionalPanel( | |
| condition = "input.plotType == 'hist'", | |
| selectInput( | |
| "breaks", "Breaks", | |
| c("Sturges", | |
| "Scott", | |
| "Freedman-Diaconis", | |
| "[Custom]" = "custom")), | |
| # Only show this panel if Custom is selected | |
| conditionalPanel( | |
| condition = "input.breaks == 'custom'", | |
| sliderInput("breakCount", "Break Count", min=1, max=1000, value=10) | |
| ) | |
| ) | |
| ), | |
| tabPanel("Presentation", | |
| column(3, img(src = "favicon.png",class="img-responsive")), | |
| column(9, h1("Interactive Meta-analysis of Empirical Zipf's Estimates")), | |
| tags$p(class="text-justify", | |
| "This application aims at presenting a meta-analysis of Zipf's law estimations from the literature in an interactive way. Following the meta-analysis proposed by V. Nitsch in 2005, | |
| and extending the pool of papers reviewed, it gives access to the database and specifications used.", br(), br(), | |
| "The idea is to allow interactive queries and to represent the variation of empiricial estimations of Zipf's | |
| law in the literature. This meta-analysis relates the variation of Zipf's estimated coefficients with | |
| urban characteristics (age of the system, economic development) and with the specifications of the regression used (urban definitions, | |
| truncation points, number of cities) to unveil systematic deviations from the iconic -1 slope.", br(), br(), | |
| "The current database covers 1135 estimations from 61 studies, spanning more than 80 countries over 400 years. It is available here: https://github.com/ClementineCttn/MetaZipf."), | |
| br(), | |
| fluidRow(column(6,selectInput("alpha", "I prefer results to be expressed in the regression form of:", choices=c("Lotka", "Pareto"), multiple=FALSE)), | |
| column(6, | |
| h6("The Lotka form : log(Pi) ~ alpha * log(Ri) + b + e(i)"), | |
| h6("The Pareto form : log(Ri) ~ alpha' * log(Pi) + b' + e'(i)"), | |
| h6("with: Pi the population of city i, Ri its rank in the urban hierarchy and alpha' = (1 / alpha)"))), | |
| br(),h4("Contact: [email protected] | Clementine Cottineau, 2016, University College London.") | |
| ), | |
| tabPanel("Literature Overview", | |
| h4('TOP journals where the estimations* are drawn from:'), | |
| dataTableOutput('topjournals'), | |
| '*Each reference count as one, irrespective of the number of estimations', br(), | |
| h4('TOP authors* providing estimations:'), | |
| dataTableOutput('topauthors'), | |
| '*the estimations published by the same author(s) in different publications are not added.', br(), | |
| h4('TOP countries for the dispersion of results*:'), | |
| dataTableOutput('topcountries'), | |
| '*measured by the standard deviation of alpha for countries with more than 5 estimations.', br(), | |
| h3("Complete list of references:"), dataTableOutput('references'), | |
| h6("Nitsch, V. (2005). Zipf zipped. Journal of Urban Economics, 57(1), 86-100. Total population in thousands, from UN estimates (1950-2015) <http://esa.un.org/unpd/wpp/DVD/Files/1_Excel%20(Standard)/EXCEL_FILES/1_Population/WPP2015_POP_F01_1_TOTAL_POPULATION_BOTH_SEXES.XLS.>") | |
| ), | |
| tabPanel("Zipf's Estimates Summary", | |
| h3("Summarise estimations by:"), | |
| fluidRow( | |
| column(4,selectInput("territorys", "Territory", choices=c("ALL","WORLD", "United States of America", "India", "China", "Russia", "Brazil", "South Africa", | |
| "United Kingdom", "France", "USSR", "Israel", "Japan", "Europe", "Spain", "Austria", | |
| "Germany", "Sweden", "Malaysia", "Netherlands", "Turkey", "Ukraine", | |
| "Canada", "Egypt", "Mexico", "Italy", "Argentina", "Denmark", | |
| "Nigeria", "Poland", "Austrialia", "Balkans", "Colombia", "Greece", "Hungary", "Indonesia", | |
| "Morocco", "Norway", "Romania", "Switzerland", "Venezuela"), multiple=FALSE)), | |
| column(4,selectInput("scales", "Urban Definition", choices=c("ALL", "Local Units" = "1_Local", "Agglomerations" = "2_Agglo", | |
| "Metropolitan Areas" = "3_Metro", "Mixed Definitions" = "4_Mixed"), multiple=FALSE)), | |
| column(4,selectInput("decades", "Decade", choices=c("ALL","2010s", "2000s", "1990s", "1980s", "1970s", "1960s", "1950s", | |
| "1940s", "1930s", "1920s", "1910s", "1900s", "1890s", "1880s", | |
| "1870s", "1860s", "1850s", "1840s", "1830s", "1820s", "1810s", | |
| "1800s", "1790s", "1780s", "1770s", "1760s", "1750s", | |
| "1700s", "1600s"), multiple=FALSE)), | |
| dataTableOutput('summary'), | |
| plotOutput('histalpha') | |
| ), | |
| h3("Visualise variation of alpha with:"), | |
| fluidRow( | |
| column(4,selectInput("quanti", "Continuous variable (y)", choices=c("N", "TRUNCATION_POINT", "DATE"), multiple=FALSE)), | |
| column(4,checkboxInput("log", "Log(y)", value=TRUE)), | |
| column(4,selectInput("quali", "Discrete variable (colour)", choices=c("URBANSCALE", "COUNTRY", "DECADE", "ECO", "SOC", "PHYS"), multiple=FALSE)), | |
| plotOutput('plot') | |
| )), | |
| tabPanel("Meta Analysis", | |
| h3("Select Features to Test in the Meta Analysis"), | |
| fluidRow( | |
| column(4,checkboxGroupInput("technicalSpecs", "Technical Specifications", | |
| c("All" = "alltech", | |
| "City definition" = "scale4model", | |
| "Truncation Level" = "truncation4model", | |
| "N Cities" = "N4model"), selected = NULL, inline = FALSE)), | |
| column(4,checkboxGroupInput("topicalSpecs", "Topical Specifications", | |
| c("All" = "alltop", | |
| "Age of Urbanisation" = "urbanisation4model", | |
| "Date (relative to 1950)" = "year4model", | |
| "Country Population" = "countrySize"), selected = NULL, inline = FALSE)), | |
| column(4,checkboxGroupInput("otherSpecs", "Other Specifications", | |
| c("All" = "allother", | |
| "Journal Subject" = "discipline", "", ""), selected = NULL, inline = FALSE)), | |
| br(), | |
| h3("Results of the Regression of Alpha by the Selected Features."), | |
| tableOutput('modelparameters'), | |
| h3("Estimated Coefficients on the Variation of Alpha"), | |
| tableOutput('model'), | |
| column(4,conditionalPanel( | |
| condition = "'truncation4model' %in% input.technicalSpecs == 'TRUE'", | |
| sliderInput("truncVal", "Truncation points (to define high, medium and low truncatures)", | |
| min = 0, max = 1000000, value = c(10000, 100000)))), | |
| column(4,conditionalPanel( | |
| condition = "'N4model' %in% input.technicalSpecs == 'TRUE'", | |
| sliderInput("NVal", "Number of cities (to define large, medium and small samples)", | |
| min = 1, max = 1000, value = c(30, 300)))), | |
| column(4,conditionalPanel( | |
| condition = "'countrySize' %in% input.topicalSpecs == 'TRUE'", | |
| sliderInput("PopVal", "Thousands of Residents (to define large, medium and small countries)", | |
| min = 1, max = 1000000, value = c(10000, 100000)))), | |
| textOutput('REFS'), | |
| h6("N.B. 'Old' continents refer to zones of early urbanisation, in Europe, South-East Asia and the Middle East. America, Oceania, Africa and central Asia are considered 'New' in that respect.") | |
| )), | |
| tabPanel("Raw Meta Data", | |
| h3("Subset Table by:"), | |
| fluidRow( | |
| column(4,selectInput("territory", "Territory", choices=c("ALL","WORLD", "United States of America", "India", "China", "Russia", "Brazil", "South Africa", | |
| "United Kingdom", "France", "USSR", "Israel", "Japan", "Europe", "Spain", "Austria", | |
| "Germany", "Sweden", "Malaysia", "Netherlands", "Turkey", "Ukraine", | |
| "Canada", "Egypt", "Mexico", "Italy", "Argentina", "Denmark", | |
| "Nigeria", "Poland", "Austrialia", "Balkans", "Colombia", "Greece", "Hungary", "Indonesia", | |
| "Morocco", "Norway", "Romania", "Switzerland", "Venezuela"), multiple=FALSE)), | |
| column(4,selectInput("scale", "Urban Definition", choices=c("ALL", "Local Units" = "1_Local", "Agglomerations" = "2_Agglo", | |
| "Metropolitan Areas" = "3_Metro", "Mixed Definitions" = "4_Mixed"), multiple=FALSE)), | |
| column(4,selectInput("decade", "Decade", choices=c("ALL","2010s", "2000s", "1990s", "1980s", "1970s", "1960s", "1950s", | |
| "1940s", "1930s", "1920s", "1910s", "1900s", "1890s", "1880s", | |
| "1870s", "1860s", "1850s", "1840s", "1830s", "1820s", "1810s", | |
| "1800s", "1790s", "1780s", "1770s", "1760s", "1750s", | |
| "1700s", "1600s"), multiple=FALSE))), | |
| dataTableOutput('review')), | |
| tabPanel("Contribute !", | |
| wellPanel( | |
| h3("Add your own reviewed estimates:"), | |
| column(4,selectInput("type", "Document type", choices=c("Journal Article", "Book", "Dissertation"), multiple=FALSE)), | |
| column(4,textInput("author", "Author(s)", value = "Ex: Lotka A. J.")), | |
| column(4,numericInput("year", "Publication Year", value = "2016")), | |
| column(4,textInput("journal", "Journal / Book Title", value = "")), | |
| column(4,numericInput("page", "Page of Results", value = "1")), | |
| column(4,selectInput("regression", "Regression Form*", choices=c("LOTKA", "PARETO"), multiple=FALSE)), | |
| h6("*Regression forms: LOTKA = log(Pi) ~ alpha * log(Ri) + b + e(i) or PARETO = log(Ri) ~ alpha' * log(Pi) + b' + e'(i)"), | |
| h6("with: Pi the population of city i, Ri its rank in the urban hierarchy and alpha' = (1 / alpha)"), | |
| column(4,numericInput("nestimates", "Number of estimates", value = "1")), | |
| column(8,textInput("url", "URL of document", value = "")) | |
| ), | |
| conditionalPanel( | |
| condition = 'input.regression == "PARETO"', | |
| selectInput("test", "test", | |
| list("a", "b")) | |
| ) | |
| # column(4,actionButton("addRef", label = "Add Reference")) | |
| ) | |
| ) | |
| ) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment