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
| # difference in Phil McNulty rating and public votes | |
| # https://www.bbc.co.uk/sport/football/44595146 | |
| library(tibble) | |
| library(ggplot2) | |
| library(tidyr) | |
| library(dplyr) | |
| player <- c('Jordan Pickford', 'Kieran Trippier', 'Harry Maguire', 'John Stones', 'Kyle Walker', 'Jordan Henderson', 'Ashley Young', 'Ruben Loftus-Cheek', 'Raheem Sterling', 'Jesse Lingard', 'Harry Kane') |
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(multidplyr) | |
| library(dplyr) | |
| library(tidyr) | |
| library(purrr) | |
| library(furrr) | |
| library(tibble) | |
| library(tictoc) | |
| # I want to know which gene a bunch of SNPs is in. This will show us how to give different inputs to a function and also parallelising. Hopefully. |
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
| # code problem | |
| # want to feed into a function to filter values of a dataframe based on values from a master dataframe | |
| # inspiration - rates of false positives for snps (mutations) in a gene are influenced by the threshold for proportion of expression in a population. For example, if 0.01 of the population has it, its less likely to be a SNP than if you're at 0.9. Where to set this threshold is unknown. | |
| # However, if you have the list of actual snps (from sequencing individual clones), you can look at different thresholds of variables to check which values give the least false positives and find the most true snps | |
| # load packages | |
| library(ggplot2) | |
| library(dplyr) | |
| library(tidyr) | |
| library(tibble) |
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 / install packages | |
| library(dplyr) | |
| library(tibble) | |
| # devtools::install_github('padpadpadpad/TeamPhytoplankton') | |
| # make dummy data | |
| temp = (5:30) + 273.15 | |
| rate = TeamPhytoplankton::boltzmann(15, 1, temp, Tc = 15, log = 'N') | |
| d <- tibble(rate, temp) |
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 ggplot2 | |
| library(ggplot2) | |
| # make data frame | |
| d <- tibble(x = rep(c('a', 'b', 'c'), each = 10), | |
| y = rnorm(30, mean = 10, sd = 1), | |
| group = rep(1:10, times = 3)) | |
| # create jitter position with seeding | |
| pos <- position_jitter(width = 0.1, height = 0, seed = 42) |
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
| --- | |
| title: "Non-linear bootstrapping approach 2.0" | |
| author: "Daniel Padfield" | |
| date: "15/03/2018" | |
| output: html_document | |
| --- | |
| ```{r setup, include=FALSE} | |
| knitr::opts_chunk$set(echo = 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
| # example | |
| # putting the SNP pos in the correct gene by its start and end position | |
| # load packages | |
| library(tibble) | |
| library(dplyr) | |
| library(tidyr) | |
| library(purrr) | |
| # dataframe of SNP positions and proportions |
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
| # cheeky late night bootstrapped mean | |
| # load packages | |
| library(broom) | |
| library(tidyr) | |
| library(purrr) | |
| library(modelr) | |
| library(dplyr) | |
| # load dataset |
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
| # smatr bootstrap example | |
| # load packages | |
| library(smatr) | |
| library(dplyr) | |
| library(purrr) | |
| library(tidyr) | |
| library(ggplot2) | |
| # load data |
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
| # example of trying to subset a matrix #### | |
| # So I am trying to do Mantel tests that require distance matrices | |
| # However I do not care about every pairwise distance in the matrix. instead I want to make some of the values of the distance NA to remove them | |
| # Struggling to work out how to subset a matrix | |
| # load packages | |
| library(tibble) | |
| library(dplyr) |