<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Michal Kinel on Medium]]></title>
        <description><![CDATA[Stories by Michal Kinel on Medium]]></description>
        <link>https://medium.com/@nico_kinel?source=rss-398c4b8ea14c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zuq_N94zCz70wUcXwWtwZQ.jpeg</url>
            <title>Stories by Michal Kinel on Medium</title>
            <link>https://medium.com/@nico_kinel?source=rss-398c4b8ea14c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 03:34:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nico_kinel/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Calendar Magic: Creating a Stunning Calendar in R with ggplot2]]></title>
            <link>https://medium.com/@nico_kinel/calendar-magic-creating-a-stunning-calendar-in-r-with-ggplot2-5b580e22be15?source=rss-398c4b8ea14c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b580e22be15</guid>
            <category><![CDATA[ggplot2]]></category>
            <category><![CDATA[rstats]]></category>
            <category><![CDATA[dataviz]]></category>
            <category><![CDATA[custom-theme]]></category>
            <category><![CDATA[calendar-design]]></category>
            <dc:creator><![CDATA[Michal Kinel]]></dc:creator>
            <pubDate>Wed, 31 Jan 2024 21:07:08 GMT</pubDate>
            <atom:updated>2024-02-01T10:46:29.787Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Step-by-Step Guide to Crafting a Visually Appealing Calendar for 2024</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pyAN2ex3vYGZ6f2HiyFgFw.png" /><figcaption>Calendar with ggplot2</figcaption></figure><p>In the realm of data visualization, ggplot2 reigns supreme as the go-to tool for creating stunning and insightful graphics. This versatile package empowers data enthusiasts to transform raw data into captivating visuals that communicate complex information effectively. Today, we embark on an exciting adventure into the world of interactive data visualization, exploring how to create mesmerizing calendars with the power of ggplot2.</p><p>To embark on this data-driven journey, we require a few essential libraries that will serve as our trusty companions:</p><ol><li>tidyverse: This foundational library provides a suite of powerful tools for data wrangling, tidying, and cleaning, ensuring that our data is in pristine condition for visualization.</li><li>data.table: For efficient data manipulation, data.table offers a more concise and performant approach compared to base R data frames. It excels in handling large datasets and performing complex data transformations.</li><li>extrafont: Infusing our calendars with a touch of elegance, extrafont expands the spectrum of fonts available for use in ggplot2 graphics. It grants us the freedom to express our creativity and enhance the visual appeal of our data visualizations.</li></ol><h4>Create Data to plot 📊</h4><ol><li><strong>Create Data Frame</strong></li></ol><pre># Create data frame<br>calendar &lt;- data.table(<br>  date = seq.Date(as.Date(&quot;2024-01-01&quot;), as.Date(&quot;2024-12-31&quot;), by = &quot;day&quot;)<br>)</pre><p>The data.table() function is used to create a new data frame called calendar. This data frame will store the dates from 1 January 2024 to 31 December 2024. The seq.Date() function is used to generate the sequence of dates, and the as.Date() function is used to convert the individual dates into date objects.</p><p>2. <strong>Add Month:</strong></p><pre># Add month<br>calendar[, month := str_to_title(lubridate::month(date,<br>  label = TRUE,<br>  abbr = FALSE))]<br>calendar[, month := factor(month, levels = unique(month))]</pre><p>The month() function from the lubridate package is used to extract the month from each date. The extracted month names are then converted to title case using the str_to_title() function from the stringr package. The month column is then converted to a factor variable with the factor() function, and the levels of the factor are set to the unique month names.</p><p>3. <strong>Add Week:</strong></p><pre># Add week<br>calendar[, week := lubridate::week(date)]</pre><p>The week() function from the lubridate package is used to extract the week number from each date. The week column is created and populated with the week numbers extracted from the dates.</p><p>4. <strong>Add Day:</strong></p><pre># Add day<br>calendar[, day := day(date)]</pre><p>The day() function from the lubridate package is used to extract the day of the month from each date. The day column is created and populated with the extracted day numbers.</p><p>5. <strong>Add Weekday:</strong></p><pre># Add weekday<br>calendar[, weekday := {<br>  weekdays(date, abbreviate = TRUE) %&gt;%<br>    fct_inorder()<br>}]</pre><p>The weekdays() function from the lubridate package is used to extract the weekday from each date. The extracted weekday names are abbreviated using the abbreviate = TRUE argument. The weekday column is created and populated with the abbreviated weekday names. The fct_inorder() function from the forcats package is then used to reorder the levels of the weekday factor to ensure that they appear in a consistent order.</p><p>6. <strong>Sunday as First Day of Week:</strong></p><pre># Sunday as first day of week<br>calendar[, weekend_holydays := fifelse(wday(date) %in% c(7, 1), &quot;weekend&quot;, &quot;workdays&quot;)]</pre><p>The wday() function from the lubridate package is used to return the weekday number. The fifelse() function is used to assign the values &quot;weekend&quot; or &quot;workdays&quot; based on the weekday number. Dates with a weekday number of 1 (Sunday) or 7 (Saturday) are classified as weekends. Other dates are classified as weekdays.</p><p>7. <strong>Add spanish Holydays:</strong></p><p>A vector of Spanish holidays is created using the c() function. The as.Date() function is used to convert the strings representing the holidays to date objects.</p><pre># Holydays Spain<br>holdays &lt;-<br>  c(<br>  &quot;2024-01-01&quot;,<br>  &quot;2024-03-29&quot;,<br>  &quot;2024-05-01&quot;,<br>  &quot;2024-08-15&quot;,<br>  &quot;2024-10-12&quot;,<br>  &quot;2024-11-01&quot;,<br>  &quot;2024-12-06&quot;,<br>  &quot;2024-12-25&quot;<br>  ) %&gt;% as.Date()<br><br># Add holydays<br>calendar[, weekend_holydays := fifelse(date %in% holdays, &quot;holydays&quot;, weekend_holydays)]</pre><p>The fifelse() function is used to assign the value &quot;holydays&quot; to dates that fall on a holiday. Dates that are neither holidays nor weekends remain unchanged.</p><p>8. <strong>Add Week of Month:</strong></p><pre># Add week of month<br>calendar[, week_month := frank(week, ties.method = &quot;dense&quot;), by = month]</pre><p>The frank() function is used to assign a sequential order to the weeks within each month, using the &quot;dense&quot; ties method to ensure that there are no gaps in the numbering. The by = month argument ensures that the week numbering is applied separately for each month. This means that the week of the month will be different for dates in different months, even if they have the same week number.</p><h4>Styling elements 💅</h4><pre># Color palette<br>background &lt;- &quot;#fffefa&quot;<br>weekday_color &lt;- &quot;#313743&quot;<br>weekend_color &lt;- &quot;#67b7b5&quot;<br>holiday_color &lt;- &quot;#fa334c&quot;</pre><p>This section defines a color palette for the calendar. The background color is set to a light gray (#fffefa) to provide a clean and neutral canvas for the calendar. The weekday_color is set to a dark gray (#313743) to represent weekdays, while the weekend_color is set to a light blue (#67b7b5) to represent weekends. The holiday_color is set to a vibrant red (#fa334c) to highlight holidays.</p><p><strong>Fonts 🔠</strong></p><pre># Load fonts<br>loadfonts(device = &quot;win&quot;)<br># Fonts<br>font_base &lt;- &quot;Lato&quot;<br>font_title &lt;- &quot;Lato Black&quot;</pre><p>This line of code loads the required fonts for the calendar. The Lato font is used for the main body text, while the Lato Black font is used for the title and headers. The loadfonts() function from the extrafont package is used to ensure that the fonts are available for use in the R session.</p><p>The font_base font is set to Lato, which is a sans-serif font that provides a modern and clean look. The font_title font is set to Lato Black, which is a bolder version of Lato that is better suited for titles and headers.</p><h4>Creating the Calendar Plot</h4><ol><li><strong>Base ggplot:</strong></li></ol><pre>plot &lt;- calendar %&gt;%<br>  ggplot(aes(x = weekday, y = week_month)) +</pre><p>This line of code initiates the ggplot2 object plot and defines the data frame calendar to be used for plotting. The aes() function specifies the aesthetics, which map the weekday and week_month variables to the x and y axes, respectively.</p><p>2. <strong>Filling Tiles with Weekday/Weekend/Holiday Colors:</strong></p><pre>geom_tile(alpha = 0.8, aes(fill = weekend_holydays)) +</pre><p>This line of code adds tiles to the plot using the geom_tile() function. The alpha argument sets the opacity of the tiles to 0.8 to provide a subtle gradient effect. The fill aesthetic maps the weekend_holydays variable to different colors:</p><ul><li>holiday_color for dates that are holidays</li><li>weekend_color for dates that are weekends</li><li>weekday_color for dates that are weekdays</li></ul><p>3. <strong>Adding Day Numbers as Text:</strong></p><pre>geom_text(<br>    aes(label = day),<br>    family = font_base,<br>    color = fifelse(calendar$weekend_holydays != &quot;weekend&quot;, &quot;white&quot;, &quot;black&quot;),<br>    size = 3<br>  ) +</pre><p>This line of code adds day numbers as text labels using the geom_text() function. The family argument specifies the font name as &quot;Lato&quot;, and the color aesthetic maps the weekend_holydays variable to different colors for better readability:</p><ul><li>white for dates that are not weekdays (holidays or weekends)</li><li>black for dates that are weekdays</li></ul><p>4. <strong>Faceting by Month:</strong></p><pre>facet_wrap( ~ month, scales = &quot;free_x&quot;, ncol = 3) +</pre><p>This line of code facets the plot by month using the facet_wrap() function. The scales = &quot;free_x&quot; argument ensures that each month has its own x-axis scale, allowing the calendar to accommodate different month lengths. The ncol = 3 argument specifies that each row of the facetted plot should have three columns.</p><p>5<strong>. Scaling Axes:</strong></p><pre> scale_x_discrete() +<br> scale_y_reverse(breaks = NULL) +</pre><p>These two lines of code set the scales for the x- and y-axes. The scale_x_discrete() function ensures that the weekdays are displayed in a clear and organized manner. The scale_y_reverse(breaks = NULL) function reverses the order of the y-axis, which makes it easier to read the dates from top to bottom.</p><p>6. <strong>Setting Plot Titles and Captions:</strong></p><pre>labs(<br>    title = &quot;Calendario 2024&quot;,<br>    fill = NULL,<br>    caption = &quot;Festivos de España en rojo\nmichal0091&quot;) +</pre><p>This line of code sets the title, fill aesthetic, and caption for the plot. The title argument specifies the title of the calendar, and the caption argument adds a brief message about the holidays. The fill = NULL argument removes the legend title for the fill aesthetic.</p><p>7. <strong>Setting manual color scale:</strong></p><pre>scale_fill_manual(values = c(holiday_color, weekend_color, weekday_color)) +</pre><p>This line of code defines a manual scale for the fill aesthetic, which corresponds to the colors of the tiles in the calendar plot. The values argument specifies a vector of colors to be used for the different categories:</p><ul><li>holiday_color: Used for tiles representing holidays</li><li>weekend_color: Used for tiles representing weekends</li><li>weekday_color: Used for tiles representing weekdays</li></ul><p>By using a manual scale, we are explicitly assigning the colors to the different categories, rather than using a continuous color scale that would blend between the categories. This makes the colors clearly distinct and easier to distinguish at a glance.</p><p>8. <strong>Applying the Theme:</strong></p><pre>theme_void() +</pre><p>This line of code applies the theme_void() theme, which removes all default grid lines and tick marks, creating a clean and minimalist look for the calendar.</p><p>9. <strong>Customizing Theme Elements:</strong></p><pre># Add theme elements<br>  theme(<br>    plot.margin = margin(1, 0.5, 1, 1, &quot;cm&quot;),<br>    axis.text.x = element_text(<br>      color = weekday_color,<br>      family = font_base,<br>      size = 10,<br>      vjust = 2<br>    ),<br>    # add plot title<br>    plot.title = element_text(<br>      hjust = 0.5,<br>      vjust = 3,<br>      color = weekday_color,<br>      family = font_title,<br>      size = 28<br>    ),<br>    # add plot caption<br>    plot.caption = element_text(<br>      hjust = 1,<br>      color = weekday_color,<br>      family = font_base,<br>      size = 8<br>    ),<br>    # add legend<br>    legend.position = &quot;none&quot;,<br>    # add panel spacing<br>    panel.spacing = unit(0.5, &quot;lines&quot;),<br>    # add panel background<br>    panel.background = element_rect(fill = background, color = background),<br>    # add plot background<br>    plot.background = element_rect(fill = background, color = background)<br>  )</pre><p>This section customizes various elements of the theme to enhance the visual appeal of the calendar. The plot.margin argument sets the margin around the plot, the axis.text.x argument styles the text on the x-axis, the plot.title and plot.caption arguments define the appearance of the title and caption, the legend.position argument removes the legend, the panel.spacing argument adds spacing between the facets, and the panel.background and plot.background arguments set the background color of the facets and plot area, respectively.</p><h4>Thefull plot code</h4><pre>plot &lt;- calendar %&gt;%<br>  ggplot(aes(x = weekday, y = week_month)) +<br>  geom_tile(alpha = 0.8, aes(fill = weekend_holydays)) +<br>  geom_text(<br>    aes(label = day),<br>    family = font_base,<br>    color = fifelse(calendar$weekend_holydays != &quot;weekend&quot;, &quot;white&quot;, &quot;black&quot;),<br>    size = 3<br>  ) +<br>  facet_wrap( ~ month, scales = &quot;free_x&quot;, ncol = 3) +<br>  scale_x_discrete() +<br>  scale_y_reverse(breaks = NULL) +<br>  labs(title = &quot;Calendario 2024&quot;,<br>       fill = NULL,<br>       caption = &quot;Festivos de España en rojo\nmichal0091&quot;) +<br>  theme_void() +<br>  scale_fill_manual(values = c(holiday_color, weekend_color, weekday_color)) +<br>  # Add theme elements<br>  theme(<br>    plot.margin = margin(1, 0.5, 1, 1, &quot;cm&quot;),<br>    axis.text.x = element_text(<br>      color = weekday_color,<br>      family = font_base,<br>      size = 10,<br>      vjust = 2<br>    ),<br>    # add plot title<br>    plot.title = element_text(<br>      hjust = 0.5,<br>      vjust = 3,<br>      color = weekday_color,<br>      family = font_title,<br>      size = 28<br>    ),<br>    # add plot caption<br>    plot.caption = element_text(<br>      hjust = 1,<br>      color = weekday_color,<br>      family = font_base,<br>      size = 8<br>    ),<br>    # add legend<br>    legend.position = &quot;none&quot;,<br>    # add panel spacing<br>    panel.spacing = unit(0.5, &quot;lines&quot;),<br>    # add panel background<br>    panel.background = element_rect(fill = background, color = background),<br>    # add plot background<br>    plot.background = element_rect(fill = background, color = background)<br>  )</pre><h4>Save</h4><pre>ggsave(<br>  filename = &quot;calendar_2024.png&quot;,<br>  path = normalizePath(&quot;R/2024/week_03/&quot;),<br>  plot = plot,<br>  device = &quot;png&quot;,<br>  units = &quot;cm&quot;,<br>  width = 21,<br>  height = 15.75<br>)</pre><h3>☕️ Support My Work with a Cup of Coffee ☕️</h3><p>If you found this article helpful, please consider supporting my work by buying me a coffee! ☕️</p><p>Your generous contribution will help me continue creating valuable content and sharing my knowledge with the world. ✨</p><p><a href="https://www.paypal.com/paypalme/mmkinel">Pay Michal Mikolaj Kinel using PayPal.Me</a></p><h4>Check the repo</h4><p>🎉 ✨ 🤩 Want to see more of my dataviz creations? 👀 ✨ 🤩 🎉</p><p>Join me on my GitHub repository @michal0091/dataviz and explore a world of interactive visualizations, all created with R and ggplot2! 🚀✨</p><p>From interactive bar charts to captivating maps, I’ve got something for everyone. 🌎📈</p><p>So what are you waiting for? Dive into my repository and let your curiosity take you on a data visualization adventure! 🗺️🤓</p><p><a href="https://github.com/michal0091/dataviz">GitHub - michal0091/dataviz: Repositorio de GitHub con scripts de visualizaciones de datos en R. Incluye gráficos de barras, líneas, dispersión, anillos, mapas, árboles, burbujas, caja y probabilidad.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b580e22be15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mapping the Ecological Revolution: Unveiling Poland’s Green Farms with a Brick Choropleth Map]]></title>
            <link>https://medium.com/@nico_kinel/mapping-the-ecological-revolution-unveiling-polands-green-farms-with-a-brick-choropleth-map-eee2254c5890?source=rss-398c4b8ea14c------2</link>
            <guid isPermaLink="false">https://medium.com/p/eee2254c5890</guid>
            <category><![CDATA[choropleth-map]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[ggplot2]]></category>
            <category><![CDATA[ecological-farming]]></category>
            <category><![CDATA[data-driven-storytelling]]></category>
            <dc:creator><![CDATA[Michal Kinel]]></dc:creator>
            <pubDate>Fri, 26 Jan 2024 09:01:42 GMT</pubDate>
            <atom:updated>2024-02-01T10:45:33.075Z</atom:updated>
            <content:encoded><![CDATA[<h4>Uncover the Distribution of Ecological Farms across Poland Using R’s ggplot2 and sf Packages</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IP8rw1f6RZJPPQ4mnPRpgg.png" /></figure><p>In this blog post, we will build a brick choropleth map of ecological farms in Poland. This map will visualize the number of ecological farms in each of Poland’s voivodeships. We will use the ggplot2and sfpackages in R to create the map.</p><h4>What is a Choropleth Map? 🗺️</h4><p>A choropleth map is a type of thematic map that uses color to represent the variation of a variable across a geographic area. The color scheme typically ranges from light to dark, with lighter colors representing lower values of the variable and darker colors representing higher values.</p><h4>Brick Style? 🧱</h4><p>The brick style is a type of choropleth map that uses a pixelated appearance to represent the data. This style is inspired by the appearance of bricks, which are small, rectangular building blocks that can be used to construct various structures.</p><p>Choropleth maps are a powerful way to visualize spatial data. They can be used to identify patterns and trends in the data, and they can also be used to communicate information to a wide audience. The brick style is a unique and engaging way to present choropleth maps, and it can be particularly effective for visualizing data that is related to the number of ecological farms.</p><h3>Let’s do it! 💫</h3><h4>Part 1: Libraries</h4><p>Before we can start building our brick choropleth map, we need to load the necessary libraries. These libraries will provide us with the tools we need to handle spatial data, manipulate data frames, and create maps.</p><pre># Load required libraries<br>library(tidyverse)<br>library(data.table)<br>library(sf)<br>library(raster)<br>library(extrafont)</pre><p>The tidyverse library provides a collection of powerful tools for data manipulation and visualization. The data.table library is a more efficient alternative to base R data frames. The sf library allows us to work with spatial data, including vector data like polygons and points. The raster library is used for working with raster data, which is gridded data. The extrafont library is used to load additional fonts, which we will need for styling our map.</p><p>With these libraries loaded, we are ready to start preparing our data for the map.</p><h4>Part 2: Data Preparation 🗂️</h4><p>Now that we have loaded the necessary libraries, we can start preparing our data for the map. The first step is to load the data for Poland’s voivodeships and the data for the number of ecological farms in each voivodeship</p><pre># Load Poland&#39;s voivodeship data<br>poland &lt;- st_as_sf(raster::getData(&#39;GADM&#39;, country = &#39;POL&#39;, level = 1))<br><br># Load ecological farms data<br>eco_farms &lt;- fread(&quot;R/2024/week_02/eco_farms_poland.csv&quot;)</pre><p>Note: The eco_farms_poland.csv data is available on <a href="https://github.com/michal0091/dataviz/tree/main/R/2024/week_02">github.com/michal0091/dataviz</a></p><p>The sf::st_as_sf() function converts the voivodeship data from a raster format to a spatial format. The fread() function reads the ecological farms data from a CSV file into a data frame.</p><p>Next, we need to calculate the percentage of ecological farms in each voivodeship. This will be the variable that we will use to color the choropleth map.</p><pre># Calculate percentage of ecological farms<br>eco_farms[, perc_eco := eco_farms / farms]</pre><p>We can now join the ecological farms data to the voivodeship data so that we have the percentage of ecological farms for each voivodeship.</p><pre>poland &lt;- poland %&gt;%<br>  left_join(eco_farms, by = &quot;NAME_1&quot;)</pre><h4>Part 3: Creating a Grid and Extracting Centroids 🥅</h4><p>To create a grid for the map, we will use the st_make_grid() function from the sf package. The st_make_grid() function creates a regular grid of polygons based on the extent of the voivodeship data.</p><pre># Make grid<br>grid &lt;- st_make_grid(poland, n = c(45,45)) %&gt;% st_sf()</pre><p>The n = c(45,45) argument specifies the number of grid cells in each dimension. In this case, we are creating a grid with 45 cells in the x-direction and 45 cells in the y-direction.</p><p>We can then join the grid to the voivodeship data using the st_join() function to add the percentage of ecological farms to each grid cell.</p><pre>grid &lt;- st_join(grid, poland)</pre><p>Finally, we can filter the grid to only include grid cells that have valid values for the percentage of ecological farms.</p><pre>grid &lt;- grid %&gt;% filter(!is.na(perc_eco))</pre><p>To extract the centroids of each grid cell, we can use the st_centroid() function.</p><pre>centroids &lt;- st_centroid(grid)</pre><p>The st_centroid() function calculates the geometric center of each polygon in the grid. The centroids will be used to create the pixelated effect on the map.</p><h4>Part 4: Styling 💅</h4><p><strong>Color Palette: </strong>The background color is set to a dark shade of blue (#0D1F2D), which creates a subtle and sophisticated background for the map. The text color is set to a bright white (#FFFFFF) to ensure that all labels and annotations are easily readable. The palette is used to set the color scale for the choropleth map. In this case, we are using a custom palette of five colors that range from a light shade of red (#FF3D3D) to a dark shade of green (#0D6E6E).</p><p><strong>Fonts</strong>: We are using two fonts for the map: Lato for the base text and Lato Black for the title. The Lato font is a modern and sans-serif font that is easy to read and looks good on both screens and print. The Lato Black font is a heavier version of the Lato font that is used for the title to give it more emphasis.</p><pre># Color palette<br>background &lt;- &quot;#0D1F2D&quot;<br>text &lt;- &quot;#FFFFFF&quot;<br>palette &lt;-  c(&quot;#FF3D3D&quot;, &quot;#ffe0c8&quot;,&quot;#afffff&quot;, &quot;#4a9d9c&quot;, &quot;#0D6E6E&quot;)<br><br># Load fonts<br>loadfonts(device = &quot;win&quot;)<br><br># Fonts<br>font_base &lt;- &quot;Lato&quot;<br>font_title &lt;- &quot;Lato Black&quot;</pre><h4>Part 5: Let’s do the plot 📊</h4><p>Now that we have all of the styling elements in place, we can create the final plot.</p><pre>plot &lt;- <br>  ggplot() +<br>  # Base Map<br>  geom_sf(data = grid, aes(fill = perc_eco), color = background) +<br>  # Pixelated Effect<br>  geom_sf(data = centroids,<br>          color = alpha(&quot;black&quot;, 0.75),<br>          size = 1) +<br>  #  Labels and Title<br>  labs(fill = &quot;% of eco-farms&quot;, title = &quot;Ecological farms in Poland \U1F33D&quot;,<br>       caption = &quot;Source: Główny Urząd Statystyczny\nmichal0091&quot;) +<br>  guides(fill = guide_legend(<br>    nrow = 1,<br>    title.position = &quot;top&quot;,<br>    label.position = &quot;bottom&quot;<br>  )) +<br>  # Color Scale and Legend<br>  scale_fill_stepsn(labels = scales::percent, colors = palette,<br>                    breaks = c(0, .01, .02, .04, .06, .08)) +<br>  #Additional Styling<br>  theme_void() +<br>  theme(<br>    plot.margin = margin(1, 0.5, 1, 1, &quot;cm&quot;),<br>    plot.background = element_rect(fill = background, color = NA),<br>    plot.title = element_text(<br>      hjust = 0.5,<br>      vjust = 6,<br>      color = text,<br>      family = font_title,<br>      size = 28 <br>    ),<br>    plot.caption = element_text(<br>      hjust = 1,<br>      vjust = -18,<br>      color = text,<br>      family = font_base,<br>      size = 8 <br>    ),<br>    legend.position = &quot;bottom&quot;,<br>    legend.title = element_text(<br>      hjust = 0.5,<br>      color = text,<br>      family = font_title<br>    ),<br>    legend.text = element_text(color = text, family = font_base)<br>  ) </pre><ul><li><strong>Layer 1: Base Map</strong> — This layer creates the base map of Poland’s voivodeships using the geom_sf() function. The fill aesthetic maps the percentage of ecological farms to a color scale, and the color aesthetic sets the background color to a dark blue (#0D1F2D).</li><li><strong>Layer 2: Pixelated Effect </strong>— This layer adds the centroids of each grid cell to the map. The color aesthetic sets the color of the centroids to a translucent black (alpha(&quot;black&quot;, 0.75)), and the size aesthetic sets the size of the centroids to 1 unit. The centroids create the pixelated effect by creating small squares on top of the voivodeship polygons.</li><li>Layer 3: Labels and Title — This layer adds the title, subtitle, and caption to the map. The fill aesthetic sets the label color for the choropleth map to white (#FFFFFF), and the title, subtitle, and caption are all set to a consistent font (Lato).</li><li>Layer 4: Color Scale and Legend — This layer sets the color scale for the choropleth map. The scale_fill_stepsn() function creates a step-like color scale with five colors ranging from white (#FFFFFF) to dark green (#0D6E6E). The labels aesthetic sets the labels for the color scale to percentages, and the breaks aesthetic sets the breakpoints for the color scale.</li><li>Layer 5: Additional Styling — This layer applies additional styling to the plot, including the plot margins, background color, title font, caption font, legend position, and legend text font. Mor info <a href="https://ggplot2.tidyverse.org/reference/ggtheme.html#arguments">here</a>.</li></ul><h4>Part 6: Save the art! 🎨</h4><pre>ggsave(<br>  filename = &quot;eco_farms_poland.png&quot;,<br>  path = normalizePath(&quot;R/2024/week_02/&quot;),<br>  plot = plot,<br>  device = &quot;png&quot;,<br>  units = &quot;cm&quot;,<br>  width = 15.75,<br>  height = 21<br>)</pre><p>This code saves the final brick choropleth map as a PNG file. The image is 15.75 centimeters wide and 21 centimeters high.</p><h3>☕️ Support My Work with a Cup of Coffee ☕️</h3><p>If you found this article helpful, please consider supporting my work by buying me a coffee! ☕️</p><p>Your generous contribution will help me continue creating valuable content and sharing my knowledge with the world. ✨</p><p><a href="https://www.paypal.com/paypalme/mmkinel">Pay Michal Mikolaj Kinel using PayPal.Me</a></p><h3>Check the repo</h3><p>Giddy up, code enthusiasts! 🐎</p><p>Get ready to geek out with me as I unveil the full code behind my latest masterpiece: “Mapping the Ecological Revolution: Unveiling Poland’s Green Farms with a Brick Choropleth Map!” 🤯🗺️ So check week 2 of 2024 of my repo.</p><p>This map is so epic, it’ll make you want to shout “Polska gurom!” 🇵🇱💪</p><p>But don’t stop there! My GitHub repo is a treasure trove of other nerdy creations, from mind-bending machine learning models to data visualizations that’ll make your eyes pop! ✨📊</p><p>So come on, join the party and unleash your inner data superhero! 😎</p><p>Happy coding! 👨‍💻💻</p><p><a href="https://github.com/michal0091/dataviz">GitHub - michal0091/dataviz: Repositorio de GitHub con scripts de visualizaciones de datos en R. Incluye gráficos de barras, líneas, dispersión, anillos, mapas, árboles, burbujas, caja y probabilidad.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eee2254c5890" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create a Dumbbell Plot in R]]></title>
            <link>https://medium.com/@nico_kinel/how-to-create-a-dumbbell-plot-in-r-fd23aa0104ea?source=rss-398c4b8ea14c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd23aa0104ea</guid>
            <category><![CDATA[clean-coding]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[ggplot2]]></category>
            <category><![CDATA[dumbbell-plot]]></category>
            <category><![CDATA[r-programming]]></category>
            <dc:creator><![CDATA[Michal Kinel]]></dc:creator>
            <pubDate>Tue, 16 Jan 2024 23:16:48 GMT</pubDate>
            <atom:updated>2024-02-01T10:44:58.377Z</atom:updated>
            <content:encoded><![CDATA[<h3>Eolic Power Production in Spain: A Comparison of Different Regions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1TWfYRCKUgSO6DaqcaCaqw.png" /></figure><p>A dumbbell plot is a type of statistical graph that is used to compare two sets of data. It is often used to compare the average values of two groups or the changes in values over time.</p><h4><strong>Why R?</strong></h4><p>R is a powerful programming language specifically designed for statistical computing and graphics. It offers a wide range of features that make it an excellent choice for creating visually appealing and informative graphs, including the dumbbell plot.</p><p>Here are some of the key reasons why you should use R to create graphs, especially dumbbell plots:</p><ul><li><strong>Flexibility</strong>: R provides a wide variety of graphing functions and libraries, allowing you to create graphs of various types and styles, including custom dumbbell plots.</li><li><strong>Power</strong>: R’s statistical capabilities enable you to perform complex data manipulations and transformations before creating your graphs, ensuring that your data is presented accurately and effectively.</li><li><strong>Reproducibility</strong>: R’s code-based nature promotes reproducibility, allowing others to understand and replicate your data analysis and graph creation process.</li><li><strong>Community</strong>: R has a large and active community of users, providing extensive documentation, tutorials, and forums where you can seek help and share knowledge.</li></ul><h4>Load data</h4><p>To begin, we’ll load the necessary libraries for this analysis:</p><pre>library(tidyverse)<br>library(data.table)<br>library(extrafont)</pre><p>The tidyverse package is a collection of R packages designed to make data wrangling and analysis more efficient and consistent. It includes packages for data manipulation dplyr, data visualization ggplot2, tidy data formatting tibble, and more.</p><p>The data.tablepackage provides enhanced data manipulation functionality, particularly for efficient handling of large data sets. It offers features like fast data filtering, sorting, and subsetting, making it a valuable tool for data analysis.</p><p>The extrafontpackage extends the availability of fonts in R, allowing us to use more diverse and visually appealing fonts in our graphs.</p><p>Next, we’ll load the eolic power data from a CSV file you can get from my GitHub repository <a href="https://github.com/michal0091/dataviz">michal0091/dataviz</a> in R/2024/week_01:</p><pre>dt &lt;- fread(&quot;R/2024/week_01/eolica.csv&quot;, header = T)</pre><p>The fread() function from the data.table package is used to efficiently read the CSV file into a data table object dt. The header = T argument specifies that the CSV file contains a header row with column names.</p><h4>Data Transformation</h4><p>Before we create the dumbbell plot, we need to transform the data into a format that is suitable for ploting. This involves converting the data from a wide format to a long format and setting the hjust aesthetic mapping.</p><p><strong>Long Format Conversion</strong></p><p>The melt() function from the tidyverse package is used to convert the data from a wide format to a long format. This involves stacking the data for each region and year, creating two columns: CCAA for the region and GWh for the eolic power production.</p><pre>dt &lt;- dt %&gt;%<br>  melt(id.vars = &quot;CCAA&quot;, measure.vars = c(&quot;2012&quot;, &quot;2022&quot;), value.name = &quot;GWh&quot;, variable.name = &quot;Año&quot;)</pre><p><strong>Setting </strong>hjust<strong> Aesthetic Mapping</strong></p><p>The my_hjust variable is used to determine the horizontal alignment of the bars in the dumbbell plot. A value of 1 indicates that the bar should be aligned to the left side of the dumbbell, and a value of 0 indicates that it should be aligned to the right side.</p><pre>dt[, my_hjust := fifelse(GWh[2] - GWh[1] &gt;= 0, 1, 0), CCAA]<br>dt[Año == 2012, my_hjust := fifelse(my_hjust == 1, 0, 1)]r</pre><p>The fifelse() function is used to create a my_hjust variable that indicates whether the annual production increased (1) or decreased (0) between 2012 and 2022 for each region.</p><pre>dt[, nchar := nchar(GWh) + 1]</pre><h3>Plot</h3><h4>Setting Style Variables</h4><p>Before creating the dumbbell plot, we’ll set the style variables for the plot’s appearance. These variables define the colors, fonts, and other visual elements that will be used in the plot.</p><p><strong>Load Fonts</strong></p><p>To ensure consistent and appealing fonts across different operating systems, we’ll load the required fonts using the loadfonts()function from the extrafontpackage.</p><pre># Load fonts<br>loadfonts(device = &quot;win&quot;)</pre><p><strong>Color Palette</strong></p><p>The base_clear, base_clear_sh, base_text, and base_accent_light variables define the base colors for the plot&#39;s background, light shading, text, and subtle accents, respectively.</p><pre># Color palette<br>base_clear &lt;- &quot;#efeef2&quot;<br>base_clear_sh &lt;- &quot;#e1e2e7&quot;<br>base_text &lt;- &quot;#2e2445&quot;<br>base_accent_light &lt;- &quot;#f2e1d5&quot;</pre><p>The color_1 and color_2 variables define the main colors for the dumbbell bars, representing 2012 and 2022, respectively.</p><pre>color_1 &lt;- &quot;#5fb0dd&quot;<br>color_2 &lt;- &quot;#f04b73&quot;</pre><p>The color_positive and color_negative variables define the colors for positive and negative values, respectively, used for annotations or other highlighting purposes.</p><pre>color_positive &lt;- &quot;#284D33&quot;<br>color_negative &lt;- &quot;#6B3842&quot;</pre><p><strong>Fonts</strong></p><p>The font_base and font_title variables define the base font and title font, respectively, for the text elements in the plot.</p><pre># Fonts<br>font_base &lt;- &quot;Lato&quot;<br>font_title &lt;- &quot;Lato Black&quot;</pre><p>These style variables will be used in the theme() function to customize the overall appearance of the dumbbell plot.</p><h4>Creating the Base Plot</h4><p>Now, we can create the base plot for the dumbbell plot. This involves defining the aesthetics, geoms, scales, flip coordinates, labels, and theme for the plot.</p><p><strong>Aesthetics</strong></p><p>The aes() function is used to define the aesthetics for the plot. The following aesthetics are defined:</p><ul><li>x: The x-axis variable, which is the region (CCAA).</li><li>y: The y-axis variable, which is the eolic power production (GWh).</li><li>fill: The fill color of the dumbbell bars, which is based on the year (Año).</li><li>group: The group variable, which is also based on the year (Año).</li></ul><p><strong>Geoms</strong></p><p>The geoms() function is used to add the layers to the plot. The following geoms are added:</p><ul><li>geom_line: This geom draws a line connecting the annual production values for each region.</li><li>geom_point: This geom adds a point at each annual production value for each region.</li><li>geom_text: This geom adds text labels to each annual production value for each region. The text is nudged up or down depending on whether the production increased or decreased between 2012 and 2022.</li></ul><p><strong>Scales</strong></p><p>The scale_color_manual() function is used to set the color scheme for the dumbbell bars. The manual scale uses the color_1 and color_2 variables to define the colors for 2012 and 2022, respectively.</p><p>The scale_y_continuous() function is used to set the scale for the y-axis. The limits are set to c(-500, 16000) to accommodate the maximum and minimum production values. The breaks are set to seq(0, 16000, 2000) to provide a clear representation of the production values.</p><p><strong>Flip Coordinates</strong></p><p>The coord_flip() function is used to flip the coordinates of the plot so that the regions are displayed vertically instead of horizontally. This makes it easier to compare the annual production values for each region.</p><p><strong>Labels</strong></p><p>The labs() function is used to set the labels for the plot. The following labels are defined:</p><ul><li>title: The title of the plot, which is &quot;Energía eólica en España&quot; (Eolic energy in Spain).</li><li>subtitle: The subtitle of the plot, which is &quot;GWh producidos en 2012 y 2022&quot; (GWh produced in 2012 and 2022).</li><li>caption: The caption of the plot, which includes the source of the data and the author.</li><li>x: The label for the x-axis, which is left blank.</li><li>y: The label for the y-axis, which is left blank.</li></ul><p><strong>Theme</strong></p><p>The theme_minimal() function is used to apply a minimal theme to the plot. The theme() function is used to customize the theme further. The following customizations are made:</p><ul><li>legend.position: The legend is positioned at the top of the plot.</li><li>text: The text elements of the plot are set to use the base_text and font_base variables for font color and family, respectively.</li><li>plot.title: The title of the plot is set to use the base_text, font_title, and size 18 variables for font color, family, and size, respectively.</li><li>axis.text.x: The x-axis text labels are set to use the base_text and font_title variables for font color and family, respectively.</li><li>axis.text.y: The y-axis text labels are set to use the base_text, font_base, and size 12 variables for font color, family, and size, respectively.</li><li>plot.caption: The plot caption is set to use the base_text, font_base, and size 8 variables for font color, family, and size, respectively.</li><li>plot.margin: The plot margin is set to 1.5, 0.5, 1, 1 centimeters.</li><li>panel.grid: The grid lines are hidden using the element_blank() function.</li><li>plot.background: The background of the plot is set to use the base_clear color.</li></ul><pre>plot &lt;- dt[,<br>           # Plot<br>           ggplot(.SD, aes(<br>             x = reorder(CCAA, GWh),<br>             y = GWh,<br>             fill = Año,<br>             group = Año)<br>             ) +<br>             <br>             # Geoms<br>             geom_line(aes(group = CCAA), color = base_accent_light, linewidth =<br>                         3.5) +<br>             geom_point(aes(color = Año), size = 3) +<br>             geom_text(<br>               aes(label = GWh, color = Año),<br>               nudge_y = fifelse(my_hjust == 1, nchar * 180, -nchar * 180),<br>               hjust = my_hjust,<br>               show.legend = FALSE<br>             ) +<br>             <br>             # Scales<br>             scale_color_manual(values = c(color_1, color_2)) +<br>             scale_y_continuous(limits = c(-500, 16000),<br>                                breaks = seq(0, 16000, 2000)) +<br>             <br>             # Flip coordinates<br>             coord_flip() +<br>             <br>             # Labels<br>             labs(<br>               title = &quot;Energía eólica en España&quot;,<br>               subtitle = &quot;GWh producidos en 2012 y 2022&quot;,<br>               caption = &quot;Fuente: Elaboración propia a partir de datos oficiales del Gobierno de España\nmichal0091&quot;,<br>               x = NULL,<br>               y = NULL<br>             ) +<br>             <br>             # Theme<br>             theme_minimal() +<br>             theme(<br>               legend.position = &quot;top&quot;,<br>               text = element_text(color = base_text, family = font_base),<br>               plot.title = element_text(<br>                 color = base_text,<br>                 family = font_title,<br>                 size = 18<br>               ),<br>               axis.text.x = element_text(color = base_text, family = font_title),<br>               axis.text.y = element_text(<br>                 color = base_text,<br>                 family = font_base,<br>                 size = 12<br>               ),<br>               plot.caption =  element_text(<br>                 color = base_text,<br>                 family = font_base,<br>                 size = 8<br>               ),<br>               plot.margin = margin(1.5, 0.5, 1, 1, &quot;cm&quot;),<br>               panel.grid = element_blank(),<br>               plot.background = element_rect(fill = base_clear)<br>             ) <br>             ]</pre><h4>Adding Column Annotations</h4><p>To add annotations for the difference between eolic power production in 2012 and 2022, we’ll create a separate plot that displays the difference values and their respective regions. This plot will be placed adjacent to the dumbbell plot to provide a concise summary of the change.</p><p><strong>Creating the Difference Plot</strong></p><p>The dt_diff data table contains the difference in eolic power production for each region between 2012 and 2022. To create the difference plot, we&#39;ll use the ggplot2 package to create a vertical bar chart with labels for each region and the difference values.</p><pre># Create the difference plot<br>plot_box &lt;- dt_diff[, ggplot(.SD) +<br>  geom_text(<br>    aes(<br>      x = reorder(CCAA, -as.numeric(CCAA)),<br>      y = 0,<br>      label = diff_label,<br>      family = font_base,<br>      vjust = 1<br>    ),<br>    fontface = &quot;bold&quot;,<br>    size = 3.5,<br>    color = color<br>  ) +<br>  geom_text(<br>    aes(x = 18, y = 0), # 18 is the length + 1 of the x axis<br>    label = &quot;dif.&quot;,<br>    nudge_y = .0,<br>    nudge_x = .8,<br>    color = base_text,<br>    family = font_title,<br>    size = 3.5,<br>    vjust = &quot;inward&quot;,<br>    hjust = &quot;inward&quot;<br>  ) +<br>  coord_flip() +<br>  theme_void() +<br>  # Theme<br>  theme(<br>    text = element_text(color = base_text, family = font_base),<br>    plot.margin = margin(<br>      l = 0,<br>      r = 0,<br>      b = 0,<br>      t = 0<br>    ),<br>    panel.background = element_rect(fill = base_clear_sh, color = base_clear_sh),<br>    legend.position = &quot;none&quot;<br>  )]</pre><p>The geom_text() function is used to add text labels for each region and the difference values. The vjust aesthetic is used to adjust the vertical alignment of the labels. The color aesthetic is used to color the text labels based on whether the difference is positive or negative.</p><p>The coord_flip() function is used to flip the coordinates of the plot so that the regions are displayed vertically instead of horizontally, matching the dumbbell plot. The theme_void() function is used to create a minimalist theme with a transparent background. The theme() function is used to customize the theme further, including the color of the text and background.</p><h4>Combine the plots</h4><p>To combine the dumbbell plot (plot) with the difference plot (plot_box), we can use the annotation_custom() function from the ggplot2 package. This function allows us to overlay an existing plot onto another plot, specifying the region of overlap using xmin and xmax for the x-axis and ymin and ymax for the y-axis.</p><pre># Make combined plot<br>plot_combined &lt;- plot + annotation_custom(ggplotGrob(plot_box), xmin = 0.25, xmax = 19, <br>                       ymin = 15500, ymax = 16500)</pre><h4>Save</h4><p>To save the combined plot (plot_combined) as a PNG file, you can use the ggsave() function from the ggplot2 package. This function allows you to save the plot to a specified file path and set the dimensions and other options.</p><pre>ggsave(<br>  filename = &quot;eolica.png&quot;,<br>  path = normalizePath(&quot;R/2024/week_01/&quot;),<br>  plot = plot_combined,<br>  device = &quot;png&quot;,<br>  units = &quot;cm&quot;,<br>  width = 30 ,<br>  height = 18.54102<br>)</pre><h3>☕️ Support My Work with a Cup of Coffee ☕️</h3><p>If you found this article helpful, please consider supporting my work by buying me a coffee! ☕️</p><p>Your generous contribution will help me continue creating valuable content and sharing my knowledge with the world. ✨</p><p><a href="https://www.paypal.com/paypalme/mmkinel">Pay Michal Mikolaj Kinel using PayPal.Me</a></p><h3>Check the repo</h3><p>Are you curious about the code behind this 🤜🤛 dumbbell plot of eolic power production in Spain? Well, look no further! 👀 I’ve made it all available on my GitHub repository 📁, so you can dive into the details and learn how to create your own dumbbell plots. 🤓</p><p>The code is super ✨ clean and easy to understand, even for beginners. 👩‍💻 And if you get stuck, I’m always happy to help 🙋‍♂️.</p><p>So go ahead, give it a try! 🚀 And don’t forget to leave a star ⭐️ on my repository if you like it. 😉</p><p>Happy coding! 👨‍💻💻</p><p><a href="https://github.com/michal0091/dataviz/tree/main">GitHub - michal0091/dataviz: Repositorio de GitHub con scripts de visualizaciones de datos en R. Incluye gráficos de barras, líneas, dispersión, anillos, mapas, árboles, burbujas, caja y probabilidad.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd23aa0104ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trade and employment]]></title>
            <link>https://medium.com/@nico_kinel/trade-and-employment-516e56d769eb?source=rss-398c4b8ea14c------2</link>
            <guid isPermaLink="false">https://medium.com/p/516e56d769eb</guid>
            <category><![CDATA[employment]]></category>
            <category><![CDATA[2008-financial-crisis]]></category>
            <category><![CDATA[economics]]></category>
            <category><![CDATA[trade]]></category>
            <category><![CDATA[jobs]]></category>
            <dc:creator><![CDATA[Michal Kinel]]></dc:creator>
            <pubDate>Sat, 25 Dec 2021 14:36:49 GMT</pubDate>
            <atom:updated>2021-12-25T14:36:49.948Z</atom:updated>
            <content:encoded><![CDATA[<h4>Trade as the grantee of stable employment and good wages</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*deGmtnHABqGBhBjC" /><figcaption>Photo by <a href="https://unsplash.com/@kydroon?utm_source=medium&amp;utm_medium=referral">Kurt Cotoaga</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Since early 90s there was developed many studies about job and worker flows, with special contribution of Davis and Haltiwanger who normalized the measurement procedure.</p><p>In first place, there are some common results that dominate all the studies in different sectors and countries. Job flows shows the heterogeneity of the companies and elevate bidirectional job flows. The empirical evidence shows that the job flows have an inverse relationship with firm size, wage level, the external activity.</p><p>I analyzed the Spanish manufacturing sector during the period 2000–2015. The data was obtained from <strong>Iberian Analysis Balance System </strong>(SABI) of more than 130 thousand firms. The compiled database contains financial and economic information. All the characteristics were confirmed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*RD4tr6MrNOHyfM6uOgWk4w.jpeg" /><figcaption>Source: own elaboration based on SABI database</figcaption></figure><p>The graph shows that non-trading firms suffered a greater impact on employment from the 2008 financial crisis.<strong> </strong>Non-trading firms destroyed more than twice as many jobs as importing and exporting firms.</p><p>Bernard et all (2007) point out that the external activity of companies entails significant differences in the hiring of employment and salary. The companies that trade usually has higher wages and concentrate more employment. In addition, we can verify that companies that do not trade destroy much more employment than those with more complex trade relations.</p><p>In consequence, companies that trade present more stable employment than those that do not trade, which adds one more benefit to the trading companies pointed out by Bernard. As we know, trade is not a zero-sum game. Then, with the trade benefits responsible for improving the quality and quantity of consumption, higher wages and stable employment of the trading firms and better exchange of technologies, it is alarming that the popularity of protectionist policies grows.</p><p>Some references:</p><ol><li>BERNARD, Andrew B., et al. Firms in international trade. The Journal of Economic Perspectives, 2007, vol. 21, no 3, p. 105–130.</li><li>DAVIS, S. J., HALTIWANGER, J. (1990). Gross job creation and destruction: Microeconomic evidence and macroeconomic implications. NBER macroeconomics annual, 5, 123–168.</li><li>DAVIS, S. J., HALTIWANGER, J. (1992). Gross job creation, gross job destruction, and employment reallocation. The Quarterly Journal of Economics, 107(3), 819–863.</li><li>DAVIS, S. J., HALTIWANGER, J. (1998). Measuring gross worker and job flows. In Labor Statistics Measurement Issues (pp. 77–122). University of Chicago Press.</li><li>DAVIS, S. J., HALTIWANGER, J. (1999). Gross job flows. Handbook of labor economics, 3, 2711–2805.</li><li>HALTIWANGER, J., SCARPETTA, S., SCHWEIGER, H. (2006). Assessing Job Flows Across Countries: The Role of Industry, Size and Regulations. Policy Research Working Paper, (4070).</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=516e56d769eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>