- Python 3
- Pip 3
$ brew install python3| collapse_rows <- function(df_g, col, lookleft = TRUE){ | |
| col_num <- grep(deparse(substitute(col)), colnames(df_g$`_data`)) | |
| collapse_style <- css(visibility = "hidden", | |
| border_top = "0px") | |
| test_rows <- function(x) ifelse(is.na(x == lag(x)), FALSE, x == lag(x)) | |
| if(col_num > 1 & lookleft) { | |
| col_left <- as.name(colnames(df_g$`_data`)[col_num - 1]) |
| #' Create cover images for talks from a folder of PDFs | |
| #' | |
| #' Requires imagemagick to be installed and in the path for the convert command | |
| #' @param pdf_dir Directory containing PDF files of papers | |
| #' @param img_dir Directory to output all the image files | |
| #' @param crop_height How big to make the cropped images, relative to full page | |
| #' @param fade_height How much of the image to fade to transparent at the bottom | |
| #' @param density resolution for PNG images | |
| #' | |
| create_covers = function(pdf_dir, img_dir, crop_height = .5, fade_height = .25, density = 300){ |
| ## Start with the code in https://github.com/kjhealy/lexis_surface/blob/master/lexis.r | |
| ## At the bottom, the `fra_surface` object is done in 3D with the `plotly` library. We can | |
| ## also do it with `rayshade`: | |
| library(rayshader) | |
| ## rayshade wants the axes a little differently from plotly | |
| ## but like plotly it wants a matrix. | |
| fra_surf <- fra_surf[c(1:201),c(100:1)] |
| #!/bin/bash | |
| TODAY=`date +%Y-%m-%d` | |
| TODAY_MD=`date +%B\ %d,\ %Y` | |
| YEAR=`date +%Y` | |
| PACKAGENAME=$1 | |
| ## | |
| ## CHANGE ME!!! |
| shrugp <- function(p) { | |
| out <- symnum(p, cutpoints = c(0, 0.001, 0.01, 0.05, 0.10, 1.00), | |
| symbols = c("(ツ)", "¯\\(ツ)/¯", "¯\\_(ツ)_/¯", "¯\\___(ツ)___/¯", "¯\\____(ツ)____/¯")) | |
| as.character(out) | |
| } | |
| pvals <- c(0.09, 0.03, 0.002, 0.000001) | |
| shrugp(pvals) | |
| ## [1] "¯\\___(ツ)___/¯" "¯\\_(ツ)_/¯" "¯\\(ツ)/¯" "(ツ)" |
| Book | Original chapter | Modern reference | |
|---|---|---|---|
| 1 Nephi | I | 1–5 | |
| II | 6–9 | ||
| III | 10–14 | ||
| IV | 15 | ||
| V | 16–19:21 | ||
| VI | 19:22–21 | ||
| VII | 22 | ||
| 2 Nephi | I | 1–2 | |
| II | 3 |
| #' Function is also in this package: https://github.com/rubenarslan/formr | |
| #' It's easy to attach packages that overwrite functions from other packages. Especially dplyr has a lot of conflicts | |
| #' with base packages, MASS and plyr. Because some of these conflicts do not always lead to error messages, sometimes | |
| #' just incorrect behaviour, this function exists. Don't trust your faulty memory, just check whether dplyr's (or any other | |
| #' package's) functions are 'on top' if you so desire. | |
| #' | |
| #' @param fix defaults to true. Detaches the desired package (without unloading) and loads it again. Won't work for base packages and can't overwrite functions that you defined yourself. | |
| #' @param package the package you want to be on top (loaded last), defaults to dplyr | |
| #' @param iteration for internal use only, if set to 0 the function will call itself to check that it worked, if set to 1, it won't. | |
| #' @export |
| #cloud-config | |
| # In order to access RStudio server via the web interface, you must log on with | |
| # a user account that allows password access. This script does not add that user | |
| # by default. You may either ssh as root into the server and `adduser` as | |
| # normal, or script a user addition here: | |
| # users: | |
| # - name: # username # | |
| # lock-passwd: false # allow login with password |
| #=================================================== | |
| # Demo multi-function roxygen2 - three ways to do it | |
| #=================================================== | |
| # This shows how things do work, including wierd corner cases, not | |
| # how they should be done. Most of the information comes from | |
| # http://r-pkgs.had.co.nz/man.html | |
| #==================================================== | |
| # Demo multi-function roxygen2 page using @describeIn |