Partager via


Importing .dbf files in Microsoft R Server

The dBASE database file with the .dbf file extension is not supported by Microsoft R Server's rxImport. rxImport function is used to import data into an '.xdf' file or data.frame.

Alternatively, .dbf file can be converted into a data.frame using the CRAN package called foreign. The data.frame can then be converted into an .xdf file, using rxImport.

Here's an example:

Output:

 > rxGetInfo(file_content)
Data frame: file_content  
Number of observations: 67 
Number of variables: 15

Using rxImport, this data.frame can then be converted into a .xdf file:

 > rxImport(inData = file_content, outFile = "output_dbase.xdf")
Rows Read: 67, Total Rows Processed: 67, Total Chunk Time: 0.002 seconds 
> rxGetInfo("output_dbase.xdf")
File name: $path_to_file_output_dbase.xdf 
Number of observations: 67 
Number of variables: 15 
Number of blocks: 1 
Compression type: zlib