File:SeattleHomelessnessAreaChart.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 512 × 512 pixels, file size: 25 KB)

Captions

Captions

The number of sheltered and unsheltered homeless people in Seattle from 2006 to 2020.

Summary[edit]

Description
English: An area chart visualizing the number of unsheltered (sleeping outside, in doorways, tents, cars, etc.) and sheltered (sleeping in emergency or transitional shelters) homeless people counted on one night during the last ten days of December in Seattle/King County from 2006 to 2020. See the Seattle Homelessness page for data citations. I created the graph in R using the code below:
library(tidyverse)
library(svglite)

dat = tribble(
~Year,~Total,~Unsheltered,~KCPop,
2006,7910,1946,1832.259,
2007,7839,2159,1857.877,
2008,8439,2631,1885.368,
2009,8916,2827,1922.645,
2010,8981,2759,1938.351,
2011,8922,2442,1974.2,
2012,8875,2594,2011.197,
2013,9106,2736,2047.223,
2014,9294,3123,2085.225,
2015,10091,3772,2126.178,
2016,10730,4505,2166.35,
2017,11643,5485,2203.836,
2018,12112,6320,2228.364,
2019,11199,5228,2252.782,
2020,11751,5578,2277.2
)

# Convert King County population in thousands to actual population
dat[,"KCPop"] = dat[,"KCPop"]*1000
# Compute Sheltered homeless population from Total minus Unsheltered
dat = dat %>% mutate(Year, Sheltered = Total - Unsheltered) %>%
       select(Year,Total,Sheltered,Unsheltered,KCPop)
dat = dat %>% mutate(Year, ShelteredPopPer = Sheltered/KCPop*100) %>%
       select(Year:KCPop,ShelteredPopPer)
dat = dat %>% mutate(Year, UnshelteredPopPer = Unsheltered/KCPop*100) %>%
       select(Year:ShelteredPopPer,UnshelteredPopPer)

ndat = dat %>% select(Year,Sheltered,Unsheltered)
ndat = ndat %>% pivot_longer(!Year, names_to="Homeless", values_to="Count")
plot = ggplot(ndat, aes(x=Year, y=Count, fill=Homeless)) + geom_area()
plot = plot + scale_x_continuous(limits=c(2006,2020),breaks=seq(2006,2020,2))
plot = plot + scale_y_continuous(limits=c(0,12500),breaks=seq(0,12000,1000))
plot = plot + theme(
  legend.position = c(.1, .9),
  legend.justification = c("left", "top"),
  legend.box.just = "left",
  legend.margin = margin(6, 6, 6, 6)
)
ggsave(plot, file="SeattleHomelessnessAreaChart.svg")
Date
Source Own work
Author Scott Tennican

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current22:08, 26 February 2021Thumbnail for version as of 22:08, 26 February 2021512 × 512 (25 KB)Lextrounce (talk | contribs)remove margins and put legend in chart
19:56, 26 February 2021Thumbnail for version as of 19:56, 26 February 2021512 × 512 (20 KB)Lextrounce (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Metadata