Skip to content

Instantly share code, notes, and snippets.

View pachadotdev's full-sized avatar
🎯
Focusing

Mauricio "Pachá" Vargas Sepúlveda pachadotdev

🎯
Focusing
View GitHub Profile
x1 = cm[,1]
n <- length(x1)
x1[(x1 != sort(x1,partial=n-1)[n-1]) & (x1 != sort(x1,partial=n-2)[n-2]) & (x1 != sort(x1,partial=n-3)[n-3])] <- 0
@pachadotdev
pachadotdev / download_and_or_load.R
Created October 12, 2016 18:05
Automatically downloads and/or load the libraries for your Rmds/R scripts
download_and_or_load <- function(x){
y <- x[!(x %in% installed.packages()[, "Package"])]
if (length(y))
install.packages(y, dependencies = TRUE)
sapply(x, require, character.only = TRUE)
}
my_libraries <- c("ggplot2", "dplyr", "purrr")
download_and_or_load(my_libraries)
@pachadotdev
pachadotdev / README.md
Last active December 26, 2016 04:28
Otro ejemplo de Treemap con D3Plus

license: gpl-3.0

este es un ejemplo de como ejecutar D3Plus directamente desde un gist

@pachadotdev
pachadotdev / .block
Last active December 26, 2016 04:23
Ejemplo de Treemap en D3Plus
license: mit
@pachadotdev
pachadotdev / chl_chn_2014_6char.json
Created December 3, 2016 23:21
D3 network example
[
{
"year": 2014,
"group": "Animal and Vegetable Bi-Products",
"product_id": "031504",
"product": "Fish Oil",
"group_id": "03",
"import_val": 25302351.67,
"export_val": 1190604.86,
"trade_exchange_val": 26492956.53,
@pachadotdev
pachadotdev / index.html
Last active December 26, 2016 04:28
Ejemplo de Red con D3Plus 2
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="https://d3plus.org/js/d3plus-network.v0.1.full.min.js"></script>
<style>
@pachadotdev
pachadotdev / es_transcript.md
Last active December 18, 2016 04:08
Beta & Bit spanish translation

Page 1

Las aventuras de Beta y Bit ¿Cómo medir un perro con una regla?

Bit, quien es un un fanático de los robots, las computadoras, y la programación, se transforma en SuperBit al enfrentarse a nuevos desafíos.

El superpoder de Bit es buscar datos. Beta, a quien le apasionan las matemáticas, el ajedrez y los buenos libros, se transforma en SuperBeta al enfrentarse a nuevos desafíos.

@pachadotdev
pachadotdev / index.html
Last active December 24, 2016 16:38
Grupo 3 - Clasificación Internacional de Situación en el Empleo Abreviada según Sexo
<!doctype html>
<meta charset="utf-8">
<script src="//d3plus.org/js/d3.js"></script>
<script src="//d3plus.org/js/d3plus.js"></script>
<div id="viz"></div>
<script>
@pachadotdev
pachadotdev / index.html
Last active December 24, 2016 16:42
Grupo 3 - Horas promedio de trabajo no remunerado por sexo
<!doctype html>
<meta charset="utf-8">
<script src="//d3plus.org/js/d3.js"></script>
<script src="//d3plus.org/js/d3plus.js"></script>
<div id="viz"></div>
<script>
@pachadotdev
pachadotdev / index.html
Last active September 15, 2017 07:55
Grupo 2 - Accidentes Aéreos
<!doctype html>
<meta charset="utf-8">
<script src="//d3plus.org/js/d3.js"></script>
<script src="//d3plus.org/js/topojson.js"></script>
<script src="//d3plus.org/js/d3plus.js"></script>
<!-- create container element for visualization -->
<div id="viz"></div>