This file contains 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
/*================================================== | |
project: Examples of the handbook using GMD | |
Author: Andres Castaneda | |
Dependencies: The World Bank | |
---------------------------------------------------- | |
Creation Date: 6 Jul 2018 - 12:03 | |
Modification Date: | |
Do-file version: 01 | |
References: | |
Output: http://eca/povdata/examples_handbook_GMD.DO |
This file contains 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
maxN <- function(x, N=2, decreasing = FALSE){ | |
len <- length(x) | |
if(N>len){ | |
warning('N greater than length(x). Setting N=length(x)') | |
N <- length(x) | |
} | |
if (decreasing == FALSE) { | |
sort(x,partial=len-N+1)[len-N+1] | |
} else { | |
-sort(-x,partial=len-N+1)[len-N+1] |
This file contains 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
# requires data.table and data.tree | |
dir_size <- function(path = ".", | |
limit = 25, | |
sharet = .1) { | |
# get file from directory path | |
a <- list.files(path, | |
all.files = TRUE, | |
recursive = TRUE, | |
full.names = TRUE) |
This file contains 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
#' @title bibtex_2academic | |
#' @description import publications from a bibtex file to a hugo-academic website | |
#' @author Lorenzo Busetto, phD (2017) <lbusett@gmail.com> | |
#' @modified Peter Paul Pichler (2019) <pichler@pik-potsdam.de> | |
#' @modified R.Andres Castaneda (2019) <acastanedaa@worldbank.org> | |
bibtex_2academic <- function(bibfile, | |
outfold, | |
abstract = FALSE, | |
overwrite = FALSE) { |
NewerOlder