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
-- !preview conn=rsfsu::connect_to_datamart() | |
WITH ds412 AS ( | |
SELECT CRS_SID AS SID, | |
TO_NUMBER(CRS_YEAR_TERM) AS DS412_TERM, | |
CRS_SEMESTER AS SEMESTER, | |
CRS_SECT AS SECTION, | |
CRS_GRADE AS DS412_GRADE, | |
CASE WHEN RTRIM(ETHNIC_URM1) = '1.URM' THEN 'Yes' ELSE 'No' END AS URM | |
FROM IRDMSTG.DM_CRS_EOT | |
WHERE RTRIM(COURSE_ID12) = 'DS 0412' |
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 |
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
year,day,month,max | |
2010,1,Jan,57 | |
2010,2,Jan,55 | |
2010,3,Jan,55 | |
2010,4,Jan,54 | |
2010,5,Jan,61 | |
2010,6,Jan,54 | |
2010,7,Jan,53 | |
2010,8,Jan,54 | |
2010,9,Jan,54 |
NewerOlder