I am trying to invoke some system commands on R using
system() calls. However, I am having the infamous problem with spaces in the directories.
For example, I am trying to use this directory:
odir <- '/Volumes/Macintosh HD 2/data/cmip5/historical/clt/models'
on this command:
system(paste('ls ', odir,sep=''))
and I receive the following error:
> system(paste('ls ', odir,sep='')) ls: /Volumes/Macintosh: No such file or directory ls: 2/data/cmip5/historical/clt/models: No such file or directory ls: HD: No such file or directory
How can I overcome this?