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
library(sf) | |
library(mapview) | |
library(tidyverse) | |
library(measurements) | |
library(units) | |
library(glue) | |
# Dissolve and summarize CBD parcel areas | |
cbd_parcels <- st_read("data/cbd_parcels.shp") | |
cbds_area <- cbd_parcels %>% |
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
suppressPackageStartupMessages(library(duckdb)) | |
suppressWarnings(suppressPackageStartupMessages(library(tidyverse))) | |
con <- dbConnect(duckdb()) | |
set.seed(1) | |
df <- tibble( | |
id = sample(1:5, 10, replace = TRUE), | |
x = sample(LETTERS[1:4], 10, replace = TRUE) | |
) | |
duckdb_register(con, "df", df, overwrite = TRUE) | |
q <- "select * from( |
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
library(shiny) | |
library(miniUI) | |
ui <- miniPage( | |
gadgetTitleBar("Import SQL Query"), | |
miniTabstripPanel( | |
selected = "Input", | |
# --- UI - Tab - Input ---- | |
miniTabPanel( | |
"Input", |
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
```{r} | |
path <- fs::path("mtcars", ext = "csv") | |
cmd <- paste0("{{< downloadthis ", "'", path, "'", ' dname=Mtcars label="Download the mtcars data" icon=database-fill-down type=info class=data-button id=mtcars >}}') | |
``` | |
```{r} | |
#| results: asis | |
cat(cmd) | |
``` |
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
--- | |
title: "downloadthis reprex" | |
format: html | |
include-after-body: button.html | |
--- | |
# Head1 | |
<br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> |
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
library(tidyverse) | |
library(ggalt) | |
library(ggforce) | |
df <- tibble( | |
x = 1:43, | |
y = c(rep(1, 10), 3.5, 6.5, 9, 2.75, 3, 13, 14, 15, 16, 17, 17.5, 18, 8, 9, 11.5, 13, 14, 15, 25.75, 27.75, 28, 28, 28.5, 28.75, 29, 34, 39, rep(NA, 6)), | |
desc = c( | |
"Creates GitHub Account", | |
rep(NA, 7), |
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
import pandas as pd | |
def display_raster_attribute_table(ras): | |
if ras.hasRAT: | |
flds = [fld.name for fld in arcpy.ListFields(ras)] | |
table = [] | |
cur = arcpy.SearchCursor(ras, flds) | |
for row in cur: | |
rowList = [row.getValue(fld) for fld in flds] | |
table.append(rowList) | |
del cur |
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
geom_heart <- function (mapping = NULL, data = NULL, stat = "identity", position = "identity", | |
..., parse = FALSE, nudge_x = 0, nudge_y = 0, check_overlap = FALSE, | |
na.rm = FALSE, show.legend = NA, inherit.aes = TRUE) | |
{ | |
if (!missing(nudge_x) || !missing(nudge_y)) { | |
if (!missing(position)) { | |
stop("Specify either `position` or `nudge_x`/`nudge_y`", | |
call. = FALSE) | |
} | |
position <- position_nudge(nudge_x, nudge_y) |
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
#' Connect to the data mart | |
#' | |
#' You must set three variables in your .Renviron: 'DATAMART_DSN', 'DATAMART_ID', and 'DATAMART_PW'. | |
#' @export | |
#' @examples | |
#'\dontrun{ | |
#'irdb <- connect_to_datamart() | |
#'} | |
connect_to_datamart <- function() { | |
DBI::dbConnect(odbc::odbc(), |
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
text_id | word | |
---|---|---|
A | lorem | |
A | ipsum | |
A | dolor | |
A | sit | |
A | amet | |
A | consectetur | |
A | adipiscing | |
A | elit | |
A | sed |
NewerOlder