Error in Metaboanalyst R for raw file processing

I am trying to do raw spectral processing, but it shows me follwing error…

datapath <-“~/R/Metabolomics_Pipeline/Centroided_Earlytimepoints_B1/Positive/QC”
DataFiles ← list.files(datapath, full.names = TRUE )
mSet ← PerformROIExtraction(datapath = DataFiles, rt.idx = 0.9,plot = TRUE, rmConts = TRUE)
Error in if (!dir.exists(datapath)) { : the condition has length >

Has anyone faced the same and got a solution ? , Thanks in advance !