This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT DISTINCT | |
| CAST(FLOOR(YEAR(t.begin_effective_date) / 5) * 5 AS INTEGER) AS period, | |
| s.section, | |
| t.hts8, | |
| t.agreement, | |
| t.ad_val_rate * 100 AS rate | |
| FROM read_csv('2026-W17/tariff_agricultural.csv', nullstr='NA') t | |
| JOIN read_csv('2026-W17/hts_sections.csv') s | |
| ON LEFT(t.hts8, 2) = s.chapter | |
| WHERE t.ad_val_rate > 0 AND t.ad_val_rate < 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH financing AS ( | |
| SELECT country_name, year, value | |
| FROM read_csv('financing_schemes.csv', delim = ',', header = true, quote = '"', dateformat = '%Y') | |
| WHERE indicator_code = 'hf3_che' | |
| ), class AS ( | |
| SELECT economy, "Income group" as income_group FROM 'nwb_class.csv' | |
| ), country_payments AS ( | |
| SELECT country_name, year, value, income_group from financing | |
| JOIN class ON financing.country_name = class.economy | |
| ), class_avg AS ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(shiny) | |
| library(bslib) | |
| library(duckplyr) | |
| data1 <- readRDS("data.rds") | |
| data2 <- read.csv("data.csv") | |
| data3 <- df_from_parquet("data.parquet") | |
| ui <- page_fillable( | |
| titlePanel("Example: loading data formats"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rcpp::sourceCpp("mandeldrop.cpp") | |
| xlims=c(-0.65,0.65) | |
| ylims=c(-0.6,2.2) | |
| m <- mandeldrop(xlims[[1]], xlims[[2]], ylims[[1]], ylims[[2]], 1560, 2160, 512) | |
| # Colour palette from https://stackoverflow.com/q/48069990 | |
| rainbow=c(rgb(0.47,0.11,0.53),rgb(0.27,0.18,0.73),rgb(0.25,0.39,0.81),rgb(0.30,0.57,0.75),rgb(0.39,0.67,0.60),rgb(0.51,0.73,0.44),rgb(0.67,0.74,0.32),rgb(0.81,0.71,0.26),rgb(0.89,0.60,0.22),rgb(0.89,0.39,0.18),rgb(0.86,0.13,0.13)) | |
| cols=c(colorRampPalette(rainbow)(100),rev(colorRampPalette(rainbow)(100)),"black") |