I would like to make the path to the input files automated, asking the user to enter only the last part of the path (year) as the root of the path is always the same (path_root), I have tried with the following instructions:
#set the input path's root
path_root= "W:\GRAN_PARADISO\Sentinel2\T32TLR\Level2"
#taking input year from user with showing the message
year <- readline(prompt="Enter the scenes' acquisition year to pre-process: ")
#build the entire path
repo <- file.path(path_root, year)
#set working directory
setwd(repo)
but it returns the following error:
Error in file.path(path_root, year) : object "path_root" not found