This file contains hidden or 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 post examines the features of [R Markdown](http://www.rstudio.org/docs/authoring/using_markdown) | |
| using [knitr](http://yihui.name/knitr/) in Rstudio 0.96. | |
| This combination of tools provides an exciting improvement in usability for | |
| [reproducible analysis](http://stats.stackexchange.com/a/15006/183). | |
| Specifically, this post | |
| (1) discusses getting started with R Markdown and `knitr` in Rstudio 0.96; | |
| (2) provides a basic example of producing console output and plots using R Markdown; | |
| (3) highlights several code chunk options such as caching and controlling how input and output is displayed; | |
| (4) demonstrates use of standard Markdown notation as well as the extended features of formulas and tables; and | |
| (5) discusses the implications of R Markdown. |
This file contains hidden or 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 document is just a test of RPubs platform for publishing R Markdown. I'll use the `survey` dataset from the `MASS` package to explore a few features. | |
| ```{r get_data, message=FALSE} | |
| library(MASS) | |
| library(psych) | |
| library(Hmisc) | |
| library(xtable) | |
| data(survey) | |
| ``` |
This file contains hidden or 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
| # tips on reading a Google Spreadsheet: | |
| # http://blog.revolution-computing.com/2009/09/how-to-use-a-google-spreadsheet-as-data-in-r.html | |
| # Data taken from:"https://spreadsheets.google.com/ccc?key=0AgdO92JOXxAOdDVlaUpkNlB2WERtV3l1ZVFYbzllQWc" | |
| # http://www.guardian.co.uk/news/datablog/2010/feb/11/winter-olympics-medals-by-country | |
| googleLink <- "http://spreadsheets.google.com/pub?key=tsddww6vOYePkhPSxRpDeYw&single=true&gid=1&output=csv" | |
| medals <- read.csv(googleLink, stringsAsFactors = FALSE) | |
| savePlot <- TRUE # optional variable used to save or not save plots in code | |
| # remove rows that do not contain data |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| ## Solve Every Sudoku Puzzle | |
| ## See http://norvig.com/sudoku.html | |
| ## Throughout this program we have: | |
| ## r is a row, e.g. 'A' | |
| ## c is a column, e.g. '3' | |
| ## s is a square, e.g. 'A3' | |
| ## d is a digit, e.g. '9' | |
| ## u is a unit, e.g. ['A1','B1','C1','D1','E1','F1','G1','H1','I1'] |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| __author__ = "Deepak.G.R." | |
| __license__ = 'Public Domain' | |
| """ | |
| usage: | |
| Go to command line and type | |
| python ai-class.py "topic-name" |
This file contains hidden or 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
| /* The API controller | |
| Exports 3 methods: | |
| * post - Creates a new thread | |
| * list - Returns a list of threads | |
| * show - Displays a thread and its posts | |
| */ | |
| var Thread = require('../models/thread.js'); | |
| var Post = require('../models/post.js'); |
This file contains hidden or 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
| #Newbie programmer | |
| def factorial(x): | |
| if x == 0: | |
| return 1 | |
| else: | |
| return x * factorial(x - 1) | |
| print factorial(6) | |
| #First year programmer, studied Pascal |