if (!requireNamespace("piececor")) remotes::install_github('brshallo/piececor')
## Loading required namespace: piececor
library(dplyr)
set.seed(1234)
x <- seq(.01, 3*pi, pi/100)
y <- sin(x) + rnorm(length(x), sd = 0.25)
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
m = matrix(rnorm(100), 10) | |
rownames(m) = paste0("row", 1:10) | |
colnames(m) = paste0("column", 1:10) | |
ht = draw(Heatmap(m, name = "mat")) | |
highlight_row = function(which, padding = unit(1, "mm"), gp = gpar()) { | |
row_order = row_order(ht) | |
i = which(row_order == which) | |
nr = length(row_order) |
library(ggraph)
#> Loading required package: ggplot2
library(igraph)
#>
#> Attaching package: 'igraph'
#> The following objects are masked from 'package:stats':
#>
#> decompose, spectrum
#> The following object is masked from 'package:base':
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
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
# File src/library/stats/R/p.adjust.R | |
# Part of the R package, https://www.R-project.org | |
# | |
# Copyright (C) 1995-2018 The R Core Team | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# |
This gist is no longer going to be updated. Instead, check out the page at https://rmflight.github.io/rerrors/, or the GitHub project itself at https://rmflight.github.io/rerrors/
You don't need to do 'install.packages("tidyverse")' every time. Install is installing it on your system. You only need to do it again if you re-install R, or want a newer version. 'library()' loads it for use, and 'install.packages()' installs it to your computer.
Error in instal.packages("tidyverse") : could not find function "instal.packages
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
# borrowed from the Rocker setup at | |
# https://github.com/rocker-org/rocker-versioned/blob/3d62b38a1310/verse/Dockerfile#L50-L52 | |
wget -qO- "https://github.com/yihui/tinytex/raw/master/tools/install-unx.sh" | sh -s - --admin --no-path | |
sudo mv ~/.TinyTeX /opt/TinyTeX | |
sudo /opt/TinyTeX/bin/*/tlmgr path add | |
sudo tlmgr install metafont mfware inconsolata tex ae parskip listings | |
sudo tlmgr path add | |
Rscript -e "source('https://install-github.me/yihui/tinytex'); tinytex::r_texmf()" | |
sudo chown -R root:staff /opt/TinyTeX | |
sudo chmod -R g+w /opt/TinyTeX |
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
smaller_latex_table = function(kable_table, size = "tiny"){ | |
split_table = strsplit(kable_table, "\n", )[[1]] | |
centering_loc = grepl("centering", split_table) | |
top_table = split_table[seq(1, which(centering_loc))] | |
bottom_table = split_table[seq(which(centering_loc)+1, length(split_table))] | |
new_table = c(top_table, | |
paste0("\\", size), | |
bottom_table) | |
structure(new_table, format = "latex", class = "knitr_kable") | |
} |
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
# check status of lid for wakeup | |
# su | |
# echo "LID0" > /proc/acpi/wakeup | |
alias lid_status="cat /proc/acpi/wakeup | grep LID0" | |
lid_status |
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
# Copyright Robert M Flight, 2019 | |
# MIT Licensed. Use at your own risk, with no warranty. | |
#' extract raw method | |
#' | |
#' Given a Thermo ".raw" file, attempts to extract the "method" | |
#' definition from a translated hexdump of the file. | |
#' | |
#' @param in_file The Thermo raw file to extract | |
#' @param output_type string, data.frame or json | |
#' |
NewerOlder