Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor updates and add post #4

Merged
merged 40 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
646706c
hide code for large chunks
danielroelfs Nov 6, 2023
d224040
update post
danielroelfs Nov 7, 2023
48cc39f
Merge branch 'main' into dev
danielroelfs Nov 7, 2023
89a4017
fix linting
danielroelfs Nov 7, 2023
cb1efd8
fix lint
danielroelfs Nov 7, 2023
cc9d19b
remove old theme
danielroelfs Nov 8, 2023
6e84a74
update lintr settings
danielroelfs Nov 11, 2023
d2f1f88
turn off umami for dev
danielroelfs Nov 11, 2023
a66a086
update settings
danielroelfs Nov 11, 2023
35d902c
add exceptions
danielroelfs Nov 11, 2023
5f1a3ba
update list style
danielroelfs Nov 22, 2023
e5d1b42
update post
danielroelfs Nov 22, 2023
5f3b545
update config
danielroelfs Nov 22, 2023
14bdc51
Merge branch 'main' into dev
danielroelfs Nov 26, 2023
0115f38
comment out lines
danielroelfs Nov 27, 2023
337b2f9
update theme from remote
danielroelfs Nov 27, 2023
fbbdba5
add slash
danielroelfs Nov 27, 2023
6cc3d2c
drop execution options
danielroelfs Dec 13, 2023
95fd793
drop execution options pt2
danielroelfs Dec 13, 2023
4507438
add bluesky
danielroelfs Jan 22, 2024
643dfba
update umami id in dev
danielroelfs Jan 22, 2024
df7af6f
update bluesky icon
danielroelfs Jan 22, 2024
500687e
add nmh pub
danielroelfs Jan 23, 2024
a48eb65
fix merge errors
danielroelfs Feb 19, 2024
4af14db
change umami link
danielroelfs Feb 26, 2024
22d3513
update theme
danielroelfs Feb 29, 2024
5dba7af
update to latest theme
danielroelfs Feb 29, 2024
d251368
add notbyai badge
danielroelfs Mar 1, 2024
7d44f2d
update theme
danielroelfs Mar 2, 2024
ddf3579
update theme
danielroelfs Mar 2, 2024
a854dc0
update theme again
danielroelfs Mar 2, 2024
99c0722
update pubs list
danielroelfs Apr 1, 2024
209e3c9
update cv layout
danielroelfs Apr 2, 2024
2611b20
add gap
danielroelfs Apr 2, 2024
3d93efe
fix spacing
danielroelfs Apr 2, 2024
eeb8ff7
add whitespace at bottom
danielroelfs Apr 2, 2024
6dd24e5
update cv style and content
danielroelfs Apr 3, 2024
19d8c8f
update style
danielroelfs Apr 5, 2024
16535ae
change color
danielroelfs Apr 5, 2024
6013c22
upload new blogpost
danielroelfs Apr 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading