Skip to content

Commit

Permalink
Init 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
jhelvy committed Dec 31, 2023
1 parent cdd687a commit 58eef37
Show file tree
Hide file tree
Showing 113 changed files with 60,512 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Render and Deploy Quarto Site
on:
push:
branches: main
# schedule:
# Runs daily at midnight (EST)
# - cron: '0 5 * * *'

jobs:
build:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: quarto-dev/quarto-actions/setup@v2
- name: Query dependencies
run: |
options(download.file.method = "libcurl")
options(repos = "https://cran.rstudio.com")
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: macOS-r-3.6-${{ hashFiles('.github/depends.Rds') }}
restore-keys: macOS-r-3.6-

- name: Install system dependencies
run: |
brew install libgit2
- name: Install dependencies
run: |
install.packages("remotes")
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}

- name: Publish to GitHub Pages (and render)
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45 changes: 45 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Type: Website
Package: emsep4a
Title: EMSE 4571 - Intro to Programming for Analytics, Spring 2024
Version: 1.0
Maintainer: John Helveston <[email protected]>
Author: John Helveston <[email protected]>
Authors@R: c(
person("John", "Helveston", email = "[email protected]", role = c("aut", "cre")),
)
Depends: R (>= 3.4.0)
License: CC-BY-SA
Encoding: UTF-8
Imports:
countdown,
cowplot,
DAAG,
devtools,
dslabs,2
fastDummies,
fontawesome,
gapminder,
ggrepel,
ggthemes,
gsheet,
here,
hrbrthemes,
janitor,
kableExtra,
knitr,
logitr,
metathis,
nycflights13,
palmerpenguins,
remotes,
repurrrsive,
reticulate,
rmarkdown,
roxygen2,
tidyverse,
TurtleGraphics,
viridis,
viridisLite,
xaringanExtra,
wikifacts,
yaml
15 changes: 15 additions & 0 deletions EMSE-P4A-2024-Spring.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 4
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Website
24 changes: 24 additions & 0 deletions LICENSE.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: "Licensing and copyright information"
---

The course material is licensed under the
[Creative Commons ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). In addition to my own developed material, I have also modified material from
the courses, workshops, and textbooks listed below:

### Courses / workshops

Name | Author(s) | Links
--------- | --------- | ---
STAT 545 | U. of British Columbia | [course](http://stat545.com/); [GitHub](https://github.com/STAT545-UBC)
Patrick Meyer's Youtube lectures | Prof. Patrick Meyer | [playlists](https://www.youtube.com/channel/UCyTTRlOdjHg23q3l6_CD4gg/playlists)
Andrew Heiss's data viz courses | Andrew Heiss | [MPA 635](https://datavizf17.classes.andrewheiss.com/), [more here](https://www.andrewheiss.com/teaching/)
Intro. to Data Visualization, Fall 2018 | Peter Aldhous | [course site](https://paldhous.github.io/ucb/2018/dataviz/index.html)

### Books

Name | Author(s) | Links
--------- | --------- | ---
R for Data Science | Garrett Grolemund & Hadley Wickham | [online book](https://r4ds.had.co.nz/); [GitHub](https://github.com/hadley/r4ds); [purchase](https://www.amazon.com/Data-Science-Transform-Visualize-Model/dp/1491910399)
Data Visualization: A practical introduction | Kieran Healy | [online book](http://socviz.co/); [GitHub](https://github.com/kjhealy/dataviz); [purchase](https://www.amazon.com/Data-Visualization-Introduction-Kieran-Healy/dp/0691181624)
Fundamentals of Data Visualization | Claus O. Wilke | [online book](https://serialmentor.com/dataviz/); [purchase](https://www.amazon.com/Fundamentals-Data-Visualization-Informative-Compelling/dp/1492031089)
27 changes: 27 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
output:
github_document:
html_preview: false
---

<!-- README.md is generated from README.Rmd. Please edit that file -->

## EMSE 4571: Intro. to Programming for Analytics (Spring 2024) <a href='https://github.com/emse-p4a-gwu/2024-Spring'><img src='images/logo.png' align="right" height="139"/></a>

<!-- badges: start -->
[![License: CC-BY-SA 4.0](https://img.shields.io/badge/License-CC%20BY--SA-lightgrey)](https://creativecommons.org/licenses/by-sa/4.0/)
<!-- badges: end -->

### Description

```{r child = here::here("fragments", "description.qmd")}
```

For more details, please see the [course
website](https://p4a.seas.gwu.edu/2024-Spring/).

### Acknowledgments

This course was inspired by many other courses / resources that cover
similar material - see the course [about
page](https://p4a.seas.gwu.edu/2024-Spring/about.html) for more details.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

## EMSE 4571: Intro. to Programming for Analytics (Spring 2024) <a href='https://github.com/emse-p4a-gwu/2024-Spring'><img src='images/logo.png' align="right" height="139"/></a>

<!-- badges: start -->

[![License: CC-BY-SA
4.0](https://img.shields.io/badge/License-CC%20BY--SA-lightgrey)](https://creativecommons.org/licenses/by-sa/4.0/)
<!-- badges: end -->

### Description

This course provides a foundation in programming for analytics using the
[R programming language](https://www.r-project.org/) with a comparison
to [Python](https://www.python.org/). Topics covered include
fundamentals of programming (operators, data types, objects, functions,
conditionals, loops, strings, testing, and debugging) as well as
techniques for working with data sets in R and Python (file
input/output, data structures, data wrangling, data visualization,
external packages, and reproducible reporting). Emphasis will be on
producing clear, robust, and reasonably efficient code using top-down
design, informal analysis, and effective testing and debugging. Students
will primarily work on individual programming assignments to develop
skills in computational problem solving, writing code, and working with
data. Students will be assessed through quizzes, homework assignments,
and exams. Teaching will involve interactive lectures with plenty of
time spent live coding and working on practice problems in class. This
course assumes no prior programming experience and is an ideal
preparation for higher level courses in data analytics.

For more details, please see the [course
website](https://p4a.seas.gwu.edu/2024-Spring/).

### Acknowledgments

This course was inspired by many other courses / resources that cover
similar material - see the course [about
page](https://p4a.seas.gwu.edu/2024-Spring/about.html) for more details.
110 changes: 110 additions & 0 deletions _common.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
set.seed(5678)

options(
dplyr.width = Inf,
dplyr.print_min = 6,
dplyr.print_max = 6,
stringr.view_n = 10,
pillar.bold = TRUE,
width = 77 # 80 - 3 for #> comment
)

knitr::opts_chunk$set(
message = FALSE,
warning = FALSE,
comment = "#>",
fig.retina = 3,
fig.width = 6,
fig.height = 4,
fig.show = "hold",
fig.align = "center",
fig.path = "figs/"
)

get_schedule <- function() {

schedule_raw <- read_csv(here::here('schedule.csv'))

# Quiz vars
quiz <- schedule_raw %>%
mutate(
quiz = ifelse(
is.na(quiz),
"",
paste0('Quiz ', quiz, ":<br><em>", quiz_coverage, "</em>"))
) %>%
select(week, quiz)

# Weekly assignment vars
assignments <- schedule_raw %>%
mutate(
due_assign = format(due_assign, format = "%b %d"),
assignments = ifelse(
is.na(due_assign),
"",
paste0(
'<a href="hw/', n_assign, "-", stub_assign, '.html"><b>HW ',
n_assign, "</b></a><br>Due: ", due_assign))
) %>%
select(week, assignments)

# Class vars
class <- schedule_raw %>%
mutate(
description_class = ifelse(
is.na(description_class),
"",
description_class),
class = ifelse(
is.na(stub_class),
paste0("<b>", name_class, "</b><br>", description_class),
paste0(
'<a href="class/', n_class, "-", stub_class, '.html"><b>',
name_class, "</b></a><br> ",
description_class)),
) %>%
select(week, class)

# Reading vars
reading <- schedule_raw %>%
select(week, ends_with("_reading"), reading) %>%
rename(name = name_reading, stub = stub_reading) %>%
mutate(
name = str_split(name, '\n'),
stub = str_split(stub, '\n')
)

# Fix reading names
reading_root <- 'https://p4a.jhelvy.com/'
reading$readings <- ""
for (i in 1:nrow(reading)) {
name <- reading[i,]$name[[1]]
if (any(is.na(unlist(name)))) {
result <- ''
} else {
stub <- reading[i,]$stub[[1]]
result <- paste0(
'<a href=', reading_root, stub ,'.html target="_blank"><b>',
name, "</b></a>")
result <- paste(result, collapse = '<br>')

}
reading$readings[i] <- result
}
reading$name <- NULL
reading$stub <- NULL
reading <- reading %>%
mutate(readings = ifelse(!is.na(reading), reading, readings))

# Final schedule data frame
schedule <- schedule_raw %>%
select(week, date, n_assign, due_assign) %>%
mutate(date_md = format(date, format = "%b %d")) %>%
left_join(quiz, by = "week") %>%
left_join(class, by = "week") %>%
left_join(assignments, by = "week") %>%
left_join(reading, by = "week") %>%
ungroup()

return(schedule)
}
Loading

0 comments on commit 58eef37

Please sign in to comment.