Skip to content

Instantly share code, notes, and snippets.

@rkrug
rkrug / scrip.md
Last active December 9, 2021 11:55
Creating RStudio Server from Ubuntu Installation

Update Installation

sudo apt-get update
sudo apt-get upgrade

basic tools

@rkrug
rkrug / Makefile
Created August 20, 2020 06:53
Makefile to recursively run all makefiles in subfolders with specified targets
## See https://stackoverflow.com/a/11206700/632423
## adjust when different
SUBDIRS := $(wildcard */.) # e.g. "foo/. bar/."
TARGETS := all build build-cran check clean clean_check clean_readme deps docs drat files # whatever else, but must not contain '/'
##
# foo/.all bar/.all foo/.clean bar/.clean
SUBDIRS_TARGETS := \
$(foreach t,$(TARGETS),$(addsuffix $t,$(SUBDIRS)))
---
title: "plantuml test"
author: "Rainer M Krug"
date: "6/17/2020"
output: html_document
---
```{r setup, include=FALSE}
library(plantuml)
knitr::knit_engines$set(
## R parts based on https://github.com/yihui/knitr/blob/master/Makefile
PKGNAME := $(shell sed -n "s/^Package: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGVERS := $(shell sed -n "s/^Version: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGSRC := $(shell basename `pwd`)
########### Package ###########
####
@rkrug
rkrug / Makefile
Created September 19, 2019 11:24 — forked from hjst/Makefile
Makefile for use with PlantUML diagrams
PLANTUML_JAR_URL = https://sourceforge.net/projects/plantuml/files/plantuml.jar/download
DIAGRAMS_SRC := $(wildcard diagrams/*.plantuml)
DIAGRAMS_PNG := $(addsuffix .png, $(basename $(DIAGRAMS_SRC)))
DIAGRAMS_SVG := $(addsuffix .svg, $(basename $(DIAGRAMS_SRC)))
# Default target first; build PNGs, probably what we want most of the time
png: plantuml.jar $(DIAGRAMS_PNG)
# SVG are nice-to-have but don't need to build by default
svg: plantuml.jar $(DIAGRAMS_SVG)
@rkrug
rkrug / test.Rmd
Last active March 27, 2019 15:51
kable table as return from function as character
---
title: "test"
author: "Rainer M Krug"
date: "3/27/2019"
output:
html_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
@rkrug
rkrug / Makefile
Created January 8, 2019 13:19 — forked from halpo/Makefile
Makefile for R Packages
# Makefile for generating R packages.
# 2011 Andrew Redd
#
# Assumes Makefile is in a folder where package contents are in a subfolder pkg.
# Roxygen uses the roxygen2 package, and will run automatically on check and all.
PKG_VERSION=$(shell grep -i ^version pkg/DESCRIPTION | cut -d : -d \ -f 2)
PKG_NAME=$(shell grep -i ^package pkg/DESCRIPTION | cut -d : -d \ -f 2)
R_FILES := $(wildcard pkg/R/*.R)
@rkrug
rkrug / Makefile
Last active November 23, 2018 12:59
## All Rmarkdown files in the working directory
SRCDIR = source
OUTDIR = docs
RMD = $(wildcard $(SRCDIR)/*.Rmd)
# HTML = $(RMD:.Rmd=.html)
TMP = $(RMD:.Rmd=.html)
HTML = ${subst $(SRCDIR),$(OUTDIR),$(TMP)}
@rkrug
rkrug / Makefile
Created August 9, 2018 07:42
Makefile to build html, pdf and docx
## Based on https://github.com/kjhealy/rmd-starter/blob/master/Makefile
## All Rmarkdown files in the working directory
SRC = $(wildcard *.Rmd)
FILES = $(wildcard *_files)
PDFS = $(SRC:.Rmd=.pdf)
HTML = $(SRC:.Rmd=.html)
TEX = $(SRC:.Rmd=.tex)
@rkrug
rkrug / Makefile
Last active October 18, 2017 09:05 — forked from PirateGrunt/Makefile
Basic makefile
####################
# Makefile
# Copyright Brian A. Fannin 2015
# Forked from https://gist.github.com/PirateGrunt/e8ec52fe412f5069f2a0#file-makefile
####################
RDIR = .
DATA_DIR = $(RDIR)/data
GATHER_DIR = $(DATA_DIR)/gather