This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!require("httr2")) install.packages("httr2") | |
httr2::request("pkmn.li") |> | |
httr2::req_perform() |> | |
httr2::resp_body_string() |> | |
cat() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extracted from http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip | |
# under public domain terms | |
country_bounding_boxes = { | |
'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)), | |
'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)), | |
'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)), | |
'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)), | |
'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)), | |
'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Load the gambling dataset | |
#' | |
#' Load the "Gambling in England and Scotland, 2012: Combined Data from the | |
#' Health Survey for England and the Scottish Health Survey". | |
#' | |
#' @param URL String with the URL to the gambling dataset. | |
#' Original URL: https://beta.ukdataservice.ac.uk/Umbraco/Surface/Discover/GetDownload?studyNumber=7631&fileName=7631spss_64b153f5084ba9c47585e4248a2a1677.zip | |
#' Shorten URL: https://tinyurl.com/ukdata-gambling | |
#' | |
#' @return Data frame with the gambling dataset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### 1. Sign up at GitHub.com ################################################ | |
## If you do not have a GitHub account, sign up here: | |
## https://github.com/join | |
# ---------------------------------------------------------------------------- | |
#### 2. Install git ########################################################## | |
## If you do not have git installed, please do so: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove_geneid_version <- function() { | |
seq_file <- file.choose() | |
seq_file_contents <- read.table(seq_file, header = FALSE) | |
seq_file_contents$V1 <- | |
gsub(pattern = ".[0-9]+$", replacement = "", seq_file_contents$V1) | |
write.table(seq_file_contents, file.choose(new = TRUE), | |
quote = FALSE, | |
row.names = FALSE, | |
col.names = FALSE) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Load the gambling dataset | |
#' | |
#' Load the "Gambling in England and Scotland, 2012: Combined Data from the | |
#' Health Survey for England and the Scottish Health Survey". | |
#' | |
#' @param URL String with the URL to the gambling dataset. | |
#' Original URL: https://beta.ukdataservice.ac.uk/Umbraco/Surface/Discover/GetDownload?studyNumber=7631&fileName=7631spss_64b153f5084ba9c47585e4248a2a1677.zip | |
#' Shorten URL: https://tinyurl.com/ukdata-gambling | |
#' | |
#' @return Data frame with the gambling dataset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Load the gambling dataset | |
#' | |
#' Load the "Gambling in England and Scotland, 2012: Combined Data from the | |
#' Health Survey for England and the Scottish Health Survey". | |
#' | |
#' @param URL String with the URL to the gambling dataset. | |
#' Original URL: https://beta.ukdataservice.ac.uk/Umbraco/Surface/Discover/GetDownload?studyNumber=7631&fileName=7631spss_64b153f5084ba9c47585e4248a2a1677.zip | |
#' Shorten URL: https://tinyurl.com/ukdata-gambling | |
#' | |
#' @return Data frame with the gambling dataset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install the package ---- | |
# install.packages("remotes") | |
remotes::install_github("rOpenSci/fingertipsR", | |
build_vignettes = TRUE, | |
dependencies = "suggests") | |
# Data profiles ---- | |
# Retrieve data profiles and filter Publoc Health Outcomes | |
fingertipsR::profiles() |> | |
dplyr::filter(stringr::str_detect(ProfileName, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It's been a while since this gist was written. In the meantime the package homeassistant-supervised apt | |
package was introduced for debian based systems. If you used that way the first thing you should do use | |
the normal package uninstaller with something like: (sudo) apt remove homeassistant-supervised | |
If for some reason that doesn't work proceed with the below instructions for a manual cleanup. | |
1) stop services: | |
sudo systemctl stop hassio-supervisor.service | |
sudo systemctl stop hassio-apparmor.service | |
2) disable services: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://data.humdata.org/dataset/cod-ab-cri? | |
filename <- "~/Downloads/cri_adm_2021_WGS_84.gdb" | |
sf::st_layers(filename) | |
# Provincias | |
cri_adm1 <- sf::st_read(filename, layer = "cri_admbnda_adm1_2021_WGS_84") | |
cri_adm1 | |
# Distritos | |
cri_adm2 <- sf::st_read(filename, layer = "cri_admbnda_adm2_2021_WGS_84") | |
cri_adm2 |
NewerOlder