Code Monkey home page Code Monkey logo

kuznets's Introduction

Curva de Kuznets

Autor: Michael A. Johnson Lucas

setwd(dirname(rstudioapi::getSourceEditorContext()$path))

library(ggplot2)
library(readr)
library(magrittr)
library(dplyr)
library(stringr)
library(ggrepel)

gini <- read_csv("./kuznets_2010.csv")
co2 <- read_csv("./kuznets_co2_2010.csv")
# gini <- gini %>% filter(!str_detect(`Country Code`, 'FRA|KGZ|EST'))

kuznet <- data.frame(gini$`Country Name`, gini$Gini, gini$`Income per capita`, stringsAsFactors = TRUE)
colnames(kuznet) <- c("country", "gini", "income_per_capita")

kuznet_co2 <- data.frame(co2$`Country Name`, co2$co2, co2$`Income per capita`, stringsAsFactors = TRUE)
colnames(kuznet_co2) <- c("country", "co2", "income_per_capita")

diagram <- ggplot(data = kuznet, aes(x = income_per_capita, y = gini, label = country))+ geom_point(color = ifelse(kuznet$gini >= 50, "red", "black"))+ labs(title = "Curva de Kuznets 2010", x = "Renta per cápita ($)", y = "Coeficiente de Gini (%)")+ xlim(0,90000)+ylim(0,70)+geom_smooth()
diagram+geom_text_repel(data= subset(kuznet, gini >= 50),stat = "identity",position = "identity", parse = FALSE)+geom_hline(yintercept = 50)+scale_y_continuous(breaks = round(seq(0, 75, by = 10),0))

diagram_co2 <- ggplot(data = kuznet_co2, aes(x = income_per_capita, y = co2, label = country))+ geom_point(color = ifelse(kuznet_co2$co2 >= 2500000, "red", "black"))+ labs(title = "Curva de Kuznets medioambiental 2010", x = "Renta per cápita ($)", y = "Emisiones de CO2 (kt)")+geom_smooth()+ xlim(0,90000)+ylim(0,10000000)
diagram_co2+geom_text_repel(data= subset(kuznet_co2, co2 >= 2500000),stat = "identity",position = "identity", parse = FALSE)+geom_hline(yintercept = 2500000)

diagram_co2_norm <- ggplot(data = kuznet_co2, aes(x = income_per_capita, y = co2, label = country))+ geom_point(color = ifelse(kuznet_co2$co2 >= 250000, "red", "black"))+ labs(title = "Curva de Kuznets medioambiental (menos China y USA) 2010", x = "Renta per cápita ($)", y = "Emisiones de CO2 (kt)")+geom_smooth()+ xlim(0,90000)+ylim(0,2000000)
diagram_co2_norm+geom_text_repel(data= subset(kuznet_co2, co2 >= 250000),stat = "identity",position = "identity", parse = FALSE)+geom_hline(yintercept = 250000)

Curva de Kuznets 2010

Curva de Kuznets

Curva de Kuznets medioambiental 2010

Sin China y USA

2010: Curva de Kuznets medioambiental

Con China y USA

2010: Curva de Kuznets medioambiental

Referencias

kuznets's People

Contributors

ephod avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.