:= lets you assign variables as part of larger expressions.
Example:
| require(tidyverse) | |
| # computes things you want to know across the entire trial | |
| do_it <- function(x) { | |
| name <- x$filename[1] | |
| fish_name <- name %>% stringr::str_match(pattern = "_S[a-z]+?_([A-Za-z]+)_") %>% as.vector %>% .[2] | |
| temp <- x %>% | |
| mutate(time_zone = lead(time) - time) %>% | |
| group_by(code) %>% |
| # edited from https://github.com/aschinchon/travelling-salesman-portrait/blob/master/frankenstein_TSP.R | |
| library(imager) | |
| library(dplyr) | |
| library(ggplot2) | |
| library(scales) | |
| library(TSP) | |
| urlfile <- "https://www.dropbox.com/s/4td7zbqohyw0f3g/creepy.jpg?dl=0" |
| library(tidyverse) | |
| ## testing overall incidence of intransitivity | |
| # number of intransitive fish in each experiment per the results | |
| intransitive <- c(9, 6, 6) | |
| # total number of fish in each experiment | |
| total <- c(10, 11, 23) + intransitive |
| import requests | |
| import pandas as pd | |
| import altair as alt | |
| from typing import List, Tuple | |
| def download_comments(repo: str, user: str) -> List[str]: | |
| url = f"https://api.github.com/repos/{user}/{repo}/issues/comments" | |
| res = requests.get(url) | |
| if res.ok: |