should this check also ensure it's within the R/ subdirectory?