Skip to content

Instantly share code, notes, and snippets.

@neerajt
neerajt / inline_connectir.R
Last active September 8, 2016 19:53 — forked from czarrar/inline_connectir.R
Runs cluster correction on the output from MDMR analysis using connectir (http://github.com/czarrar/connectir). This can also convert ROI data to voxelwise data.
# This file will be called the `le_correcter.R` file shown below
# and both files must be in the same directory.
# This file contains the low-level functions to find the clusters
# as well as convert ROIs to voxelwise data.
suppressPackageStartupMessages(library(connectir))
suppressPackageStartupMessages(library(inline))
plugin_bigmemory <- function() {
l <- getPlugin("RcppArmadillo")

knitr

HRUG Meetup

Why Knitr

  • results need to be reproducible
  • Documentation of code
    • easier to read and understand later on to extend
  • Great for making reports as well
  • Sharing results leads to facilitating discussion
Entity State Ownership Customers (Count) Sales (Megawatthours) Revenues (Thousands Dollars) Average Price (cents/kWh)
Alaska Electric Light&Power Co AK Investor Owned 13,912 142,255 16,970.0 11.93
Alaska Power and Telephone Co AK Investor Owned 4,803 24,391 7,470.0 30.63
Alaska Village Elec Coop, Inc AK Cooperative 6,148 31,085 19,275.0 62.01
Anchorage Municipal Light and Power AK Municipal 24,443 146,789 17,221.2 11.73
Barrow Utils & Elec Coop, Inc AK Cooperative 1,471 11,511 1,364.0 11.85
Bethel Utilities Corp AK Investor Owned 1,671 10,677 5,990.0 56.10
Chugach Electric Assn Inc AK Cooperative 69,495 549,748 76,083.0 13.84
City & Borough of Sitka - (AK) AK Municipal 3,669 47,899 4,570.0 9.54
City of Petersburg - (AK) AK Municipal 1,354 20,803 2,010.2 9.66
from pandas import DataFrame, concat, merge
import Quandl
symbol_list = ["AMZN","GOOG", "MSFT"]
df = DataFrame(columns=['Effective Tax Rate', 'Earnings Before Interest and Taxes', 'symbol'])
for symbol in symbol_list:
effective_tax_parameter = "DMDRN/" + symbol + "_EFF_TAX"
require(Quandl)
symbolList <- c("AMZN","GOOG", "MSFT", "AAPL", "GLW", "HAL")
data <- data.frame("Date" = c(),
"Effective Tax Rate" = c(),
"Earnings Before Interest and Taxes" = c(),
"symbol" = c())
for(symbol in symbolList){