I am a new user of blogdown using Hugo. I would like to create a new post that includes R code to read a data file.
The data file is in my static folder, local path C:\mydir\myblogdown\static\data\savedrecs.txt
. Since I was successful in referring to an image using a relative path like this, ![](/images\myimage.jpg)
, I tried reading the data using something similar for the data file, read.csv("/data\savedrecs.txt")
, but that didn't work.
I started playing around with the list.files()
function to see if I could find a relative path that worked in my local version of the post, list.files("../../static/data")
worked, showing me ## [1] "savedrecs.txt"
.
I tried searching around other folks' blogdown repos on Github to see how they might have referred to a data file, but the only example I found referred to a data file using a URL.