Open AprilPeck opened 3 years ago
Hello @AprilPeck, What folder is your utilities file stored in?
I had it in analysis, but I moved it to the lab folder to see if that helped (it didn't.)
Hello @AprilPeck,
I believe the cause of the error is with the here() statement. You'll need to specify the folder where the file is stored.
You can either use source()
source(here("analysis/utilities.R"))
or import::here() and specify which functions you want to import. Recall the example from the lab:
import::here("clean_d",
"tidy_up_data",
"build_year",
"RELEVANT_FILES",
"obtain_crosswalk",
"create_final_metadata_file",
.from = here::here("analysis/utilities.R"),
.character_only = TRUE)
But it's currently housed in the same folder (labs/wk03) as my .rmd. ?? I originally had it in analysis and specified so in the here() statement but moved it to see if that would resolve the error.
@AprilPeck Okay, if it's in the labs folder then your statement should indicate labs/wk03/utilities.R. The here() package always starts at the top of the repository so you will have to specify the file path from that point, even if your .RMD file is stored in the same place.
@castower
I can run all my code chunk by chunk and everything works fine; however, whenever I try to knit it gets stuck on the first function (compare_dfs) saying it couldn't find the function (which is in my utilities file). In my first chunk, I import utilities and load packages and, again, it runs fine when I run the code but not when I try to knit.
From my utilities file: