Skip to content

Instantly share code, notes, and snippets.

View robsalasco's full-sized avatar
🏠
Working from home

Roberto Salas robsalasco

🏠
Working from home
View GitHub Profile
library(httr)
library(jsonlite)
uf <- function(x, year, apikey) {
response <- GET(paste0("http://api.sbif.cl/api-sbifv3/recursos_api/uf/",year,"?apikey=",apikey,"&formato=json"))
data <- fromJSON(txt=content(response))$UFs
data$Valor <- sub("\\.","",data$Valor)
data$Valor <- sub("\\,",".",data$Valor)
data$Valor <- as.numeric(data$Valor)
media <- mean(data$Valor)
FROM rocker/rstudio
#RUN R -e 'install.packages(c("dplyr"), repos="http://cran.us.r-project.org")'
#RUN R -e 'install.packages(c("ggplot2","ggvis"), repos="http://cran.us.r-project.org")'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# How to open MS Access databases on R
# 1. Download UCanAccess https://sourceforge.net/projects/ucanaccess/
# 2. Install RJDBC package in R
# Example:
library(RJDBC)
options(java.parameters = "-Xmx4g")

CAFFE SEGNET TUTORIAL (PYENV)

FIRST INSTALL LIBRARIES RELATED TO CAFFE COMPILATION

brew install leveldb gperftools snappy glog gflags lmdb openblas boost boost-python

DOWNLOAD CAFFE FROM

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
library(httr)
library(rvest)
headers <- add_headers(
"User-Agent" = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36",
"Referer" = "https://redatam-ine.ine.cl/redbin/RpWebStats.exe/AreaList?BASE=CENSO_2017&ITEM=AREAPOB&lang=esp",
"Host" = "redatam-ine.ine.cl",
"X-Requested-With" = "XMLHttpRequest"
)