[R] Batch mode questions.

Rich Shepard r@hep@rd @end|ng |rom @pp|-eco@y@@com
Thu Jul 26 01:34:15 CEST 2018


On Wed, 25 Jul 2018, David Winsemius wrote:

>>> # create a list from these files
>>> list.filenames<-list.files(pattern=".CSV$")  # This gets a list of all CSV files
>
> It would get all the files with all caps "CSV" anywhere within the file
> name, but it would not get any files with an extension ".csv", nor would
> it exclude a file named "somethingCSV" . The pattern argument is
> interpreted as a regex pattern and the meaning of a period is different.
>
> Better for this purpose would be:
>
> list.files(pattern="\\.(csv|CSV)$")
>
> I suppose this criticism might be platform-specific if the filesystem were
> caps-agnostic, but mine is not.

David,

   I saw that and noted that since linux separates meaning between upper- and
lower-case letters it would need to be modified is there were any *.CSV
files in the directory. Same type of problem occurs when file names have
spaces in them.

Regards,

Rich




More information about the R-help mailing list