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
% University of South Florida College of Engineering Beamer Template | |
% Garrick Aden-Buie | |
% Send comments/beers to: [email protected] | |
% Example presentation: | |
% http://garrickadenbuie.com/wp-content/uploads/2013/09/usf-beamer-example.pdf | |
% IMPORTANT: | |
% If you want to use the USF logo, make sure you | |
% download the USF College of Engineering logo 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) | |
# s(k) = s(0) + b*p(k-1) | |
# d(k) = d(0) - a*p(k) | |
# p(k) = -b/a*p(k-1) + (d0-s0)/a | |
cobweb = function(params){ | |
# Create data frame of prices, and supply and demand stocks | |
s0 = params[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
#!/bin/bash | |
# Requires: pandoc -- http://johnmacfarlane.net/pandoc/ | |
# Usage: ./md2beamer.sh Content.md ==> Content.pdf (beamer presentation) | |
name=`echo $1 | cut -f1 -d'.'` | |
pandoc $1 -o $name.pdf -t beamer --template=usf_simple.beamer --latex-engine=xelatex --highlight-style=tango |
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
# T.room # Temperature of the room | |
# T.coffee # Initial temperature of the coffee | |
# T.cream # Temperature of the cream | |
# k # Cooling rate constant | |
# T.d # Desired coffee temperature | |
temp <- function(T.init, T.room, k, x){ | |
# Newton's cooling law temperature function | |
return(T.room + (T.init - T.room)*exp(-k*x)) | |
} |
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
getCiteCounts <- function(citekeys, bibtex){ | |
## This function takes a list of citation keys, for ex. from lit review notes | |
## and a master bibtex file with citekeys and DOIs | |
## Returns a vector of number of times each article was cited from CrossRef | |
# Check for and load/install required packages | |
# --> stringr, rcrossref | |
if (!'stringr' %in% installed.packages()) install.packages('stringr') | |
require(stringr, quietly=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
library(shiny) | |
library(datasets) | |
Logged = FALSE; | |
PASSWORD <- data.frame(Brukernavn = "withr", Passord = "25d55ad283aa400af464c76d713c07ad") | |
# Define server logic required to summarize and view the selected dataset | |
shinyServer(function(input, output) { | |
source("www/Login.R", local = TRUE) | |
observe({ |
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
warning("You probably don't want to use this `backstitch()` function.", | |
"\n It's hacky and there's a much better option in knitr called `purl()`.", | |
"\n More info at: `?knitr::purl`") | |
#' Backstitch an Rmd file to an R script | |
#' | |
#' Takes an Rmd file -- that would be converted with knitr::knit() -- and | |
#' "backstitches" it into an R script suitable for knitr::purl(). The output | |
#' file is the just the backstitched R script when `output_type = 'script'`, or | |
#' just the code chunks when `output_type = 'code'` (note that all inline code |
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
reprex::reprex({ | |
library(purrr) | |
l1 <- list(a = list(a1 = 1:10)) | |
l2 <- list(a = list(a2 = 10:20)) | |
list_merge(l1, l2) | |
#' But both `l1` and `l2` are named... so arguments should be named? | |
list_merge(x = l1, y = l2) | |
#' Oh, l2 is implicitly unnamed because it's in dots | |
list_merge(l1, y = l2) | |
#' But what I *really* wanted was this |
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
reprex::reprex({ | |
library(purrr) | |
l1 <- list(a = list(a1 = 1:10)) | |
l2 <- list(a = list(a2 = 10:20)) | |
list_merge(l1, l2) | |
#' But both `l1` and `l2` are named... so arguments should be named? | |
list_merge(x = l1, y = l2) | |
#' Oh, l2 is implicitly unnamed because it's in dots | |
list_merge(l1, y = l2) | |
#' But what I *really* wanted was this |
OlderNewer