Skip to content

Instantly share code, notes, and snippets.

View perdalum's full-sized avatar
🤠

Per Møldrup-Dalum perdalum

🤠
View GitHub Profile
using DataFrames
using DataFramesMeta
budget = DataFrame(
amount = [163040.00, 78750.00, 37500.00, 90000.00, 60000.00, 10125.00],
institution = ["DTUDeiC", "CBS", "AAU", "DKB", "SDU", "AU"],
pms = [10, 9, 4, 9, 6, 4]
)
@chain budget begin
@perdalum
perdalum / why-so-many-hits.Rmd
Created October 26, 2020 13:24
Why do we observe a high peak in the amount of hits in 2013 for 'kierkegaard'
---
title: "Why do we observe a high peak in the amount of hits in 2013 for 'kierkegaard'"
author: "Toke Eskildsen and Per Møldrup-Dalum"
output:
html_document:
df_print: paged
---
```{r libraries, message=FALSE, echo=FALSE, warning=FALSE}
library(tidyverse)
@perdalum
perdalum / danish-movie-premieres.R
Created June 3, 2020 13:45
Create a ICal/ICS calendar of upcoming Danish movie premieres based on fafid.dk
library(dplyr)
library(lubridate)
library(stringr)
library(readr)
library(rvest)
library(uuid)
create_ical_event_df <- function(title, day, uuid) {
sprintf(
"BEGIN:VEVENT
@perdalum
perdalum / danske-filmpremierer.Rmd
Created June 3, 2020 11:45
Danske filmpremierer
---
title: "Danske filmpremierer"
output: html_notebook
---
```{r, message=FALSE}
library(tidyverse)
library(stringr)
library(rvest)
```
endPage = 3;
d1To10 = Module[
{url =
"https://beta.folketingstidende.dk/Components/Domain/Ebook/Presentation/DownloadEBookPage.ashx?id=19531F&s1=" <> ToString@# <>
"&s2=" <> ToString[# + 1]},
{url, Import[url, "Plaintext"]}] & /@ Range[1, endPage, 2] >>
"d1-" <> ToString@endPage
@perdalum
perdalum / read_many.R
Created October 23, 2016 20:23
Read multiple cvs files into one data frame
# "data" is a directory in CWD
files <- list.files("data", pattern = glob2rx("forbrug_2016_*-utf8.csv"), full.names = TRUE)
(forbrug = lapply(files,
read_delim,
";",
escape_double = FALSE,
col_types = cols(
Afsenderkonto = col_character(),
Dato = col_date(format = "%d-%m-%Y"),
Modtagerkonto = col_character(),
Analysis of Nanite Technical Metadata
========================================================
Get the data
```{r, message=FALSE}
d<-read.csv("data/jobs.csv")
```
Let us se what data we have got