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(tibble) | |
| library(purrr) | |
| library(tidyr) | |
| library(htmltools) | |
| library(dplyr) | |
| df <- tibble::tribble( | |
| ~level_1, ~level_2, ~level_3, | |
| "coffee", "espresso", "with milk", | |
| "coffee", "espresso", "without milk", |
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
| options( | |
| vsc.rstudioapi = TRUE, | |
| vsc.browser = "Beside", | |
| vsc.dev.args = list(width = 1200, height = 900), | |
| vsc.str.max.level = 2 | |
| ) |
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
| cloud_view <- function(obj) { | |
| withr::with_options( | |
| list(viewer = function(url, ...) { | |
| get_url_dir <- function(url) gsub("file://|/index.html", "", url) | |
| server <- servr::httd( | |
| dir = get_url_dir(url), | |
| verbose = TRUE, | |
| browser = FALSE | |
| ) | |
| .vsc.browser(server$url, ...) |
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(tidyverse) | |
| do_sim <- function() { | |
| n_locations <- 1000 | |
| n_stations <- 10 | |
| n_sources <- n_stations + n_locations | |
| n_incidents <- 20000 | |
| n_replicates <- 100 | |
| probabilities <- seq(0.7, 1, by = 0.05) |
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
| concat_maps <- function(...) { | |
| rdeck_maps <- list(...) | |
| rdeck_map_names <- names(rdeck_maps) | |
| rdeck_map_names[nzchar(rdeck_map_names) == 0] <- "Base layers" | |
| # set up init for reduce | |
| container <- rdeck_maps[[1]] | |
| container$x$layers <- | |
| map(container$x$layers, function(layer) { | |
| layer$group_name <- rdeck_map_names[[1]] | |
| layer$visibility_toggle <- TRUE |
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
| client <- TCPLanguageClient$new(port = 8888) #session 1 | |
| run(port = 8888) # session 2 | |
| client$start() | |
| data <- client$fetch(blocking = TRUE) | |
| client$handle_raw(data) | |
| ## do stuff with client | |
| client %>% did_save(defn_file_path2) | |
| result <- client %>% respond_document_symbol(defn_file_path2) |
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
| system.time({ | |
| library(conflicted) | |
| library(qfes) | |
| library(tidyverse) | |
| library(rmapshaper) | |
| library(sf) | |
| library(h3jsr) | |
| library(furrr) | |
| library(future) | |
| library(rdeck) |
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(tidyverse) | |
| oms_db <- | |
| tribble( ~id, ~data, ~start, ~end, | |
| 1, 1, '2020-01-01', '2020-01-04', | |
| 1, 2, '2020-01-04', '3000-01-01', | |
| 2, 1, '2020-01-01', '2020-01-04', | |
| 2, 2, '2020-01-04', '3000-01-01', |
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
| x <- vignette("dbplyr") | |
| rstudioapi::navigateToFile(with(x, file.path(Dir, "doc", File))) |
NewerOlder