Skip to content

Commit

Permalink
Minor updates and add post (#4)
Browse files Browse the repository at this point in the history
* hide code for large chunks

* update post

* fix linting

* fix lint

* remove old theme

* update lintr settings

* turn off umami for dev

* update settings

* add exceptions

* update list style

* update post

* update config

* comment out lines

* update theme from remote

* add slash

* drop execution options

* drop execution options pt2

* add bluesky

* update umami id in dev

* update bluesky icon

* add nmh pub

* change umami link

* update theme

* update to latest theme

* add notbyai badge

* update theme

* update theme

* update theme again

* update pubs list

* update cv layout

* add gap

* fix spacing

* add whitespace at bottom

* update cv style and content

* update style

* change color

* upload new blogpost
  • Loading branch information
danielroelfs authored Apr 6, 2024
1 parent 139c831 commit c3c0d17
Show file tree
Hide file tree
Showing 109 changed files with 1,125 additions and 5,776 deletions.
3 changes: 2 additions & 1 deletion .lintr
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
linters: linters_with_defaults(
line_length_linter(120),
line_length_linter(120),
indentation_linter(indent = 2L),
commented_code_linter = NULL
)
exclusions: list(
Expand Down
51 changes: 50 additions & 1 deletion assets/custom_style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,55 @@
@media all and (min-width: 1200px) {
img:not(.icon) {
img:not(.icon, .notbyai-img) {
margin-left: -6rem;
min-width: 120%;
}
}

ul li:before {
content: "→";
}

.notbyai-wrapper {
text-align: right;
}

img.notbyai {
width: 120px;
min-width: 120px;
}

a.notbyai:hover {
background: none;
}

.cv-date {
font-family: 'Cooper Hewitt', sans-serif;
font-weight: 711;
font-size: 80%;
position: absolute;
right: 4em;
margin-top: -1.5em;
}

.progress {
font-family: 'Cooper Hewitt', sans-serif;
font-weight: 711;
width: 75%;
height: 1rem;
padding: 1px;
margin: 0.15rem 0;
background: rgba(0, 0, 0, 0.1);
}

.progress-bar {
font-size: 80%;
color: white;
height: 0.9rem;
box-shadow: 0 0 0 0 none, inset 0 1px rgba(255, 255, 255, 0.1);
}

.progress > .progress-bar {
padding-left: 5px;
font-variant-caps: all-small-caps;
background-color: #555;
}
6 changes: 3 additions & 3 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ theme = "typography"

ignoreFiles = ["\\.qmd$", "\\.ipynb$", "\\.Rmd$", "\\.Rmarkdown$",
"_cache$", "index\\.html", "about\\.html", "static/blog/\\*_files/", "README.md",
".venv"]
".venv/"]

[markup]
defaultMarkdownHandler = "goldmark"
Expand All @@ -27,8 +27,8 @@ ignoreFiles = ["\\.qmd$", "\\.ipynb$", "\\.Rmd$", "\\.Rmarkdown$",

customcss = ["custom_style.css"]

umami = true
umamilink = "https://analytics-danielroelfs.netlify.app/script.js"
umami = false
umamilink = "https://web-analytics.danielroelfs.app/script.js"
umamiid = "10185115-89df-427f-9aea-8c3575857825"

# Social links
Expand Down
2 changes: 2 additions & 0 deletions content/about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ Hi, I'm Daniel Roelfs! I'm currently working as a Data Scientist at the Norwegia
Born and raised in the Netherlands, I have also studied in France and Sweden before moving to Norway. In my free time I run, ski, hike, and take photos. This blog serves as a way to share some of the code I write in R and Python for personal and professional interests.

If you have any questions or comments about the tutorials and posts here, or just want to get in touch, please send me an e-mail at [daniel.roelfs\[a\]medisin.uio.no](mailto:[email protected]).

{{< notbyai >}}
2 changes: 2 additions & 0 deletions content/about/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ Hi, I'm Daniel Roelfs! I'm currently working as a Data Scientist at the Norwegia
Born and raised in the Netherlands, I have also studied in France and Sweden before moving to Norway. In my free time I run, ski, hike, and take photos. This blog serves as a way to share some of the code I write in R and Python for personal and professional interests.

If you have any questions or comments about the tutorials and posts here, or just want to get in touch, please send me an e-mail at [daniel.roelfs[a]medisin.uio.no](mailto:[email protected]).

{{{< notbyai >}}}
57 changes: 55 additions & 2 deletions content/blog/2019-analyzing-bach/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,15 @@ merged_data <- data |>
)
```

{{< sidenote br="7em" >}}
Click on "Show code" to show the code. I hid it by default because it's quite a long chunk
{{< /sidenote >}}

I noticed that some entries in the `year` column exceeded the year of Bach's death. Bach died in 1750. I assumed that these years indicated the year of first performance or publication. In this scenario, it would be possible that certain pieces were lost and rediscovered at a later date and only then published. I thought to make a barplot of the number of compositions Bach over the course of his life, trying to see if there was any period where he was particularly productive. I also added some annotations to give the plot some context.

<details>
<summary>Show code</summary>

``` r
bwvperyear <- merged_data |>
filter(!is.na(year)) |>
Expand Down Expand Up @@ -390,6 +397,8 @@ ggplot(bwvperyear, aes(x = year, y = n, fill = n)) +
)
```

</details>

<img src="index.markdown_strict_files/figure-markdown_strict/bwvperyear-plot-1.png" width="1152" />

It seems there were two particularly productive years. But since the year column likely indicates year of publication, it's perhaps more likely that Bach published a collection of pieces in a batch. This is certainly true for the year 1736, when the *Schemellis Gesangbuch* came out, a song book with sacred music, written together with a student of the school he was cantor at: the *Thomasschule* in Leipzich. I'll come back to this plot later.
Expand Down Expand Up @@ -498,9 +507,53 @@ places <- data_frame(

Since this time I wanted to visualize whether Bach was more productive in certain places, I recreated the plot from earlier, shaded the background with the city Bach inhabited at the time, and transformed the bars into a density plot, which smoothed over the data and removed the high outliers.

`geom_smooth()` using formula = 'y ~ x'
<details>
<summary>Show code</summary>

``` r
places_plot <- places |>
mutate(meanyear = year_from + ((year_to - year_from) / 2))

ggplot(places_plot) +
geom_rect(
aes(
xmin = year_from + 0.5, xmax = year_to + 0.5,
ymin = 0, ymax = 60,
fill = reorder(city, year_from)
),
alpha = 0.75
) +
stat_smooth(
data = bwvperyear |> filter(year < 1751),
mapping = aes(x = year + 0.5, y = n, group = 1),
fill = "black", geom = "area",
method = "loess", span = 0.225, alpha = 0.75
) +
geom_text(aes(x = meanyear, label = city, y = 62.5),
family = "Alegreya", angle = 60, hjust = 0
) +
labs(
x = NULL,
y = "Number of compositions",
fill = "City"
) +
scale_fill_daniel(palette = "staalmeesters") +
scale_x_continuous(breaks = seq(1690, 1750, 10), expand = c(0, 0)) +
scale_y_continuous(
limits = c(0, 85),
breaks = seq(0, 60, 20),
expand = c(0, 0)
) +
theme_bach(
base_family = "Alegreya", grid = FALSE,
ticks = FALSE, axis_title_just = "c"
) +
theme(
legend.position = "none"
)
```

Warning: Removed 1 rows containing non-finite values (`stat_smooth()`).
</details>

<img src="index.markdown_strict_files/figure-markdown_strict/plot-with-city-1.png" width="1152" />

Expand Down
19 changes: 11 additions & 8 deletions content/blog/2019-analyzing-bach/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ categories:
tags:
- ggplot
- R
execute:
fig.retina: 2
fig.align: center
fig.show: hold
results: hold
out.width: 80%
editor_options:
chunk_output_type: console
---
Expand Down Expand Up @@ -334,13 +328,19 @@ merged_data <- data |>
)
```

{{{< sidenote br="7em" >}}}
Click on "Show code" to show the code. I hid it by default because it's quite a long chunk
{{{< /sidenote >}}}

I noticed that some entries in the `year` column exceeded the year of Bach's death. Bach died in 1750. I assumed that these years indicated the year of first performance or publication. In this scenario, it would be possible that certain pieces were lost and rediscovered at a later date and only then published. I thought to make a barplot of the number of compositions Bach over the course of his life, trying to see if there was any period where he was particularly productive. I also added some annotations to give the plot some context.

```{r}
#| label: bwvperyear-plot
#| warning: false
#| message: false
#| warning: false
#| fig-width: 12
#| code-fold: true
#| code-summary: "Show code"
bwvperyear <- merged_data |>
filter(!is.na(year)) |>
Expand Down Expand Up @@ -553,8 +553,11 @@ Since this time I wanted to visualize whether Bach was more productive in certai

```{r}
#| label: plot-with-city
#| echo: false
#| fig-width: 12
#| message: false
#| warning: false
#| code-fold: true
#| code-summary: "Show code"
places_plot <- places |>
mutate(meanyear = year_from + ((year_to - year_from) / 2))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ categories:
tags:
- ggplot
- R
execute:
fig.retina: 2
fig.align: center
fig.show: hold
results: hold
out.width: 80%
editor_options:
chunk_output_type: console
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ categories:
tags:
- ggplot
- R
execute:
fig.retina: 2
fig.align: center
fig.show: hold
results: hold
out.width: 80%
editor_options:
chunk_output_type: console
---
Expand Down
6 changes: 0 additions & 6 deletions content/blog/2019-how-i-plot-erps-in-r/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ tags:
- R
- ggplot
- ERP
execute:
fig.retina: 2
fig.align: center
fig.show: hold
results: hold
out.width: 80%
editor_options:
chunk_output_type: console
---
Expand Down
6 changes: 0 additions & 6 deletions content/blog/2019-how-i-plot-erps-in-r/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ tags:
- R
- ggplot
- ERP
execute:
fig.retina: 2
fig.align: center
fig.show: hold
results: hold
out.width: 80%
editor_options:
chunk_output_type: console
---
Expand Down
6 changes: 0 additions & 6 deletions content/blog/2020-how-i-make-qq-plots-using-ggplot/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ categories:
tags:
- ggplot
- R
execute:
fig.retina: 2
fig.align: center
fig.show: hold
results: hold
out.width: 80%
editor_options:
chunk_output_type: console
---
Expand Down
6 changes: 0 additions & 6 deletions content/blog/2020-how-i-make-qq-plots-using-ggplot/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ categories:
tags:
- ggplot
- R
execute:
fig.retina: 2
fig.align: center
fig.show: hold
results: hold
out.width: 80%
editor_options:
chunk_output_type: console
---
Expand Down
6 changes: 0 additions & 6 deletions content/blog/2020-plotting-star-destroyers-in-r/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ categories:
tags:
- ggplot
- R
execute:
fig.retina: 2
fig.align: center
fig.show: hold
results: hold
out.width: 80%
editor_options:
chunk_output_type: console
---
Expand Down
6 changes: 0 additions & 6 deletions content/blog/2020-plotting-star-destroyers-in-r/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ categories:
tags:
- ggplot
- R
execute:
fig.retina: 2
fig.align: center
fig.show: hold
results: hold
out.width: 80%
editor_options:
chunk_output_type: console
---
Expand Down
6 changes: 0 additions & 6 deletions content/blog/2020-running-an-ica-on-questionnaires/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ tags:
- statistics
- R
- ICA
execute:
fig.retina: 2
fig.align: center
fig.show: hold
results: hold
out.width: 80%
editor_options:
chunk_output_type: console
---
Expand Down
6 changes: 0 additions & 6 deletions content/blog/2020-running-an-ica-on-questionnaires/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ tags:
- statistics
- R
- ICA
execute:
fig.retina: 2
fig.align: center
fig.show: hold
results: hold
out.width: 80%
editor_options:
chunk_output_type: console
---
Expand Down
4 changes: 0 additions & 4 deletions content/blog/2021-amsterdam-housing-market/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ tags:
- ggplot
- society
execute:
fig.retina: 2
fig.align: left
fig.show: hold
results: hold
dev.args: list(bg = "#EBEBEB")
editor_options:
chunk_output_type: console
Expand Down
6 changes: 0 additions & 6 deletions content/blog/2021-comparison-fa-pca-ica/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ categories:
tags:
- statistics
- R
execute:
fig.retina: 2
fig.align: center
fig.show: hold
results: hold
out.width: 80%
editor_options:
chunk_output_type: console
---
Expand Down
6 changes: 0 additions & 6 deletions content/blog/2021-comparison-fa-pca-ica/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ categories:
tags:
- statistics
- R
execute:
fig.retina: 2
fig.align: center
fig.show: hold
results: hold
out.width: 80%
editor_options:
chunk_output_type: console
---
Expand Down
Loading

0 comments on commit c3c0d17

Please sign in to comment.