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
up_brewer <- function(pik, eps = 1e-06) { | |
if (any(is.na(pik))) | |
stop("there are missing values in the pik vector") | |
list <- pik > eps & pik < 1 - eps | |
pikb <- pik[list] | |
s <- pik | |
N <- as.integer(length(pikb)) | |
sb <- vector(mode = "double", length = N) | |
r <- .C("C_up_brewer", pikb, N, result = sb) | |
s[list] <- r$result |
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(tidyverse) | |
library(httr2) | |
library(cli) | |
url <- 'https://dtmapi.iom.int/api/IdpAdmin2Data/GetAdmin2Data' | |
payload <- list(operation = "", | |
countryName = "Afghanistan", | |
admin0Pcode = "", | |
reportingDate = list(fromDate = "2018-12-31", toDate = "2023-05-31"), |
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(tidyverse) # copy this part only if you don't have it yet | |
pop <- tibble(year = rep(2023, 5), | |
coa = c("Sudan", "Burkina Faso", "DRC", "Syria", "Yemen"), | |
pop = c(47.5, 22.9, 103.2, 22.1, 33.7), | |
idp = c(9.1, 2.3, 6.3, 7.2, 4.5)) |
OlderNewer