Skip to content

Instantly share code, notes, and snippets.

View jbkunst's full-sized avatar
🐢
Work it harder Make it better Do it faster

Joshua Kunst jbkunst

🐢
Work it harder Make it better Do it faster
View GitHub Profile
library(tidyverse)
# DMC
agrometR::estaciones_agromet
agrometR::estaciones_dmc |>
filter(str_detect(nombreEstacion, "uinta"))
data <- agrometR::get_agro_data_dmc(
library(ranger)
data("mtcars")
regularized_rf <- ranger(mpg ~ .,
data = mtcars,
num.trees = 500,
# num.threads = 1, # needs to be set to
# avoid parallelization
mtry = 7,
importance = "impurity",
ls <- red_sample$geometry %>% head(1)
dem <- dem
C <- 0.6
tobler_calle2 <- function(ls, dem, C){
# puntos <- puntos_ordenados(ls,dem)
# puntos <- todos_los_puntos(ls, dem)
pts_orig <- ls %>%
st_cast('POINT') %>%
@jbkunst
jbkunst / bipapp.r
Last active November 19, 2020 23:13
library(shiny)
library(leaflet)
library(dplyr)
library(shinythemes)
library(shinyjs)
dbip <- readRDS("dbip.rds")
comuna_lista <- dbip %>%
distinct(comuna) %>%
# setup -------------------------------------------------------------------
library(readxl)
library(tidyverse)
library(janitor)
library(leaflet)
# recuerden que la expresion hola::chao
# es la funcion 'chao' del paquete 'hola'
# no se pudo encontrar la función "hola"
library(shiny)
library(forecast)
library(xts)
library(tradestatistics)
library(ggplot2)
# este es un input ficticio (posible) con el cual yo haré pruebas de mi código
# input <- list(pais = "chn")
ui <- fluidPage(
library(shiny)
library(tidyverse)
library(leaflet)
dbip <- readRDS("data/dbip.rds")
lista_comunas <- dbip %>%
count(COMUNA, sort = TRUE) %>%
pull(COMUNA)
library(tidyverse)
library(readxl)
dbip <- read_xlsx("data/pcma20201028oficio-47702013.xlsx", skip = 7)
# como leer más de una hoja
# readxl::excel_sheets()
# readxl::excel_sheets("data/pcma20201028oficio-47702013.xlsx")
dbip
library(tidyverse)
library(lubridate)
library(highcharter)
confirmed <- read_csv("https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv")
get_data <- function(url = "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Deaths.csv"){
data_wide <- read_csv(url)
# run via
# source("https://gist.githubusercontent.com/jbkunst/981a6416025d3d7d80303bc20e5269fa/raw/install.packages.R")
install.packages(c(
# tidyverse
"tidyverse", "broom",
# io
"RODBC", "odbc", "readxl", "writexl", "dbplyr",
# development
"devtools", "testthat", "roxygen2", "assertthat",