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) | |
fn_with_tidyeval_glue <- function(.data, target_column){ | |
chr_target_column <- quo_name(enquo(target_column)) | |
pvw_glue <- paste0("{", chr_target_column, "}_{.value}") | |
.data %>% | |
pivot_wider( |
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: "Untitled" | |
format: revealjs | |
--- | |
First without heading | |
# First 1 heading | |
content |
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
/*-- scss:defaults --*/ | |
$inverse-background-color: #272822; | |
$presentation-font-size-root: 28px; | |
$presentation-heading-color: #e10020; | |
$heading2Size: 55px; | |
$heading3Size: 45px; | |
$heading4Size: 35px; | |
$link-color: #e10020; |
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
# from tibble::as_tibble() focs | |
tibble::as_tibble_col( | |
list(c = "three", d = list(4:5)), | |
column_name = "data" | |
) | |
#> # A tibble: 2 × 1 | |
#> data | |
#> <named list> | |
#> 1 <chr [1]> | |
#> 2 <list [1]> |
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) | |
some_data <- tibble( | |
messy_col = c('{"id":"1234567","bio":"John Smith, first-year undergraduate in Physics","username":"JSAstronaut"}', | |
'{"id":"00303","bio":"Jo Smith, first-year undergraduate in Physics","username":"JSAstronaut"}') | |
) | |
some_data$messy_col %>% fromJSON() | |
# Target each column at once: |
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(rnaturalearthdata) | |
library(sf) | |
country_sf <- countries110 %>% | |
st_as_sf() | |
ggplot() + | |
geom_sf(data = country_sf, | |
aes(fill = lastcensus, |
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: "{quarto}" | |
format: html | |
--- | |
````{verbatim} | |
--- | |
output: html_document | |
--- | |
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
--- | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_hooks$set(force_not_eval = function(value) { | |
value$eval <- FALSE | |
value | |
} | |
) |
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: "Report" | |
output: | |
word_document: | |
reference_docx: template.docx | |
html_document: | |
toc: TRUE | |
toc_depth: 2 | |
toc_float: TRUE | |
--- |
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: "Untitled" | |
output: | |
html_document: | |
toc: TRUE | |
toc_depth: 2 | |
toc_float: TRUE | |
--- |