I am learning to use targets
within my current research project. I am still at the beginning of my data processing (and associated pipeline) but I get the following error when I try to use targets::tar_make()
:
> targets::tar_make()
✔ skip target raw_tits
• start target nnestling_data
ℹ Using "','" as decimal and "'.'" as grouping mark. Use `read_delim()` for more control.
✖ error target nnestling_data
• end pipeline: 1.19 seconds
Error : _paths_ missing files: Table exported to D:/fmartin/Mes documents/projects/pubprivlands/analyses/ppl.tits/output/tables/tits_nestling_data.csv
✖ Problem with the pipeline.
ℹ Show errors: tar_meta(fields = error, complete_only = TRUE)
ℹ Learn more: https://books.ropensci.org/targets/debugging.html
Error:
! problem with the pipeline.
I truly don't understand why it doesn't work since there is no missing file. Here's how my current _targets.R
looks like:
list(
# Make the workflow depends on the raw data file
targets::tar_target(raw_data_file, here::here("mydata", "ppl_dijon_tits_data.csv"),
format = "file"),
# Read the data and return a data.frame
targets::tar_target(raw_tits, ppl.tits::import_raw_tits_data()),
# Export the nestling aggregated data table
targets::tar_target(nnestling_data, ppl.tits::export_nestling_aggreg(), format = "file")
)
And the simple export function I'm calling in my last targets::tar_target()
:
export_nestling_aggreg <- function(){
aabb <- ppl.tits::aggreg_by_nest()
readr::write_csv2(x = aabb, file = here::here("output", "tables", "tits_nestling_data.csv"))
return(paste("Table exported to", here::here("output", "tables", "tits_nestling_data.csv"), sep = " "))
}
Could someone help me figure this one out?