Relative Content

Tag Archive for r-markdownknitr

Knitting an Rmd file deletes data files in a needed folder, halting the knitting?

My Rmd script was made to convert FTIR-ATR .asc files to .txt (Chunk 1), delete the first 56 lines of the .txt (Chunk 2), create folders based on an acronym used in the file name (Chunk 3), create subfolders in the previous folders based on the numbers in the file name (Chunk 4), create a file in each of the subfolders that averages the data in those folders (Chunk 5), and finally create a graph of one of the averaged data sets to compare to a baseline dataset (which lives in a folder in the same space as those made in Chunk 3). Chunks 1-5 knit smoothly, but when I get to Chunk 6, it fails to knit the PDF and deletes the datafiles in the baseline dataset. Just running the script itself does not do this, it only seems to happen when attempting to knit to a PDF. I do have knitr::opts_chunk$set(echo = TRUE) in the beginning of the file. I get the error and script below: