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
Show hidden characters
[ | |
// Modified Sublime-REPL keybindings for an "R-friendly" set of shortcuts. | |
// Copy and paste this text into the Key Bindings - User (under Preferences menu). | |
// For more information, see http://tomschenkjr.net/2012/05/17/using-sublime-text-2-for-r/ | |
// Executes a selection of text in REPL, latter only displays code and does not execute | |
{ "keys": ["ctrl+shift+r"], "command": "repl_transfer_current", "args": {"scope": "selection"}}, | |
{ "keys": ["ctrl+shift+r", "r"], "command": "repl_transfer_current", "args": {"scope": "selection", "action":"view_write"}}, | |
// Executes the entire file (build) in REPL, latter only displays code and does not execute |
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
// Purpose: This is a macro which will send a selection of text to sublimeREPL. | |
// Note: Add this to your macros, which can be accessed from Tools > Macros or saving to your Sublime Text Packages folder. | |
[ | |
{"command": "repl_transfer_current", "args": {"scope": "selection"}} | |
{"command": "move", "args": {"by": "lines", "forward": true}} | |
] |
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(devtools) | |
install_github("Chicago/RSocrata" ref = "issue124") # RSocrata 1.7.2-7 or above | |
library(RSocrata) | |
#' Exports CSVs from Socrata data portals | |
#' | |
#' Input the URL of a data portal (e.g., "data.cityofchicago.org") and | |
#' will download all CSV files (no other files supported) and saved in | |
#' a single directory named after the root URL (e.g., "data.cityofchicago.org/"). | |
#' Downloaded files are compressed to GZip format and timestamped so the download |
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: ggplot2 Workshop Homework for Maps | |
# AUTHOR: Tom Schenk Jr. | |
# DATE CREATED: November 7, 2012 | |
# DATE MODIFIED: None | |
# PURPOSE: Create maps using R and ggplot2 library. | |
# LIBRARIES: ggplot2, maptools | |
library(ggplot2) | |
library(maptools) |
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
# This is a conceptual study to leverage the tidyverse syntax and lazy | |
# evaluation concepts (influenced by sparklyr) to approach API wrapper packages. | |
# | |
# Problem statement: API wrappers often require users to download *all* data | |
# to manipulate and filter the information. Some packages support custom | |
# queries but often complicate syntax by adding many parameters within the | |
# function that may be hard for data scientists to formulate. | |
# | |
# Potential solution: API queries can be separated into three principal parts. | |
# First, to query the API metadata to understand column names and data types. |
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: R in Sublime Text 2 Demonstration | |
# AUTHOR: Tom Schenk Jr. | |
# DATE: May 15, 2012 | |
# R as a calculator | |
2 + 2 # After you adjust the keybindings | |
sqrt(9) # Syntax should differentiate between function and variable. | |
sin(pi) # See if there is a floating point issue. | |
# Install Packages |
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
Public Function BASE64SHA1(ByVal sTextToHash As String) | |
Dim asc As Object | |
Dim enc As Object | |
Dim TextToHash() As Byte | |
Dim SharedSecretKey() As Byte | |
Dim bytes() As Byte | |
Const cutoff As Integer = 5 | |
Set asc = CreateObject("System.Text.UTF8Encoding") |
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
# Install reshape package. You will be asked to pick a server. | |
install.packages("reshape") | |
# We're going to also use ggplot2, so let's install that as well: | |
install.packages(c("reshape","ggplot2")) # In R, c() concatenates inputs as a vector | |
# You will always need to load the libraries after installing the package. | |
library(reshape) | |
library(ggplot2) |
OlderNewer