Skip to content

Instantly share code, notes, and snippets.

Avatar

Emilio Velis dubsnipe

View GitHub Profile
View github2appropedia.R
github2mediawiki <- function(manifest_url) {
okh_tmp <- tempfile()
download.file(paste0(manifest_url, "?raw=true"), okh_tmp)
manifest <- read_yaml(okh_tmp)
manifest_text <- paste0(
"{{Infobox device\n",
"|image=", manifest$image, "<!-- Please consider uploading image to Appropedia. -->\n",
"|description=", manifest$description, "\n",
"|keywords=", manifest$keywords, "\n",
View appropedia-gscholar-2020.R
require(rvest, quietly=T)
require(dplyr, quietly=T)
require(scholar, quietly=T)
index <- seq(from=81, to=90)
# Page number from which results are drawn. This is done in parts to avoid getting error 429.
# https://stackoverflow.com/questions/43461907/in-r-how-do-i-combine-two-xml-documents-into-one-document
xml0 <- read_xml("<html></html>")
for(i in index){
@dubsnipe
dubsnipe / titles.R
Created Nov 11, 2020
Extract title from a list of URLS
View titles.R
require(tidyverse)
require(rvest)
toolbox <- tibble(read.csv("toolbox.csv", header=T))
read_title <- function(x){
tmp <- read_html(x) %>% html_node("title") %>% html_text()
return(tmp)
}
@dubsnipe
dubsnipe / manifest-maker.R
Last active Apr 6, 2020
Quick script to generate Open Know-How manifests out of a Google Form
View manifest-maker.R
require(googledrive)
url <- ""
# Download form responses to a .csv file
filename <- "okh_data.csv"
drive_download(file = as_id(url),
path = filename,
overwrite = TRUE)
@dubsnipe
dubsnipe / world_co2.R
Last active Jan 14, 2020
This script generates a CO2 worldwide emissions chart based on World Bank data.
View world_co2.R
fileUrl <- "http://api.worldbank.org/v2/en/topic/19?downloadformat=csv"
dataset <- "wbco2_dataset.zip"
download.file(
fileUrl,
dataset,
mode = "wb"
)
zip_list <- unzip(dataset, list=T)
View labsMap.R
require(maptools)
require(dplyr)
require(googledrive)
require(leaflet)
require(leaflet.extras)
# https://stackoverflow.com/questions/31336898/how-to-save-leaflet-in-r-map-as-png-or-jpg-file
library(devtools)
# install_github("wch/webshot")
library(htmlwidgets)
View gv_el_salvador_data_analysis.Rmd
---
title: "Análisis exploratorio de voluntariado internacional en Hábitat El Salvador"
author: "Emilio Velis"
date: "June 12th, 2019"
output:
html_document: default
pdf_document: default
---
```{r setup, include=FALSE}
View human_2.R
require(googledrive)
require(dplyr)
require(tibble)
require(tidyr)
require(stringr)
require(ggplot2)
require(stopwords)
require(tidytext)
human <- tbl_df(read.csv("human_2.csv", encoding = "UTF-8", stringsAsFactors = F))
View summit-cleaning
ccwriter <- function(t){
primary <- c(
t[['primary.presenter']],
t[['primary.presenter.org']],
t[['primary.presenter.email']],
t[['primary.presenter.url1']],
t[['primary.presenter.url2']],
t[['primary.presenter.url3']],
View human.R
require(googledrive)
require(dplyr)
require(tibble)
require(tidyr)
require(stringr)
require(ggplot2)
require(stopwords)
human <- tbl_df(read.csv("human.csv", encoding = "UTF-8", stringsAsFactors = F))
colnames(human) <- c("time",LETTERS[1:6])
You can’t perform that action at this time.