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
| #' Reload .Rprofile | |
| #' | |
| #' Re-run the .Rprofile file | |
| #' | |
| #' @interactive | |
| #' @shortcut Ctrl + Shift + P | |
| function(){ | |
| source(".Rprofile") | |
| cat("Reloading .Rprofile\n") | |
| } |
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
| # Define a character to act as seperator between the two variables to be used | |
| hb_sep <- function(x=NULL){ | |
| if(is.null(x)){ | |
| getOption("hb_sep") | |
| } else { | |
| options(hb_sep = x) | |
| } | |
| } | |
| # Combines the hue & brightness |
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
| # This function will calculate whether a vector is prime. It is not completely efficient, but it's not too bad | |
| isPrime <- function(n){ | |
| # Check inputs are integers, and coerce | |
| if(any(n %% 1 >0)) stop("Input must be all integers") | |
| n2 <- as.integer(n) | |
| # Create default output | |
| out <- rep(NA,length(n2)) | |
| # Check for already discovered primes & return early if possible |
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
| import itertools | |
| from dataclasses import dataclass | |
| from typing import Tuple | |
| import numpy as np | |
| from diptest import diptest | |
| MEAN = 18.75 | |
| STDDEV = 5.647 |
OlderNewer