- On the repo homepage, click the text 'Releases' in the right-hand section.
- Click the 'Draft a new release' button (upper-right).
- Click the 'Choose a tag' button (upper-left). This is going to 'tag' this point in the Git history with the version number.
- Type in the box the version you're releasing, e.g. 'v0.1.1'.
- Click '➕ Create new tag: v0.1.1 on publish' that appears under the box.
- Click 'Generate release notes', which will autoname the release with the tag autofill the notes with a bullet per PR since the last release
- Click 'Publish release' button (lower-right) to publish the release and add the tag to the version history.
- Return to the repo's homepage, where you'll see that the version number has incremented under the 'Releases' section.
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
set.seed(123) | |
n <- 5 | |
scheme <- paste("Scheme", 1:n) | |
mitigator <- paste("Mitigator", LETTERS[1:n]) | |
combos <- tidyr::crossing(scheme, mitigator) | |
nrows <- nrow(combos) | |
dat <- combos |> | |
dplyr::mutate( | |
mitigator_group = dplyr::if_else( | |
stringr::str_detect(mitigator, " [ABC]$"), |
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
# Calculate how many plots will be produced | |
count_plots <- function(df, var) { | |
length(unique(df[[var]])) | |
} | |
# Plot faceted chart, save with height dependent on plot count | |
write_responsive_facets <- function( | |
df, | |
var = "species", | |
plot_count = count_plots(df, var), |
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
# {nara} by Mike Cheng: https://coolbutuseless.github.io/package/nara/index.html | |
# Kenney by Kenney: https://www.kenney.nl | |
# Read png tiles | |
tile_paths <- list.files( | |
"~/Desktop/kenney/kenney_tiny-dungeon/Tiles", | |
pattern = ".png$", | |
full.names = TRUE, | |
recursive = 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
# 1. Generate temporary Excel files ---- | |
# Make a temporary spreadsheet with named sheets | |
make_temp_xlsx <- function(sheet_names) { | |
wb <- openxlsx2::wb_workbook() | |
for (sheet in sheet_names) wb <- wb |> openxlsx2::wb_add_worksheet(sheet) | |
temp <- openxlsx::temp_xlsx() | |
openxlsx2::wb_save(wb, temp) | |
} |
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
#' Convenience Function: Read a (Zipped) JSON File from an Azure Container | |
#' | |
#' @param container A blob_container/storage_container object. Probably | |
#' generated by [connect_to_container]. | |
#' @param file Character. Path to file within the container named by | |
#' `container`. | |
#' | |
#' @return A list. | |
#' @export | |
#' |
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
generate_num_format <- function(number = 8634567.890) { | |
num_val <- number %/% 1 | |
num_dp <- number %% 1 | |
num_split <- strsplit(as.character(number), "\\.")[[1]] | |
n_dp <- nchar(num_split[2]) | |
num_commas <- scales::number(as.numeric(num_val), big.mark = ",") | |
fmt_out <- gsub("[[:digit:]]", "#", num_commas) |
- In your package project, run
usethis::use_data_raw("demo-data")
to set up adata-raw/
folder with ademo-data.R
file inside. - Write a script in
demo-data.R
to produce the data object (e.g.demo_df
). - Insert and run the line
usethis::use_data(demo_df)
indemo-data.R
, which will save the data object to adata/demo_df.rda
file. - Run
usethis::use_r("demo-data")
to create a correspondingR/demo-data.R
file where you can document the data. - In
R/demo-data.R
, quote the name of the data object (i.e."demo_df"
) and put {roxygen2} code above it (probably at least@title
,@description
and maybe@format
, which might contain a\describe{}
block to explain the content of your object, itself containing an\item{}
to describe each column if it's a data.frame). - Run
devtools::document()
to generate theman/
pages for the data. - Run
devtools::load_all()
to reload your package and makedemo_df
available in your session. - Once pushed, users can attach the package and acc
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
/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */ | |
/*! Adapted from https://jeroen.github.io/clippy/bundle.js by Jeroen Ooms */ | |
!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?t |
NewerOlder