duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
| # Check URLs in a document | |
| ## This code will extract URLs from a text document using regex, | |
| ## then execute an HTTP HEAD request on each and report whether | |
| ## the request failed, whether a redirect occurred, etc. It might | |
| ## be useful for cleaning up linkrot. | |
| if (!require("httr")) { | |
| install.packages("httr", repos = "http://cran.rstudio.com/") | |
| } |
| library(ggplot2) | |
| library(shiny) | |
| # Call ggbrush with a ggplot2 object, and the dimensions which | |
| # should be brushed (try "xy" for scatter, "x" for histogram). | |
| # The plot will show in RStudio Viewer or your web browser, and | |
| # any observations selected by the user will be returned. | |
| ggbrush <- function(plotExpr, direction = c("xy", "x", "y")) { | |
| # See below for definition of dialogPage function |
| """ | |
| preprocess-twitter.py | |
| python preprocess-twitter.py "Some random text with #hashtags, @mentions and http://t.co/kdjfkdjf (links). :)" | |
| Script for preprocessing tweets by Romain Paulus | |
| with small modifications by Jeffrey Pennington | |
| with translation to Python by Motoki Wu | |
| Translation of Ruby script to create features for GloVe vectors for Twitter data. |
| # -*- coding: utf-8 -*- | |
| """ | |
| given a word and visualize near words | |
| original source code is https://github.com/nishio/mycorpus/blob/master/vis.py | |
| """ | |
| import word2vec_boostpython as w2v | |
| from sklearn.decomposition import PCA | |
| import matplotlib.pyplot as plt | |
| import matplotlib.font_manager |
I think the two most important messages that people can get from a short course are:
a) the material is important and worthwhile to learn (even if it's challenging), and b) it's possible to learn it!
For those reasons, I usually start by diving as quickly as possible into visualisation. I think it's a bad idea to start by explicitly teaching programming concepts (like data structures), because the pay off isn't obvious. If you start with visualisation, the pay off is really obvious and people are more motivated to push past any initial teething problems. In stat405, I used to start with some very basic templates that got people up and running with scatterplots and histograms - they wouldn't necessary understand the code, but they'd know which bits could be varied for different effects.
Apart from visualisation, I think the two most important topics to cover are tidy data (i.e. http://www.jstatsoft.org/v59/i10/ + tidyr) and data manipulation (dplyr). These are both important for when people go off and apply
2017-08-03: Since I wrote this in 2014, the universe, specifically Kirill Müller (https://github.com/krlmlr), has provided better solutions to this problem. I now recommend that you use one of these two packages:
I love these packages so much I wrote an ode to here.
I use these packages now instead of what I describe below. I'll leave this gist up for historical interest. 😆