R scripts and docs