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
func downloadFile(filepath string, url string) (err error) { | |
// Create the file | |
out, err := os.Create(filepath) | |
if err != nil { | |
return err | |
} | |
defer out.Close() | |
// Get the data |
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
## Create a model blueprint, using a consistent API across modeling platforms. | |
```{r} | |
blueprint <- make_blueprint("nonmem") | |
``` | |
```{r} | |
one_cmt <- blueprint %>% | |
ode_model(cmt = 1, depot = 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
func TestCreateDatabase(t *testing.T) { | |
tmpFile, err := ioutil.TempFile(os.TempDir(), "cayley_test") | |
if err != nil { | |
t.Fatalf("Could not create working directory: %v", err) | |
} | |
t.Log(tmpFile) | |
err = createNewBolt(tmpFile.Name(), nil) | |
if err != nil { |
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(future) | |
library(PKPDmisc) | |
huge_df <- map_df(1:100000, ~ Theoph %>% mutate(REP = .x)) | |
pryr::object_size(huge_df) | |
parallelization_benchmark <- lapply(seq(2, 64, 2), function(ncore) { |
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
[details] | |
name = "vancomycin" | |
description = "vancomycin model in neonates" | |
version = "0.0.1" | |
keywords = [ | |
"vancomycin", | |
"neonates", | |
"pediatrics" | |
] | |
language = "R" |
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
using DifferentialEquations | |
using ParameterizedFunctions | |
using DataFrames | |
type OneCmtOral{T} <: DEDataArray{T} | |
x::Array{T,1} | |
KA::T | |
CL::T | |
V::T |
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
if n == 0 && i == "~" { | |
if runtime.GOOS == "windows" { | |
i = os.Getenv("USERPROFILE") | |
} else { | |
i = os.Getenv("HOME") | |
} | |
} | |
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
Reproducible example: | |
code: | |
``` | |
library(tidyverse) | |
df <- tibble::data_frame(ID = rep(c("A", "B"), each = 5), TIME = hms::hms(hours = 1:10), | |
some_na = c(1, NA, 3:10)) |
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 https://github.com/common-nighthawk/vim/blob/master/.tmux.conf | |
unbind C-b | |
set -g prefix C-a | |
# TRYING THINGS FROM BOOK | |
setw -g mode-keys vi | |
bind -t vi-copy 'v' begin-selection | |
bind -t vi-copy 'y' copy-selection | |
set-option -g default-command "reattach-to-user-namespace -l fish" | |
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy" \; display "Copied to system from tmux clipboard" |
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(stringr) | |
library(tibble) | |
library(tidyverse) | |
# subdirectories in rundir_001 each contain a fort.50 file that should be read in, thinned, and saved to satchel with additional | |
# information about the run appended to each chain's output | |
dirs <- list.dirs("../modeling/rundir_001/", recursive = F) | |
# match runs such as run008c1_est_01 as chain runs correspond to run<x>c<y> |