fix resource-to-filename conversion in director$.filename for files with .R (instead of .r)