Skip to content

Instantly share code, notes, and snippets.

View technocrat's full-sized avatar

Richard Careaga technocrat

  • Woodinville, WA, USA
  • 16:02 (UTC -12:00)
View GitHub Profile
@technocrat
technocrat / 2023-01-21test.tex
Created January 21, 2023 08:14
Rmd output to tex
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
ignorenonframetext,
]{beamer}
\usepackage{pgfpages}
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{caption label separator}{: }
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 123 columns, instead of 33. in line 4.
ID,,CNI1,,CNI2,,CNI3,,CNI4,,CNI5,,CNI6,,CNI7,,CNI8,,CNI9,,CNI10,,CNI11,,CNI12,,CNI13,,CNI14,,CNI15,,CNI16,,ICU1,,ICU2,,ICU3,,ICU4,,ICU5,,ICU6,,ICU7,,ICU8,,ICU9,,ICU10,,ICU11,,ICU12,,ICU13,,ICU14,,ICU15,,ICU16,,ICU17,,ICU18,,ICU19,,ICU20,,ICU21,,ICU22,,ICU23,,ICU24,,BES1,,BES2,,BES3,,BES4,,BES5,,BES6,,BES7,,BES8,,BES9,,BES10,,BES11,,BES12,,BES13,,BES14,,BES15,,BES16,,BES17,,BES18,,BES19,,BES20,,
117099,,1,,4,,2,,4,,7,,2,,5,,5,,4,,7,,2,,2,,3,,6,,4,,4,,2,,2,,2,,1,,2,,1,,1,,4,,1,,2,,1,,3,,2,,1,,2,,3,,4,,2,,1,,1,,1,,2,,3,,3,,5,,3,,1,,5,,5,,4,,4,,3,,1,,1,,1,,2,,1,,1,,5,,1,,4,,5,,5,,5,,
ID117088,,2,,5,,7,,1,,4,,4,,2,,4,,5,,2,,4,,3,,2,,2,,4,,3,,1,,3,,2,,1,,3,,4,,1,,3,,2,,1,,1,,3,,2,,1,,2,,2,,3,,1,,1,,1,,1,,4,,2,,3,,3,,3,,1,,5,,2,,5,,3,,5,,1,,1,,5,,1,,4,,1,,5,,2,,1,,3,,5,,5,,
ID117080,,5,,1,,6,,5,,6,,2,,1,,3,,1,,6,,1,,2,,5,,1,,6,,1,,1,,2,,3,,1,,2,,4,,1,,3,,1,,2,,1,,2,,2,,1,,3,,2,,3,,2,,1,,1,,1,,4,,3,,3,,5,,1,,2,,5,,2,,3,,1,,3,,3,,3,,4,,4,,2,,1,,4,,2,,4,,5,,3,,3,,
I0117098,,4,,4,,3,,6,,7,,4,,3,,6,,6,,7,,1,,5,,5,,5,,7,,
@technocrat
technocrat / input2023-01-19.csv
Created January 19, 2023 08:53
data for reprex
Date Note.Jour Obs.max Stress Sommeil Activite Glissante.10J Glissante.20J Evolution Stress.10J Sommeil.10J Activite.10J Variation.10J
01/01/2022 75 0 2 7,1 17343 NA NA 75 NA NA NA NA
02/01/2022 78 0 4 7,67 10494 NA NA 765 NA NA NA NA
03/01/2022 65 0 6 6,45 9349 NA NA 7266666667 NA NA NA NA
04/01/2022 67 0 4 9,83 6201 NA NA 7125 NA NA NA NA
05/01/2022 77 0 6 7,5 6294 NA NA 724 NA NA NA NA
06/01/2022 7 0 3 8,33 7092 NA NA 72 NA NA NA NA
07/01/2022 72 0 2 6,32 8653 NA NA 72 NA NA NA NA
08/01/2022 83 0 4 9,33 16374 NA NA 73375 NA NA NA NA
09/01/2022 66 0 1 8,17 15055 NA NA 7255555556 NA NA NA NA
@technocrat
technocrat / chrome.md
Created October 1, 2022 08:17
R/RStudio on Chromebook
@technocrat
technocrat / redux.tex
Created August 16, 2022 03:34
Format guide for resume
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This document is based on a template available at
% http://www.LaTeXTemplates.com
%
% Original author:
% Trey Hunner (http://www.treyhunner.com/)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{resume}
@technocrat
technocrat / make_numeric.html
Created July 4, 2022 07:14
Convert a character vector to numeric, using order of magnitude suffixes, such as 1K
``` r
input <- c("1","3.14","1,000","1K","1k","1,000K","1m","1mm","1.2M","1MM","1b","1.2B")
make_numeric <- function(x){
# check that no other punctuation or suffixes than kKmMbB exist in argument
if(all(grep("[^kKmMbB0-9.,]",x,value = TRUE) == TRUE) == FALSE) stop("Argument contains characters other than numerals, commas, periods and kKmMbB")
# create a receiver object
output = rep(NA,length(x))
# strip commas
x = gsub(",","",x)
``` r
suppressPackageStartupMessages({
library(dplyr)
})
# create synthetic data
set.seed(42)
year_basket <- sample(2000:2020,100, replace = TRUE)
set.seed(137)
fee_basket <- sample(6000:9000,100)
Y Z_55 Z_56
1000 2201.3 2212.2
999 2204.7 2215.6
998 2201.3 2212.2
997 2204.7 2215.5
996 2201.3 2212.2
995 2204.6 2215.5
994 2201.3 2212.2
993 2204.6 2215.5
992 2201.3 2212.3
@technocrat
technocrat / nb.html
Created February 22, 2020 19:59
The output of an RStudio rmarkdown file
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
@technocrat
technocrat / nb.Rmd
Created February 22, 2020 19:57
An RStudio rmarkdown file set for html_notebook output
---
title: "R Notebook"
output: html_notebook
---
This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Cmd+Shift+Enter*.
```{r}