Skip to content

Instantly share code, notes, and snippets.

View antaldaniel's full-sized avatar

Daniel Antal antaldaniel

View GitHub Profile
@antaldaniel
antaldaniel / 00.README.md
Created May 6, 2021 23:40 — forked from rmoff/00.README.md
RMarkdown - repeating child block with changing variable value

When you use knit_expand it appears that the inclusion of the Rmd is done on the first pass, and then the complete document evaluated. This means that a Rmd block referenced in loop with knit_expand will only evaluate changing variables at their last value.

This can be worked around by passing the literal value of the variable at the time of the knit_expand with {{var}} syntax.

This is documented in the knitr_expand docs, but less clear (to an R noob like me) for embedded documents rather than strings.

@antaldaniel
antaldaniel / smdb_demo_querries
Last active April 28, 2021 07:13
SMDB demo queries
/*
How much more dancable are The Youniverse than the average Slovak music?
<run separately after the / sign>
*/
select(
(select avg(danceability) as [The Youniverse - Danceability] from "spotify-top-tracks" where spotify_artist_name = "The Youniverse" ) /
(select avg(danceability) as [Average Danceability] from "spotify-top-tracks") - 1
)*100 as percent

Keybase proof

I hereby claim:

  • I am antaldaniel on github.
  • I am antaldaniel (https://keybase.io/antaldaniel) on keybase.
  • I have a public key ASDi9M4z5IPzZF2YJSvsHnMmOf8eRxImwaHEaJNabqgYswo

To claim this, I am signing this object:

@antaldaniel
antaldaniel / NGA_coverage-ISO2.csv
Created October 2, 2016 16:30 — forked from stared/NGA_coverage-ISO2.csv
Plot of Europe (choropleth) in R/ggplot, using NUTS data
CountryCode NGA_Coverage
MT 100
BE 98.84
NL 98.41
LT 97.29
LU 94.42
DK 91.7
LV 89.58
PT 89.11
UK 88.55