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
| default: | |
| pipeline: | |
| name: '{%!=name}' | |
| ppid: 2 | |
| meta: | |
| origin: | |
| ssnam: '' # source system name | |
| ssurl: '' # populate if api url | |
| destn: | |
| dbms: "postgres" # one of postgres, mssql, mysql, mongod |
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(shiny) | |
| library(lubridate) | |
| library(sodium) | |
| library(jsonlite) | |
| ui <- fluidPage( | |
| titlePanel("Explore Session Meta"), | |
| sidebarLayout( |
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
| site_index_path <- tempfile("index_", fileext = ".html") | |
| stopifnot( file.create(site_index_path) ) | |
| tools::Rd2HTML( | |
| tools::parse_Rd("man/f_add.Rd"), | |
| out = site_index_path | |
| ) | |
| rstudioapi::viewer(site_index_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
| getCompChain <- function(id, n = 100, asDT=FALSE, store = TRUE){ | |
| fn_comp <- function(id){ | |
| r <- ZillowR::GetComps(zpid = id, count = 25, zws_id = zws) | |
| xll <- XML::xmlToList(r$response) | |
| count <- ncol(xll["comparables", ][[1]]) | |
| res <- lapply(1:count, function(iter){ | |
| list( | |
| zpid = xll['comparables', ][[1]]['zpid', ][[iter]], | |
| address = xll['comparables', ][[1]]['address', ][[iter]] | |
| ) |
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
| require("googleAuthR") | |
| require("formatR") | |
| secret_file <- "/My Project 94698-b17961ee0d57.json" | |
| Sys.setenv("GAR_AUTH_FILE"=secret_file) | |
| tk <- googleAuthR::gar_auth_service( | |
| json_file = Sys.getenv("GAR_AUTH_FILE") | |
| ) |
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
| # fun names- c("f") | |
| obj <- unlist(stringr::str_extract_all( | |
| ls(envir = .GlobalEnv, all.names = TRUE), | |
| pattern = paste0(pat, "+_?"), | |
| simplify = FALSE | |
| )) | |
| obj[sapply(obj, function(i) rlang::is_callable(get(i)))] |
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(rlang) | |
| # Symbolic objects and functions are callable: | |
| is_callable(quote(foo)) | |
| is_callable(base::identity) | |
| # node_poke_car() lets you modify calls without any checking: | |
| lang <- quote(foo(10)) | |
| node_poke_car(lang, current_env()) |
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(rstudioapi) | |
| # insert text at the start of the document | |
| insertText(c(1, 1), "# Hello\n") | |
| # insert text at the end of the document | |
| insertText(Inf, "# Hello\n") | |
| # comment out the first 5 rows | |
| pos <- Map(c, 1:5, 1) |
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(rstudioapi) | |
| # insert text at the start of the document | |
| insertText(c(1, 1), "# Hello\n") | |
| # insert text at the end of the document | |
| insertText(Inf, "# Hello\n") | |
| # comment out the first 5 rows | |
| pos <- Map(c, 1:5, 1) |
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
| fname <- tempfile(pattern = "wks_", tmpdir = ".", fileext = ".RData") | |
| save.image(file = fname, safe = TRUE) |