Recently Published
Other Costs
Other_Costs
PSYCH 251: Final Project
Replication of Muenks et al's paper
Gasoline Prices in New York State – Weekly and Quarterly Trends
This code sets up a two-row plotting layout with par(mfrow = c(2,1)) and increases the bottom margin using mar = c(6,4,4,2) to make space for text. The first plot displays weekly gasoline prices in New York State as a red line, with a descriptive paragraph added below using mtext() to explain the dataset, the observed trends in 2025, the units in dollars per gallon, and the weekly variations across the state. The second plot shows quarterly average prices in green, again with a paragraph added below describing that the data is aggregated from weekly values, highlighting smoothed trends, units, and long-term price movements in New York State. The cex = 0.8 parameter reduces the text size so the paragraphs fit neatly under the plots.
таблиця Розподіл респондентів за групами посад (кількість осіб, %
library(dplyr)
library(flextable)
library(officer)
N <- 30 # загальна кількість респондентів
tbl_roles <- tibble::tibble(
`Група посад` = c(
"Адміністративні та допоміжні ролі",
"Медичні фахівці (невролог, психіатр)",
"Педагогічні працівники / освітні фахівці",
"Працівники органів соціального захисту / державних служб",
"Юристи / правові фахівці",
"Менеджери програм, координатори, керівники підрозділів",
"Психологи",
"Фахівці із соціальної роботи / соціальні працівники"
),
n = c(6, 2, 2, 5, 3, 10, 11, 21)
) %>%
mutate(`%` = round(n / N * 100, 1))
ft <- flextable(tbl_roles) %>%
set_caption("Таблиця 2.1. Розподіл респондентів за групами посад (кількість осіб, %)") %>%
align(j = 1, align = "left") %>%
align(j = c("n", "%"), align = "center") %>%
autofit()
ft
# Експорт у Word
doc <- read_docx() %>%
body_add_flextable(ft)
print(doc, target = "roles_table_with_percent.docx")