Claude helps to create an R package
Based on https://arxiv.org/pdf/2210.00310 I asked Claude, https://claude.ai, package. The result is accessible in https://github.com/baselDataScience/prwkdc.
Sep 4, 2024
BaselDataScience’s purpose is to organize data science events in Basel. Historically mainly focussed on R, we are open for other languages as the landscape is evolving.
Contact and contributions via linkedIn!
Next meeting | |
---|---|
When | |
Where | Unternehmen Mitte, Gerbergasse 30, 4001 Basel |
Topics |
banner picture (c) CC-BY-4.0 based on https://commons.wikimedia.org/wiki/File:Basel-Muenster-04-gje.jpg↩︎
---
title: Basel Data Science
listing:
contents: posts
sort: "date desc"
type: grid
grid-columns: 3
image-height: 200px
page-size: 10
categories: true
page-layout: full
title-block-banner: true
image: baseldatasciencelogo.jpeg
format:
html:
toc: true
toc-location: left
code-fold: true
code-tools: true
code-summary: "Show the code"
df-print: paged
font-family: ["Ubuntu", sans-serif]
mainfont: "Ubuntu"
title-block-banner: baseldatasciencelogo.jpeg
editor:
markdown:
wrap: sentence
---
[^1]
[^1]: banner picture (c) CC-BY-4.0 based on <https://commons.wikimedia.org/wiki/File:Basel-Muenster-04-gje.jpg>
# About Basel Data Science
**BaselDataScience**'s purpose is to organize **data science events in Basel**.
Historically mainly focussed on R, we are open for other languages as the landscape is evolving.
Contact and contributions via [linkedIn](https://www.linkedin.com/groups/12870553/)!
# [Events](events.qmd)
| Next meeting | |
|------------------------------------|------------------------------------|
| When | |
| Where | Unternehmen Mitte, Gerbergasse 30, 4001 Basel |
| Topics | |
### contributions from events
```{r write-redirects}
#| echo: false
# list names of post folders
posts <- list.dirs(
path = "posts",
full.names = FALSE,
recursive = FALSE
)
# extract the slugs
slugs <- gsub("^.*_", "", posts)
# lines to insert to a netlify _redirect file
post_redirects <- paste0("/", slugs, " ", "/posts/", posts)
# function to extract post categories from index.qmd files
get_post_categories <- function(post) {
file <- here::here("posts", post) |> fs::path("index.qmd")
if(!fs::file_exists(file)) {
return(character(0))
}
file |>
readLines() |>
stringr::str_subset("^categories:") |>
stringr::str_extract("\\[.*\\]") |>
stringr::str_remove_all("[\\[\\]]") |>
stringr::str_split(", ") |>
unlist()
}
# extract the categories
categories <- purrr::map(posts, get_post_categories) |>
unlist() |>
unique()
# extract categories in nice form
keys <- categories |>
stringr::str_to_lower() |>
stringr::str_replace_all(" ", "-")
# extract categories in ugly form
values <- categories |>
stringr::str_replace_all(" ", "%20")
# category redirects
category_redirects <- paste0("/category/", keys, " ", "/#category=", values)
# write the _redirect file
writeLines(c(post_redirects, category_redirects), here::here("_site", "_redirects"))
```