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
{ | |
"default_extend_env":{"PATH":"{PATH};C:\\Users\\user_name\\Documents\\R\\R-2.14.1\\bin\\x64"} | |
} |
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
# 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
// Characters that are considered to separate words – does not include periods. | |
// Place comma at the end of the line if there are multiple keybindings. | |
{"word_separators": "/\\()\"‘-:,;~!@#$%^&*|+=[]{}`~?"} |
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
<?php | |
$q=$_GET['q']; | |
$con = mysql_connect('mysql.tomschenkjr.net', 'tsjr_visitor', 'tsjr_visitor_password'); | |
if(!$con){ | |
die('Could not connect: ' . mysql_error()); | |
} | |
mysql_select_db("tsjr_sandy", $con); |
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
# LOAD UP GGPLOT2 | |
library(ggplot2) | |
# PROPER TIME SERIES DATA | |
str(economics) # Explore the economics data set that comes with ggplot2. | |
# PLOT THE RELATIONSHIP OF UNEMPLOYMENT AND TIME | |
p <- ggplot(economics, aes(x = date, y = unemploy)) | |
p + geom_line() |
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
# Let's customize our plot outputs. First, load the library. | |
library(ggplot2) | |
# Plot something simple | |
p <- ggplot(mtcars, aes(x=cyl, y=mpg)) + geom_point(aes(color=qsec, size=wt)) | |
# Change axis | |
p + scale_y_continuous(limits=c(0,40)) |
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