R: list all the files on a specific folder

I can list all the files that are located on the default folder. I want to do the same for any other folder.
How can I do that? In the R-Script Generator I tried to set the wd beforehand but that doesn’t work for some reasons.
setwd("/uc4/test/tomcat/XXX")
return(as.data.frame(list.files())

EDIT: solved
test = list.files(path = ‘/uc4/test/tomcat/XXX’)
return(as.data.frame(test))

EDIT: solved
test = list.files(path = ‘/uc4/test/tomcat/XXX’)
return(as.data.frame(test))