View example_query.R
This file contains 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
query <- "SELECT uid, | |
timestamp, | |
sensor_1 | |
FROM database_name.long_table_name_here | |
WHERE ( ( uid = 'abxyz1230' | |
AND filter_id = '1' | |
AND timestamp >= '2018-07-23' | |
AND timestamp <= '2018-08-02' ) | |
OR ( uid = 'abxyz1236' | |
AND filter_id = '1' |
View cluster_multi_future.R
This file contains 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
library(analogsea) | |
library(tidyverse) | |
library(furrr) | |
cluster_tag <- 'r_cluster' | |
cluster_prefix <- 'node-' | |
number_of_nodes <- 2 | |
# Path to private SSH key that matches key uploaded to DigitalOcean | |
# it looks like ~ does not work here... not sure why | |
ssh_private_key_file <- "/Users/jal/.ssh/id_rsa" |
View do_furr.R
This file contains 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
# 1. set up digital ocean account | |
# 2. configure ssh keys, upload public key to DO | |
# 3. get API key | |
# 4. set Sys.setenv(DO_PAT = "API_KEY_GOES_HERE") in ~/.Rprofile | |
#devtools::install_github("sckott/analogsea") | |
library(analogsea) | |
library(tidyverse) |
View web_example.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 1 column, instead of 3. in line 2.
This file contains 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
# 2018 Barkley Marathons lap 1 finish time | |
# source: http://www.mattmahoney.net/barkley/ | |
Name,Location,Time | |
Gary Robbins,CAN,8:38:08 | |
Allie Beaven,SCO,8:38:09 | |
Guillaume Calmettes,CA,8:38:10 | |
Jamil Coury,AZ,8:58:55 | |
Benoit Laval,FRA,9:07:15 | |
Valery Caussarieu,FRA,9:07:20 | |
Jodi Isenor,CAN,9:23:31 |
View Python_R_together.Rmd
This file contains 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: "Markdown Y'All" | |
author: "James Long" | |
date: "March 27, 2018" | |
output: | |
html_document: default | |
pdf_document: default | |
word_document: default | |
--- |
View r_commented_example.r
This file contains 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
require(tictoc) | |
tic() | |
# create a 250 col x 80000 row matrix of random uniform (0,1) numbers | |
random_numbers <- matrix( runif(250 * 80000), ncol=250) | |
#square root of the random numbers | |
sqrt_random_numbers <- sqrt(random_numbers) |
View no_ns.json
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<medals> | |
<medals_by_country> | |
<medal_info country="Slovenia" country_code="SLO" ioc_code="SLO" total_ranking="1" gold_ranking="1" total="24" gold="14" silver="3" bronze="7"/> | |
<medal_info country="Canada" country_code="CAN" ioc_code="CAN" total_ranking="2" gold_ranking="1" total="17" gold="9" silver="5" bronze="3"/> | |
<medal_info country="Germany" country_code="GER" ioc_code="GER" total_ranking="3" gold_ranking="1" total="19" gold="8" silver="6" bronze="5"/> | |
<medal_info country="USA" country_code="USA" ioc_code="USA" total_ranking="4" gold_ranking="1" total="17" gold="5" silver="8" bronze="4"/> | |
<medal_info country="Russia" country_code="RUS" ioc_code="RUS" total_ranking="5" gold_ranking="1" total="19" gold="5" silver="7" bronze="7"/> | |
<medal_info country="Ireland" country_code="IRL" ioc_code="IRL" total_ranking="6" gold_ranking="1" total="20" gold="5" silver="6" bronze="9"/> | |
<medal_info country="Japan" country_code="JPN" ioc_code="JPN" total_rank |
View example.json
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<medals xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.sportradar.com/sportsapi/v1/winterolympics" generated_at="2017-12-03T12:23:38+01:00" xsi:schemaLocation="http://schemas.sportradar.com/sportsapi/v1/winterolympics http://schemas.sportradar.com/bsa/winterolympics/v1/xml/endpoints/winterolympics/medals.xsd"> | |
<medals_by_country> | |
<medal_info country="Slovenia" country_code="SLO" ioc_code="SLO" total_ranking="1" gold_ranking="1" total="24" gold="14" silver="3" bronze="7"/> | |
<medal_info country="Canada" country_code="CAN" ioc_code="CAN" total_ranking="2" gold_ranking="1" total="17" gold="9" silver="5" bronze="3"/> | |
<medal_info country="Germany" country_code="GER" ioc_code="GER" total_ranking="3" gold_ranking="1" total="19" gold="8" silver="6" bronze="5"/> | |
<medal_info country="USA" country_code="USA" ioc_code="USA" total_ranking="4" gold_ranking="1" total="17" gold="5" silver="8" bronze="4"/> | |
<medal_info country="Russia" coun |
View example.csv
This file contains 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
header1 | header2 | |
---|---|---|
1 | 2 | |
3 | 4 | |
5 | 6 |
View r tag stackoverflow.r
This file contains 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
# query run here: https://data.stackexchange.com/stackoverflow/query/edit/543286 | |
# | |
# select | |
# TagName, | |
# str(DATEPART(yyyy, p.CreationDate )) + '-' + str(DATEPART(mm, p.CreationDate )) as postmonth, | |
# count(pt.PostId) as Num | |
# from |
NewerOlder