knitr::opts_chunk$set(echo = TRUE)

Introduction

This page documents some tips and tricks - reminders of syntax for R programming

String manipulation

Print an integer number with trailing zeroes

number <- 1
sprintf("%03i", number)

use "easier" patterns with wildcards for regexp

glob2rx('*.tif')

Package checking

### lintr: change limit on lines
with_defaults(line_length_linter(100)) # you love long lines


lbusett/lbscripts documentation built on May 14, 2019, 1:46 p.m.