## function to split "label: text" into data.frame(label = text)
v1 <- function(x) {
x <- gsub(": ", ":", x) ## first clear that whitespace
dd <- read.delim(text = x, sep = ":", header = FALSE);
setNames(data.frame(dd[[2]]), dd[[1]][1])
}
library(sf)
sf::sf_use_s2(FALSE)
This file contains hidden or 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
| # DuckDB Vector Tiles with mapgl Example | |
| # This script demonstrates how to serve vector tiles from DuckDB using ST_AsMVT() | |
| # and display them in a mapgl map using httpuv | |
| library(mapgl) | |
| library(duckdb) # Requires the latest DuckDB version (>= 1.4.0) | |
| library(httpuv) | |
| library(sf) | |
| library(duckspatial) | |
| library(tigris) |
This file contains hidden or 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
| library(duckdb) | |
| library(duckplyr) | |
| library(dplyr) | |
| chrome_history_path <- "./chrome_history.sqlite" | |
| # Copy the db to the local directory because Chrome puts a lock on it | |
| file.copy( | |
| "~/.config/google-chrome/Default/History", # Adjust based on OS | |
| chrome_history_path, |
This file contains hidden or 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
| #' Aggregate sf objects | |
| #' | |
| #' Geometries and attributes are aggregated. | |
| #' | |
| #' @param x sf object | |
| #' @param by name of the variable of grouping elements | |
| #' @param var name(s) of the variable(s) to aggregate | |
| #' @param fun function(s) to compute the summary statistics | |
| #' | |
| #' @return An sf object is returned |
This file contains hidden or 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
| # NOTE - THIS SCRIPT IS NOW OBSOLETE - SEE MY OTHER REPO FOR A MUCH MORE COMPREHENSIVE TOOL: https://github.com/ThioJoe/Windows-Super-God-Mode | |
| # Get All Shell Folder Shortcuts Script (Updated 8/10/2024) | |
| # Original source: https://gist.github.com/ThioJoe/16eac0ea7d586c4edba41b454b58b225 | |
| # This PowerShell script is designed to find and create shortcuts for all special shell folders in Windows. | |
| # These folders can be identified through their unique Class Identifiers (CLSIDs) or by their names. | |
| # The script also generates CSV files listing these folders and associated tasks/links. | |
| # How to Use: | |
| # 1. Open PowerShell and navigate to the path containing this script using the 'cd' command. |
This file contains hidden or 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
| library("sf") | |
| file = system.file("shape/nc.shp", package = "sf") | |
| shp = read_sf(file) | |
| ## write zipped shapefile | |
| write_sf(shp, "myshapefile.shp.zip", driver = "ESRI Shapefile") | |
| ## read zipped shapefile | |
| read_sf("myshapefile.shp.zip") |
This file contains hidden or 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
| @ECHO OFF | |
| echo "Starting installation 🚀" | |
| :: Driver Software | |
| winget install -e --id Nvidia.GeForceExperience | |
| winget install -e --id Logitech.GHUB | |
| winget install -e --id Corsair.iCUE.4 | |
| winget install -e --id Nvidia.Broadcast |
This file contains hidden or 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
| #' @title split lines | |
| #' @description Splits lines longer than a given threshold into the minimum number of pieces to all be under the given threshold. | |
| #' @param lines data.frame of class sf with LINESTRING sfc column. | |
| #' @param max_length maximum segment length to return | |
| #' @param id name of ID column in data.frame | |
| #' @return only the split lines. | |
| #' @importFrom dplyr group_by ungroup filter left_join select rename mutate | |
| #' @export | |
| #' | |
| split_lines <- function(input_lines, max_length, id = "ID") { |
This file contains hidden or 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
| COUNTYFIPS | NAME | STATEPLANEFIPS | EPSG | |
|---|---|---|---|---|
| 16079 | Shoshone County | 1103 | 26970 | |
| 16073 | Owyhee County | 1103 | 26970 | |
| 16071 | Oneida County | 1101 | 26968 | |
| 16077 | Power County | 1101 | 26968 | |
| 16075 | Payette County | 1103 | 26970 | |
| 06115 | Yuba County | 0402 | 26942 | |
| 06111 | Ventura County | 0405 | 26945 | |
| 06113 | Yolo County | 0402 | 26942 | |
| 31177 | Washington County | 2600 | 32104 |