http://dcmetrometrics.com/data
This data is released under the ODC Open Database License (ODbL) v1.0. http://opendatacommons.org/licenses/odbl/summary/
Contact: Lee Mendelowitz Lee.Mendelowitz@gmail.com
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Playing with Enter and Update</title> | |
| <script src="http://d3js.org/d3.v3.min.js"></script> | |
| <style> | |
| p { | |
| color: black; | |
| } |
| class wrap_file_function(object): | |
| """ | |
| Wrap a function which takes a file or a str as it's first argument. | |
| If a str is provided, replace the first argument of the wrapped function | |
| with a file handle, and close the file afterwards | |
| Example: | |
| @wrap_file_function('w') | |
| def write_hi(f): |
| # Make a dataset where Y is cubic in X, plus noise: | |
| n <- 1000 | |
| x <- runif(n) | |
| x <- sort(x) | |
| eps <- rnorm(n) | |
| beta <- c(1, 2, 3) | |
| X <- poly(x, 3, raw = TRUE) | |
| y <- X %*% beta + eps | |
| # Fit the data |
| # The question: why does make.plot.1 cause an error? | |
| # make.plot.2 and make.plot.3 work ok. | |
| # | |
| # I'm trying to use ggplot to make a scatter plot with | |
| # with size mapped to the "s" variable in the dataframe. | |
| # When I try to draw circles on top of the scatter plot using geom_path, I get | |
| # errors. | |
| # The plot works if I choose to not map size or not to draw the circles. | |
http://dcmetrometrics.com/data
This data is released under the ODC Open Database License (ODbL) v1.0. http://opendatacommons.org/licenses/odbl/summary/
Contact: Lee Mendelowitz Lee.Mendelowitz@gmail.com
To run, download PhantomJS
From the terminal:
phantomjs snapshot.js > output.html
| \documentclass[12pt]{article} | |
| \usepackage[sc]{mathpazo} | |
| \usepackage[T1]{fontenc} | |
| \usepackage{amsmath} | |
| \usepackage[top=1in, bottom=1in, left=1.5in, right = 1.5in, marginparwidth=0.0in, marginparsep=0.25in]{geometry} | |
| % \geometry{verbose,tmargin=0.75in,bmargin=0.75in,lmargin=0.75in,rmargin=0.75in} %Commented out in favor of the marginnote settings | |
| \setcounter{secnumdepth}{2} |
| ############################################################ | |
| # Time a call. Execution time is printed. Return the value of wrapped call | |
| time.call <- function(expr) { | |
| start.time <- proc.time() | |
| ret = evalq(expr) | |
| end.time <- proc.time() | |
| print(end.time - start.time) | |
| ret |