Version 12/28/2006.

'input' = the R matrix or dataframe that is to be exported to SPSS.

'outfile' specifies the output file to which SPSS syntax and data will be written. 'outfile' should not have a file extension, i.e., it should have the form:  'outfile = c:\\mydata\\newdata' or 'outfile = c:/mydata/newdata'.  Either specification will cause SPSS syntax to be written to c:\mydata\newdata.sps and data in text format will be written to c:\mydata\newdata.txt.  

WARNING: If you write 'outfile = c:\mydata\newdata' as the 'outfile' argument of export.spss, R will not understand this path specification.  R expects to see '\\' or '/' where Windows expects to see '\'.

Digits = 8 is intended to control the number of digits to the right of the decimal place that are written to the data file, but at present this option is not working properly.  Need to debug this at some later time.

replace.file = FALSE means that no data or syntax files will be created if files by the same names already exist.  'replace.file = TRUE' means that 'export.spss' will overwrite any existing files that have the same names as the new syntax and data files.

extract.filename extracts the file name from a string that indicates its path + file name.  It can take a vector as input; in this case, it returns the vector of file names without the paths.  By default, all filenames are returned in the same case as the input.  If the input is a path that does not end in a filename, then extract.filename returns NA.  

ARGUMENTS:

Set lower = TRUE to convert all outputted characters to lower case.

Set No.Names = FALSE to return a vector of outputs that is named by the inputted path + file name vector. 

Set extension = FALSE to return the filename without an extension.

POSSIBLE REVISION:
Consider using the basename function as part of this function.  The basename function is not quite the equivalent of the extract.filename function.  

The following produce identical outputs:
    basename( "e:/r/fns/ls.jm.docm" )
[1] "ls.jm.docm"
    extract.filename( "e:/r/fns/ls.jm.docm" )
[1] "ls.jm.docm"

The following do not produce identical outputs:
    basename( "e:/r/fns" )
[1] "fns"
    extract.filename( "e:/r/fns" )
[1] NA

Also,
    basename( "e:/r/fns/" )
[1] "fns"
    extract.filename( "e:/r/fns/" )
[1] NA

Also, note that extract.filename uses a heuristic to decide whether a path that ends in a string that contains a period "." denotes a folder or a file name.  For example, 
extract.filename( "e:/cb/cs.str" )
[1] NA
This call to extract.filename returns NA because the directory (folder) "e:/cb/cs.str" exists on my computer.  
extract.filename( "e:/cb/cs.xyz" )
[1] "cs.xyz"
This call to extract.filename returns "cs.xyz" because the directory "e:/cb/cs.xyz" does not exist on my computer.