Skip to content

Instantly share code, notes, and snippets.

View cimentadaj's full-sized avatar

Jorge Cimentada cimentadaj

View GitHub Profile
library(AmesHousing)
library(tidymodels)
ames <- make_ames()
ml_wflow <-
ames %>%
workflow() %>%
initial_split(prop = .75) %>%
recipe(Sale_Price ~ Longitude + Latitude + Neighborhood, data = ames) %>%
library(AmesHousing)
library(tidymodels)
ames <-
make_ames() %>%
# Remove quality-related predictors
select(-matches("Qu"))
############################# Data Splitting ##################################
# Make sure to install both
# devtools::install_github("timriffe/DDSQLtools")
library(DDSQLtools)
# install.packages("tictoc")
library(tictoc)
############################# issue 1 #########################################
###############################################################################
library(tidyverse)
set.seed(23131)
original_matrix <- replicate(10, sample(1:10, 10, replace = TRUE))
my_params <- tibble(x = sample(1:10, 5, replace = TRUE),
y = sample(2:3, 5, replace = TRUE))
# Define the matrix that will be updated in each iteration
my_matrix <- original_matrix
# This script loops over all `test_that` expressions in testthat files and adds
# a `skip_on_cran()` to any `test_that` expressions that **doesn't** have a a
# `skip_on_cran()`.
library(glue)
all_files <- list.files(here::here("tests/testthat/"),
full.names = TRUE,
pattern = "test-[0-9]")
# Slides: https://github.com/ITSLeeds/TDS/blob/master/slides/madrid-slides.Rmd
# Exercises http://git.io/tds2dayex
library(sf)
library(dplyr)
library(stplanr) # geographic transport data package
library(tmap)
library(osmdata)
library(tidyverse)
library(stats19)
# This scrapes the language/country website from Wikipedia and tries to pick
# the most spoken language from each country to generate a final data frame
# with a country - language. Since some countries have several official
# languages, I assume THE FIRST is the most spoken. This brings some error
# like Brazil has German as first. However, almost 90% of the work is done. Some small
# tweaks are needed.
library(rvest)
library(xml2)
library(ISOcodes)
---
title: Download (all) data from datos.gob.es
author: Jorge Cimentada
date: '2019-01-19'
slug: download-all-data-from-datos-gob-es
categories: []
tags: []
comments: no
showcomments: yes
showpagemeta: yes
# Redo of this post https://www.brodrigues.co/blog/2018-11-25-tidy_cv/
library("tidyverse")
library("tidymodels")
library("brotools")
library("mlbench")
set.seed(231451)
data("BostonHousing2")
wd=$(ls | grep cimentadaj.github.io)
NOCOLOR="\033[1;0m"
function error {
RED="\033[1;31m"
echo -e "${RED}$1${NOCOLOR}"
}
function message {
BLUE="\033[1;34m"