Mercurial > op > ShinyEB
changeset 1:d52c39e8228a
経済のコアのオン/オフを追加
author | uncorrelated zombie <uncorrelated@yahoo.co.jp> |
---|---|
date | Thu, 27 Oct 2022 07:21:27 +0900 |
parents | f7bf25ad338e |
children | 720ed4f3405a |
files | EdgeworthBox.R app.R |
diffstat | 2 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/EdgeworthBox.R Thu Oct 27 07:09:58 2022 +0900 +++ b/EdgeworthBox.R Thu Oct 27 07:21:27 2022 +0900 @@ -1,4 +1,4 @@ -drawEdgeworthBox <- function(init_A=0.9, init_B=0.3, CC=TRUE, SHP=TRUE, I=TRUE, E=TRUE){ +drawEdgeworthBox <- function(init_A=0.9, init_B=0.3, CC=TRUE, SHP=TRUE, I=TRUE, E=TRUE, CORE=TRUE){ # 経済の財は合計1に固定し、かつそれぞれの配分の最小値を0.01とする modifyParam <- function(g){ g <- max(0.01, g) @@ -212,7 +212,7 @@ } # 初期点を通る無差別曲線を描画 - if(I) drawIDC(initial_goods, names=c(expression(U[1]^I), expression(U[2]^I)), IsCore=TRUE) + if(I) drawIDC(initial_goods, names=c(expression(U[1]^I), expression(U[2]^I)), IsCore=CORE) with(equilibrium, { # 均衡を通る無差別曲線を描画
--- a/app.R Thu Oct 27 07:09:58 2022 +0900 +++ b/app.R Thu Oct 27 07:21:27 2022 +0900 @@ -19,10 +19,11 @@ min = 0.01, max = 0.99, value = 0.3), - checkboxInput("isCC", "Contract Curve", TRUE), + checkboxInput("isI", "Initial Point", TRUE), + checkboxInput("isE", "Equilibrium", TRUE), checkboxInput("isSHP", "Separating Hyperplane", TRUE), - checkboxInput("isI", "Initial Point", TRUE), - checkboxInput("isE", "Equilibrium", TRUE) + checkboxInput("isCore", "Core", TRUE), + checkboxInput("isCC", "Contract Curve", TRUE) ), mainPanel( @@ -33,7 +34,7 @@ server <- function(input, output) { output$distPlot <- renderPlot({ - drawEdgeworthBox(input$A, input$B, CC=input$isCC, SHP=input$isSHP, I=input$isI, E=input$isE) + drawEdgeworthBox(input$A, input$B, CC=input$isCC, SHP=input$isSHP, I=input$isI, E=input$isE, CORE=input$isCore) }, width=400, height=400) }