Download the source code for the template here: 

[`reflection-template.qmd`](https://raw.githubusercontent.com/atheobold/stat-541-website/refs/heads/main/portfolio/reflection-template.qmd "download")

```{r}
#| include: false
#| label: packages-portfolio-objectives

library(tidyverse)

portfolio_levels <- tibble(
  Objective = character(), 
  Level = numeric() 
  )

num_to_cat_levels <- function(x){
  case_when(x == 1 ~ "Novice", 
            x == 2 ~ "Proficient",
            x == 3 ~ "Virtuoso")
}
```

# Independent Learning (IL):

*These objectives show your ability to seek out new information and adapt to new tools to solve data analysis problems.*

## [IL-1] Adding new skills:

-   I can find and adopt new packages to accomplish tasks.
-   I can adapt to different syntax styles (tidy, base, formula style, data.table).

```{r}
#| include: false
#| label: IL-1

## Fill in the line below with your self-assigned level for this objective.
## Remember, you have the following levels to choose from:

# 1 = Novice
# 2 = Proficient
# 3 = Virtuoso

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "IL-1",
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## [IL-2] Online resources:

-   I can use online resources (e.g., Google, ChatGPT, StackOverflow, YouTube)
to solve problems, debug, or find new tools.
-   I can use tutorials, etc. to enhance my understanding of new concepts.
-   I can find source code for similar projects to use as starting points for my own.

```{r}
#| include: false
#| label: IL-2

## Fill in the line below with your self-assigned level for this objective.
my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "IL-2", 
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## IL Summary 

```{r}
#| echo: false
#| label: IL-summary-graph

portfolio_levels %>%
  filter(
    str_extract(Objective, "[A-Z]{2,4}") == "IL"
    ) %>% 
  mutate(
    Level = num_to_cat_levels(Level)
  ) %>%
  ggplot(mapping = aes(x = Level,
                       y = after_stat(count / sum(count))
                       )
         ) +
  geom_bar() +
  labs(x = "Level of Achievement",
       y = "", 
       title = "Achievement of CDAI Objectives") +
  theme_bw() +
  scale_y_continuous(labels = scales::label_percent())
```


# Reproducible Workflow (RW):

*These objectives show your ability to produce artifacts and deliverables that are organized, documented, version tracked, and responsibly designed.*

## [RW-1] File, code, and data management:

-   I can use Git and GitHub to track my progress (creating repos, cloning,
forking, pull requesting).
-   I always use R Projects and the {here} package to organize my scripts,
notebooks, data, and applications.
-   I always use pull requests when collaborating with others.

```{r}
#| include: false
#| label: RW-1

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "RW-1",
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## [RW-2] Notebooks:

-   I can use Quarto to produce a reproducible notebook and polished rendered
documents
-   I can use appropriate chunk options (echo, error, cache, etc.) to render my
Quarto document quickly and cleanly.

```{r}
#| include: false
#| label: RW-2

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "RW-2",
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## [RW-3] Code style

-   My code is clear, readable, well-organized, and well-commented.

```{r}
#| include: false
#| label: RW-3

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "RW-3",
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## RW Summary 

```{r}
#| echo: false
#| label: RW-summary-graph

portfolio_levels %>%
  filter(
    str_extract(Objective, "[A-Z]{2,4}") == "RW"
    ) %>% 
  mutate(
    Level = num_to_cat_levels(Level)
  ) %>%
  ggplot(mapping = aes(x = Level,
                       y = after_stat(count / sum(count))
                       )
         ) +
  geom_bar() +
  labs(x = "Level of Achievement",
       y = "", 
       title = "Achievement of RW Objectives") +
  theme_bw() +
  scale_y_continuous(labels = scales::label_percent())
```


# Technical Communication (TC):

*These objectives show your ability to communicate the processes you have implemented in your code, as well as the data conclusions and results.*

## [TC-1] Project summaries:

-   I can create clear and succinct summaries of a project.
-   I accurately interpret statistical or modeling results.
-   I consider the appropriate scope and impact of my project results.

```{r}
#| include: false
#| label: TC-1

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "TC-1", 
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## [TC-2] Documentation:

-   I can create a user-friendly dashboard.
-   I provide ample documentation for my custom functions.

```{r}
#| include: false
#| label: TC-2

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "TC-2", 
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## TC Summary 

```{r}
#| echo: false
#| label: TC-summary-graph

portfolio_levels %>%
  filter(
    str_extract(Objective, "[A-Z]{2,4}") == "TC"
    ) %>% 
  mutate(
    Level = num_to_cat_levels(Level)
  ) %>%
  ggplot(mapping = aes(x = Level,
                       y = after_stat(count / sum(count))
                       )
         ) +
  geom_bar() +
  labs(x = "Level of Achievement",
       y = "", 
       title = "Achievement of TC Objectives") +
  theme_bw() +
  scale_y_continuous(labels = scales::label_percent())
```

# Data Manipulation (DM):

*These objectives relate to the collection, cleaning, processing, and preparing of datasets for analysis.*

## [DM-1] Data Preparation

-   I can read in datasets to R, including untidy ones.
-   I can clean datasets to deal with missing data, typos, poor formatting, etc.

```{r}
#| include: false
#| label: DM-1

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "DM-1", 
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## [DM-2] Data Wrangling

-   I can cleverly use pivoting, separating, grouping, and joining to wrangle
data.
-   I can use mapping (`purrr`) to perform repeated tasks.

```{r}
#| include: false
#| label: DM-2

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "DM-2",
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## [DM-3] Data Formats

-   I can use API urls to access JSON data and convert it into a data frame
-   I can scrape data from the web and convert it into a data frame

```{r}
## Fill in the line below with your self-assigned level for this objective.
my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(tibble(Objective = "DM-3", 
                   Level = my_level))
```

### Level: `r my_level`

### Justification
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## DM Summary 

```{r}
#| echo: false
#| label: DM-summary-graph

portfolio_levels %>%
  filter(
    str_extract(Objective, "[A-Z]{2,4}") == "DM"
    ) %>% 
  mutate(
    Level = num_to_cat_levels(Level)
  ) %>%
  ggplot(mapping = aes(x = Level,
                       y = after_stat(count / sum(count))
                       )
         ) +
  geom_bar() +
  labs(x = "Level of Achievement",
       y = "", 
       title = "Achievement of DM Objectives") +
  theme_bw() +
  scale_y_continuous(labels = scales::label_percent())
```


# Professional Visualization (PV):

## [PV-1] Clear & Accessible Visualizations

-   I can make my plots more clear by removing the legend and adding
annotations.
-   I can edit the titles, subtitles, captions, axis labels, etc. to create a
clearly labelled plot.
-   I can choose colors ("scales") and themes to make a visually pleasing and
accessible plot.

```{r}
#| include: false
#| label: PV-1

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "PV-1", 
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## [PV-2] Dynamic Visualizations

-   I can use a package like {gganimate} to create self-contained gifs.
-   I can use a package like {plotly}, {ggplotly}, {leaflet}, {ggirafe}, etc. to
make interactive html widgets.

```{r}
#| include: false
#| label: PV-2

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "PV-2", 
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## [PV-3] Interactive Visualizations

-   I can use Shiny or webR to create visualizations that react to a user's
input.

```{r}
#| include: false
#| label: PV-3

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "PV-3", 
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## PV Summary 

```{r}
#| echo: false
#| label: PV-summary-graph

portfolio_levels %>%
  filter(
    str_extract(Objective, "[A-Z]{2,4}") == "PV"
    ) %>% 
  mutate(
    Level = num_to_cat_levels(Level)
  ) %>%
  ggplot(mapping = aes(x = Level,
                       y = after_stat(count / sum(count))
                       )
         ) +
  geom_bar() +
  labs(x = "Level of Achievement",
       y = "", 
       title = "Achievement of PV Objectives") +
  theme_bw() +
  scale_y_continuous(labels = scales::label_percent())
```


# Code Design, Algorithms, Iteration (CDAI):

*These objectives ask you to design code-based approaches to statistical computing problems, usually involving iteration to a stopping condition.*

## [CDAI-1] R Programming Language

-   I understand non-standard evaluation (aka "tidy eval" or "unquoted 
objects"), and I can use tunneling in my functions.
-   I understand functional programming, and I can use functions as objects in
my code design.

```{r}
#| include: false
#| label: CDAI-1

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "CDAI-1", 
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## [CDAI-2] Object Handling
  
-   I have built in checks for possible input problems
-   I can make reasonable choices in my code design about when to save intermediate objects.
-   I can convert objects between types and structures as needed.

```{r}
#| include: false
#| label: CDAI-2

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "CDAI-2", 
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## [CDAI-3] Speed and Efficiency
  
-   I can recognize moments of possible slowdown in my code, and use built-in
functions or parallelizing to speed them up.
-   I always use and design vectorized functions whenever possible.

```{r}
#| include: false
#| label: CDAI-3

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "CDAI-3", 
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## [CDAI-4] Supporting Functions
  
-   I write helper / shortcut functions to streamline repeated tasks and make my
code easier to read.
-   I use intermediate functions to streamline repeated or looping processes.

```{r}
#| include: false
#| label: CDAI-4

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "CDAI-4", 
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## [CDAI-5] Algorithmic Process
  
-   I can invent and implement my own iterative algorithm.
-   My loops are clean and efficient.
-   I have built in checks for possible problems or extreme cases in the
algorithm.

```{r}
#| include: false
#| label: CDAI-5

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "CDAI-5", 
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->


## [CDAI-6] Generative Art
  
-   I can apply a variety of generative art functions to make a visually
pleasing piece.
-   I can explain why particular changes to the code result in particular
differences in the visualization.

```{r}
#| include: false
#| label: CDAI-6

my_level <- 1

portfolio_levels <- portfolio_levels %>%
  bind_rows(
    tibble(Objective = "CDAI-6", 
           Level = my_level)
    )
```

### Level: `r my_level`

### Justification:
<!-- Insert references to the work shown in the blog(s) on your personal website -->

## CDAI Summary 

```{r}
#| echo: false
#| label: CDAI-summary-graph

portfolio_levels %>%
  filter(
    str_extract(Objective, "[A-Z]{2,4}") == "CDAI"
    ) %>% 
  mutate(
    Level = num_to_cat_levels(Level)
  ) %>%
  ggplot(mapping = aes(x = Level,
                       y = after_stat(count / sum(count))
                       )
         ) +
  geom_bar() +
  labs(x = "Level of Achievement",
       y = "", 
       title = "Achievement of CDAI Objectives") +
  theme_bw() +
  scale_y_continuous(labels = scales::label_percent())
```


# Overall Summary

```{r}
#| echo: false
#| label: overall-summary-graph

portfolio_levels %>%
  mutate(
    Category = str_extract(Objective, "[A-Z]{2,4}"),
    Level = num_to_cat_levels(Level)
  ) %>%
  ggplot(mapping = aes(x = Level,
                       y = after_stat(count / sum(count))
                       )
         ) +
  geom_bar() +
  labs(x = "Level of Achievement",
       y = "") +
  theme_bw() +
  scale_y_continuous(labels = scales::label_percent())
```

## Grade

Based on the summary plot above, I believe I have earned a ____ in STAT 541.

### Justification
