Przejdź do zawartości

Plik:US2009FederalExpenditures.png

Treść strony nie jest dostępna w innych językach.
Ten plik jest umieszczony w Wikimedia Commons
Z Wikipedii, wolnej encyklopedii

Rozmiar pierwotny(2099 × 2096 pikseli, rozmiar pliku: 107 KB, typ MIME: image/png)

Opis

Opis
English: Dot plot of the total U.S. government budget in 2009, including both mandatory and discretionary. Taken from data at wikipedia:2009 United States federal budget.
Data
Źródło Praca własna
Autor Thopper
Inne wersje File:Fy2009spendingbycategory2.png

Creation Technique

General steps

  1. Compile data from list of budget items at wikipedia:2009 United States federal budget and save to a file (e.g. "2009expenditures.csv");
  2. Load data in R (programming language);
  3. Load the ggplot2 library;
  4. Assign the categorical variable (outlay) as a factor;
  5. Plot using the ggplot.

Compiling the data

  1. Compile the data into columns: one column for the budget expenditure (e.g. "Social Security," "Medicare," etc.) and the other for the amount ("644," "408," etc.).
  2. Name the columns "Expenditure" and "Billions" for the expenditure category and the amount (in billions of U.S. dollars), respectively.
  3. Save the data as comma-separated value file (csv).

R code to produce chart

# Load the ggplot2 library
library("ggplot2")

# Data saved using European separators ("." for thousands and "," for decimals), so use read.csv2().
# If data is saved using U.S. separators ("," for thousands and "." for decimals), use read.csv().
my.data <- read.csv2("2009expenditures.csv")

# Ensure that the categories are treated as factors
my.data <- data.frame(Billions = my.data$Billions, Expenditure = factor(my.data$Expenditure))

# Plot using ggplot2
ggplot(data = my.data, aes(Billions)) +
      geom_point(aes(y=reorder(Expenditure, Billions))) +
      xlab("Billions of U.S. Dollars") + ylab("")

Licencja

Ja, właściciel praw autorskich do tego dzieła, udostępniam je na poniższej licencji
w:pl:Licencje Creative Commons
uznanie autorstwa na tych samych warunkach
Wolno:
  • dzielić się – kopiować, rozpowszechniać, odtwarzać i wykonywać utwór
  • modyfikować – tworzyć utwory zależne
Na następujących warunkach:
  • uznanie autorstwa – musisz określić autorstwo utworu, podać link do licencji, a także wskazać czy utwór został zmieniony. Możesz to zrobić w każdy rozsądny sposób, o ile nie będzie to sugerować, że licencjodawca popiera Ciebie lub Twoje użycie utworu.
  • na tych samych warunkach – Jeśli zmienia się lub przekształca niniejszy utwór, lub tworzy inny na jego podstawie, można rozpowszechniać powstały w ten sposób nowy utwór tylko na podstawie tej samej lub podobnej licencji.

Podpisy

Dodaj jednolinijkowe objaśnienie tego, co ten plik pokazuje

Obiekty przedstawione na tym zdjęciu

przedstawia

Historia pliku

Kliknij na datę/czas, aby zobaczyć, jak plik wyglądał w tym czasie.

Data i czasMiniaturaWymiaryUżytkownikOpis
aktualny16:34, 17 wrz 2010Miniatura wersji z 16:34, 17 wrz 20102099 × 2096 (107 KB)Thopper{{Information |Description={{en|1=Dot plot of the total U.S. government budget in 2009, including both mandatory and discretionary. Taken from data at wikipedia:2009 United States federal budget.}} |Source={{own}} |Author=Thopper |Dat

Globalne wykorzystanie pliku

Ten plik jest wykorzystywany także w innych projektach wiki: