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
| # data from data.gov | |
| # url title | |
| # http://www.data.gov/details/4055 Accident Injuries Data Set | |
| # http://www.data.gov/details/4134 Employment/Production Data Set - Yearly (Coal only) | |
| # http://www.data.gov/details/4135 Employment/Production Data Set - Quarterly (Coal only) | |
| # http://www.data.gov/details/4136 Mines Data Set | |
| # http://www.data.gov/details/4137 Mine Address of Record Data Set | |
| # http://www.data.gov/details/4138 Mine Inspections | |
| # http://www.data.gov/details/4139 Mine Inspections |
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
| percentify <- function(x, r=1, keep.zeros=FALSE, na.code=""){ | |
| ifelse (as.numeric(x) != 0 | keep.zeros==TRUE, paste( format(round ( as.numeric(x) * 100, r) , nsmall=r) , '%', sep='') | |
| , | |
| na.code) | |
| } | |
| # usage example: | |
| sapply(dataframe[3:5], percentify, 1) |
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
| channel <- odbcConnectExcel('../file name.xls', readOnly = TRUE) | |
| dat <- sqlQuery(channel, 'SELECT * FROM [workbook name$]', stringsAsFactors=FALSE) |
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
| os.system('pandoc -f markdown -t html cair_3.markdown -o out.html -S') | |
| Can be run as a SublimeText console command |
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
| <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
| <xsl:template match="text()"/> | |
| <xsl:template match="*|@*"> | |
| <xsl:value-of select=" | |
| string-join( | |
| distinct-values( | |
| (//*|//@*) | |
| /string-join( | |
| (ancestor::node()/name(), | |
| if (self::attribute()) |
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
| <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
| <xsd:annotation> | |
| <xsd:documentation xml:lang="en"> | |
| Purchase order schema for Example.com. | |
| Copyright 2000 Example.com. All rights reserved. | |
| </xsd:documentation> | |
| </xsd:annotation> | |
| <xsd:element name="comment" type="xsd:string"> | |
| <xsd:annotation> | |
| <xsd:documentation>doc for comment</xsd:documentation> |
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
| <xsl:stylesheet version="2.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
| xmlns:xsd="http://www.w3.org/2001/XMLSchema" | |
| > | |
| <xsl:template match="*|@*"> | |
| <xsl:value-of select=" | |
| string-join( | |
| distinct-values( | |
| (//*|//@*) | |
| /string-join( |
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
| <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsd="http://www.exchangenetwork.net/schema/ghg/1" > | |
| <xsl:template match="*|@*"> | |
| <xsl:value-of select=" | |
| string-join( | |
| (//*|//@*) | |
| /string-join( | |
| (ancestor::node()/ | |
| ( |
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
| apply(dat, 2, table) |
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
Show hidden characters
| { | |
| "cmd": ["pandoc.exe", "--to=html", "--output=$file.html", "$file"], | |
| "selector": "source.md" | |
| } |
OlderNewer