This file contains hidden or 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
# good coding practice #### | |
# 1. #hashtag your code so you know what it does | |
# 2. clear workspace and load packages at the top to keep track of what you have loaded | |
# 3. make sure your working directory is in the right place | |
# 4. space things out in a way that makes your code readable to you | |
# 5. google things you do not understand. The answers are out there, go find them | |
# 6. do not get scared/angry when you get errors. It does get easier.... eventually | |
# clear workspace #### Good code practice to do first | |
# need to install mise first! |
This file contains hidden or 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
# good coding practice #### | |
# 1. #hashtag your code so you know what it does | |
# 2. clear workspace and load packages at the top to keep track of what you have loaded | |
# 3. make sure your working directory is in the right place | |
# 4. space things out in a way that makes your code readable to you | |
# 5. google things you do not understand. The answers are out there, go find them | |
# 6. do not get scared/angry when you get errors. It does get easier.... eventually | |
# clear workspace #### Good code practice to do first | |
# need to install mise first! |
This file contains hidden or 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
# good coding practice #### | |
# 1. #hashtag your code so you know what it does | |
# 2. clear workspace and load packages at the top to keep track of what you have loaded | |
# 3. make sure your working directory is in the right place | |
# 4. space things out in a way that makes your code readable to you | |
# 5. google things you do not understand. The answers are out there, go find them | |
# 6. do not get scared/angry when you get errors. It does get easier.... eventually | |
# clear workspace #### Good code practice to do first | |
# need to install mise first! |
This file contains hidden or 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
# good coding practice #### | |
# 1. #hashtag your code so you know what it does | |
# 2. clear workspace and load packages at the top to keep track of what you have loaded | |
# 3. make sure your working directory is in the right place | |
# 4. space things out in a way that makes your code readable to you | |
# 5. google things you do not understand. The answers are out there, go find them | |
# 6. do not get scared/angry when you get errors. It does get easier.... eventually | |
# clear workspace #### Good code practice to do first | |
# need to install mise first! |
This file contains hidden or 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
# load packages | |
library(dplyr) | |
library(tidyr) | |
# proportion dead of 10 | |
prop = c(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1) | |
# create dummy data | |
d <- data.frame(tube = 1:10, prop = sample(prop, 10, replace = TRUE)) |
This file contains hidden or 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
# load in packages | |
library(nlsLoop) | |
library(dplyr) | |
library(tidyr) | |
# load up Chlorella data | |
data('Chlorella_TRC') | |
head(Chlorella_TRC) |
This file contains hidden or 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
# test slope against defined value other than 0 | |
# load packages | |
library(car) | |
library(ggplot2) | |
library(dplyr) | |
# create made up data | |
# set up gradient (grad) intercept (intercept) and standard deviation (sigma) | |
intercept = 10 |
This file contains hidden or 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
rm(list = ls()) | |
# Stan message board example | |
library(tidyverse) | |
library(magrittr) | |
library(rstan) | |
d <- data.frame(ln_rate = c(1,1.5,3,5), temp = c(4, 5, 6, 7), group = c(0,0,1,1)) | |
b <- data.frame(temp = c(4,4,4,5,5,5,5,5,6,6,6, 7,7,7,7,7)) %>% |
This file contains hidden or 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
# creating pretty plots from prcomp and vegan in R | |
# clear workspace | |
mise::mise(vars = TRUE, pkgs = TRUE, console = TRUE, figs = TRUE) | |
# can do multiple comparisons of adonis factors | |
# devtools::install_github('leffj/mctoolsr') | |
# load in packages | |
library(vegan) |
This file contains hidden or 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
# Footgolf scores | |
# packages | |
library(dplyr) | |
library(tidyr) | |
library(ggplot2) | |
library(ggjoy) | |
# Input data | |
footgolf <- data.frame(player = rep(c('George', 'Colin', 'Paddy', 'Silky'), each = 18), scores = c(4, 6, 4, 4, 5, 4, 2, 3, 5, 4, 4, 6, 3, 7, 5, 5, 5, 4, 3, 5, 5, 3, 3, 3, 3, 3, 6, 2, 4, 5, 3, 5, 4, 3, 5, 5, 4, 4, 5, 3, 3, 5, 4, 3, 4, 4, 5, 4, 3, 3, 4, 3, 7, 4, 4, 5, 5, 3, 2, 3, 4, 4, 6, 3, 4, 5, 3, 1, 5, 4, 3, 5), stringsAsFactors = FALSE) |