Skip to content

Instantly share code, notes, and snippets.

Paul Rougieux paulrougieux

View GitHub Profile
View .vimrc
""""""""""""""""""""""""""
" Vundle package manager "
""""""""""""""""""""""""""
" Should be at the beginning
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@paulrougieux
paulrougieux / License.md
Last active Jan 24, 2020 — forked from fbiga/License.md
Load data from faostat bulk download into R data frames
View License.md

MIT

Copyright 2020 Paul Rougieux, 2019 fbiga

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE

View spectrophotometer.txt
Group: Controls 1
Sample Wells Values MeanValue CV Od-bkgd-blank
Anti-Hu Det A11 2.849 2.855 0.282 2.853
A23 2.860
Coat Control A12 0.161 0.160 0.530 0.159
A24 0.160
Diluent Standard 1 A9 0.114 0.113 1.379 0.104
A21 0.112
Diluent Standard 2 A8 0.012 0.013 2.817 0.012
A20 0.013
@paulrougieux
paulrougieux / pythonvariables.Rmd
Created Jun 27, 2018
Variable do not persist in note book mode, but they persist when markdown is compiled
View pythonvariables.Rmd
---
title: "R Notebook"
output:
html_document:
df_print: paged
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(reticulate)
@paulrougieux
paulrougieux / warningerrorlog.R
Last active Jul 12, 2017 — forked from anonymous/warningerrorlog.R
Catch errors and warnings from log file
View warningerrorlog.R
# Load the 2 functions below,
# then test errors with:
# downloadfile1(url="xxxx", destfile="/tmp/xxxx", logfile="~/rlog.txt")
# ~/rlog.txt contains
# Error in download.file(url = url, destfile = destfile, ...): cannot download all files
#
# then
#
# downloadfile2(url="xxxx", destfile="/tmp/xxxx", logfile="~/rlog.txt")
# ~/rlog.txt contains the warning message
@paulrougieux
paulrougieux / scraplinks.R
Last active Jun 22, 2020
Extract link texts and urls from a web page into an R data frame
View scraplinks.R
View testpagenumbers.lyx
#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\begin_header
\textclass scrbook
\use_default_options true
\begin_modules
customHeadersFooters
\end_modules
\maintain_unincluded_children false
@paulrougieux
paulrougieux / dplyrfilternse.R
Last active Apr 15, 2016
dplyr::filter nse
View dplyrfilternse.R
library(dplyr)
library(lazyeval)
Species <- "virginica"
# The Species variable is interpreted
# in the context of the data frame
iris %>%
filter_(Species == Species) %>%
nrow()
# 150
@paulrougieux
paulrougieux / threeparttable.lyx
Last active Feb 19, 2020
Use of the package threeparttable with Lyx
View threeparttable.lyx
#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\begin_header
\textclass article
\begin_preamble
\usepackage[flushleft]{threeparttable}
\end_preamble
\use_default_options true
\begin_modules
@paulrougieux
paulrougieux / knitrchunk
Last active Nov 19, 2015
Add a footnote in a table generated by xtable inside a Lyx document (answer from http://stackoverflow.com/a/13676007/2641825)
View knitrchunk
<<1stgenerationxtunitroot, results='asis'>>=
library(xtable)
x <- matrix(rnorm(60), ncol = 10)
x.big <- xtable(x,label='tabbig', caption='Example of longtable')
names(x.big) <- LETTERS[1:10]
names(x.big)[9] <- paste('I','footnote') # I put the tag on I letter
print(x.big,tabular.environment='longtable',floating=FALSE,
sanitize.text.function=function(str)gsub("footnote","\\footnote{my tricky footnote !!}",str,fixed=TRUE))
@
You can’t perform that action at this time.