Skip to content

Commit

Permalink
Merge branch 'main' into 73_date_functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bms63 authored Sep 21, 2023
2 parents 332d48c + 0d30076 commit 40ab3bc
Show file tree
Hide file tree
Showing 10 changed files with 565 additions and 7 deletions.
1 change: 1 addition & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ https://www.linkedin.com/*
https://cosa.cdisc.org/events/Admiral
///home/runner/work/blog/blog/posts/2023-06-28_welcome/pharmaverse.slack.com
https://pharmaverse.github.io/blog/posts/2023-06-27_hackathon_app/
https://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
10 changes: 5 additions & 5 deletions R/create_blogpost.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ c(

# Fill in the info, e.g.:
create_post(
post_name = "study_day", # needs to be character vector (length 1)
post_date = "2023-08-08", # needs to be character vector (length 1)
post_name = "pharmaverse story", # needs to be character vector (length 1)
post_date = "2023-08-30", # needs to be character vector (length 1)
description = "", # you can fill the description in later as well
author = c("Ben Straub"), # one or more authors are permitted
cover_image = "admiral", # chose one of the above (see line 8)
tags = c("admiral", "ADaMs") # chose (multiple) from line 10
author = c("Nicholas Eugenio"), # one or more authors are permitted
cover_image = "pharmaverse", # chose one of the above (see line 8)
tags = c("community") # chose (multiple) from line 10
)


Expand Down
80 changes: 78 additions & 2 deletions inst/WORDLIST.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,73 @@ tlg
TLG
TLGs
xpt
APMDOS
atorus
Atorus
britannica
dev
Encyclopædia
envsetup
Farrugia
Gottfried
Hk
Isabela
Janssen
Kalappurakal
logrx
merck
metacore
Pharma
pharmaRTF
phuse
QOlIU
qp
Rimler
rinpharma
rtf
Stackhouse
Sumesh
tidytlg
Tplyr
Velásquez's
youtube
anderson
atorus
CAMIS
ceil
dn
doesn
edu
eps
gp
Gregor
htm
IBMRounding
iml
ji
lexjansen
lhdjung
lrcon
phuse
psiaims
rdocumentation
rounde
Roundings
roundSAS
rw
SAS's
sfirke
stackoverflow
StackOverflow
thm
tidytlg
tplyr
Tplyr
trunc
ucla
unv
ut
zMachine
admiraldev
admiralRoche
apache
Expand Down Expand Up @@ -300,7 +367,6 @@ VSDTC
VSTPT
ymd
yyyy
=======
AENDT
AENDY
ASTDTM
Expand All @@ -315,4 +381,14 @@ DTM
dy
lubridate
TRTSDTM
ymd
Ari
eclinical
Knoph
Nordisk
Novo
Siggaard
pharma
reproducibility
behaviour
Farrugia
ethz
78 changes: 78 additions & 0 deletions posts/2023-07-24_rounding/appendix.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# markdown helpers --------------------------------------------------------

markdown_appendix <- function(name, content) {
paste(paste("##", name, "{.appendix}"), " ", content, sep = "\n")
}
markdown_link <- function(text, path) {
paste0("[", text, "](", path, ")")
}



# worker functions --------------------------------------------------------

insert_source <- function(repo_spec, name,
collection = "posts",
branch = "main",
host = "https://github.com",
text = "source code") {
path <- paste(
host,
repo_spec,
"tree",
branch,
collection,
name,
"index.qmd",
sep = "/"
)
return(markdown_link(text, path))
}

insert_timestamp <- function(tzone = Sys.timezone()) {
time <- lubridate::now(tzone = tzone)
stamp <- as.character(time, tz = tzone, usetz = TRUE)
return(stamp)
}

insert_lockfile <- function(repo_spec, name,
collection = "posts",
branch = "main",
host = "https://github.com",
text = "R environment") {
path <- paste(
host,
repo_spec,
"tree",
branch,
collection,
name,
"renv.lock",
sep = "/"
)
return(markdown_link(text, path))
}



# top level function ------------------------------------------------------

insert_appendix <- function(repo_spec, name, collection = "posts") {
appendices <- paste(
markdown_appendix(
name = "Last updated",
content = insert_timestamp()
),
" ",
markdown_appendix(
name = "Details",
content = paste(
insert_source(repo_spec, name, collection),
insert_lockfile(repo_spec, name, collection),
sep = ", "
)
),
sep = "\n"
)
knitr::asis_output(appendices)
}
Binary file added posts/2023-07-24_rounding/rounding.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 40ab3bc

Please sign in to comment.