This file contains 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
// @ts-check | |
(() => { | |
const key = 'toc-position'; | |
let timeout = 0; | |
/** @type {{ scrollTop: number, details: boolean[] }} */ |
This file contains 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
#---------------------------------------------------------------- | |
# convert an excel range (obtained from a spreadsheet function | |
# or the COM/scripting API) into a data frame, optionally with | |
# headers in the first row. | |
#---------------------------------------------------------------- | |
range2dataframe <- function(x, headers=F){ | |
# remove headers from data if necessary | |
data <- if(headers) x[-1,] else x; |
This file contains 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 is a library for storing arbitrary R objects in Excel workbook files. | |
# It requires the "XML" library -- install that from the shell using | |
# | |
# > install.packages( "XML" ) | |
# | |
# selecting a CRAN mirror if necessary. | |
# | |
# Modern Excel files (meaning xlsx, xlsm and xlsb, but NOT xls) can include |
This file contains 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
# | |
# fit a polynomial. pass a range of x (independent), | |
# y (dependent), and degree. | |
# | |
# returns a row vector by default, but pass False as | |
# the last parameter and it will return a column vector. | |
# | |
fit.poly <- function( x, y, degree, as.row=T ){ |
This file contains 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
@import url(https://fonts.googleapis.com/css?family=Fira+Mono:400,700); | |
@import url(https://fonts.googleapis.com/css?family=Fira+Sans:400,300,300italic,400italic,500,500italic,700,700italic); | |
html, body, input[type=text] { | |
font: 11pt 'Fira Sans' !important; | |
} | |
pre { | |
font: 11pt 'Fira Mono' !important; |