Setup and install the Linux subsystem
This command line looks much nicer than the default powershell.
hyper i hyper-dracula to install a new plugin. Don't run from bash.
| library(httr) | |
| usgsapi <- function () { | |
| API_URL <- 'https://m2m.cr.usgs.gov/api/api/json/stable/' | |
| ENDPOINTS <- list( | |
| login = paste0(API_URL, 'login'), | |
| permissions = paste0(API_URL, 'permissions'), | |
| scene_search = paste0(API_URL, 'scene-search') | |
| ) | |
| TOKEN <- NULL |
| print('hello world') |
| telemetry_dir <- here::here('data', 'telemetry') | |
| # simplest? | |
| files <- dir(telemetry_dir) | |
| grep_files <- files[!(is.na(stringr::str_extract(files, 'GSM\\d*.csv')))] | |
| df <- tibble::tibble() | |
| for(i in seq_along(grep_files)) { | |
| d <- readr::read_csv(file.path(telemetry_dir, grep_files[i])) |
| select distinct | |
| specimenid | |
| from health.labs | |
| where specimenid !~ '([[:alnum:]]+)(_|-)(\d+)(_|-)(\d+)'; |
| -- male classification | |
| SELECT | |
| tbl_survey_comp.event_key AS event_id, | |
| tbl_survey_comp.SPECIES, | |
| "alive" AS life_status, | |
| "adult" AS age_class, | |
| "male" AS sex, | |
| tbl_survey_comp.Male AS n, | |
| [YRLG_M]+[1pt]+[2pt]+[3pt]+[4pt]+[5pts+]+[6pts+]+[2_3yrs]+[4_5yrs]+[6yrs+] AS total_m, | |
| "{" & |
| install.packages(c('dplyr', 'spData', 'sf', 'raster', 'rgdal', 'rgeos', 'rcartocolor', 'magrittr', 'leaflet')) | |
| file_name <- 'http://naes.unr.edu/shoemaker/teaching/R-Bootcamp/data.zip' | |
| download.file(file_name, destfile = 'data.zip') | |
| unzip(zipfile = 'data.zip', exdir = '.') |
| import { makeExecutableSchema } from 'graphql-tools'; | |
| // data | |
| const posts = [ | |
| { id: 1, authorId: 1, title: 'Introduction to GraphQL', votes: 2 }, | |
| { id: 2, authorId: 2, title: 'Welcome to Apollo', votes: 3 }, | |
| { id: 3, authorId: 2, title: 'Advanced GraphQL', votes: 1 }, | |
| { id: 4, authorId: 3, title: 'Launchpad is Cool', votes: 7 }, | |
| { id: 5, authorId: 3, title: 'Apollo-Client, the Artemis to My Apollo Server', votes: 7 }, | |
| { id: 6, authorId: 1, title: 'Illuminate Errors with Apollo 2.0', votes: 7 }, |
| const getName = (person) => person.name | |
| const uppercase = (string) => string.toUpperCase() | |
| const getCharacters = (start, end) => (string) => string.substring(start, end) | |
| const reverse = (string) => string.split('').reverse().join('') | |
| const pipe = (...fns) => x => fns.reduce((v, f) => f(v), x) | |
| const newString = pipe( | |
| getName, | |
| uppercase, |
| dat <- readr::read_csv('sandbox/test-muld.csv') | |
| df <- dat %>% | |
| filter(ndowid == 915) | |
| mig_df <- df %>% | |
| filter(timestamp >= mdy('1/1/2014') & | |
| timestamp <= mdy('6/30/2014')) | |
| mig_df <- mig_df %>% |