• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
      • CSPro DB
      • Encrypted CSPro DB
      • Text
      • JSON
      • None
      • In-Memory
      • Comma Delimited (CSV)
      • Semicolon Delimited
      • Tab Delimited
      • Excel
      • R
      • SAS
      • SPSS
      • Stata
      • CSPro Export
      • Case Read Optimization
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

R Data Source

Overview
The R data source allows writing, but not reading, data to a R file, written natively in the R Data Format (.RData). By default, each record is written as a data frame containing the values of each variable as vectors. The data frame is named after the record. You can also categorize the variables using CSPro's value set labels by outputting factors in addition, or instead of, the variable codes.
This data source is similar to the other data sources that write to formats used by statistical software: SAS, SPSS, and Stata.
The R data source is used when a file has the extension .Rdata or .rda.
Functionality
The R data source supports the following features:
FeatureSupported
Reading cases
✘
Writing cases
✔
Notes, case labels, and case statuses
✘
Storage of more than one kind of record
✔
Binary data items
✘
Deleting cases
✘
Undeleting cases
✘
Syncing data
✘
Cases with duplicate keys
✘
Case identification via UUID
✘
Contains an embedded dictionary
✘
Allows record sorts
✘
Customizable Behavior
The following behavior can be customized by specifying properties in the connection string. The default behavior is marked with ⁺⁺⁺.
Property Name and ValuesDescription
 
"factorRanges"Determines if factors are created for numeric items that contain ranges (i.e., contain non-discrete values). This property only applies when writing factors.
true
A factor is written for items with ranges.
false ⁺⁺⁺
A factor is not written for items with ranges.
 
"mappedSpecialValues"Determines how the special values missing and refused are written.
"codes" ⁺⁺⁺
The value of the mapped code is written. For example, if missing is mapped to -99, then -99 is written.
"suppress"
No value is written.
 
"record"If the name of a record is provided, only items from that record are written.
 
"writeCodes"Determines if the item's code is written as a vector.
true ⁺⁺⁺
A vector of codes is written.
false
A vector of codes is not written.
 
"writeFactors"Determines if the item's label is written as a factor. If writing both codes and factors, the factor will be named as the code vector, followed by .f.
true
A factor of labels is written.
false ⁺⁺⁺
A factor of labels is not written.
For example, the following connection string, specified in a batch PFF, would result in a R file containing the values of the HOUSING_REC record written as codes and factors:
OutputData=housing.RData|writeFactors=true&record=HOUSING_REC
See also: Data Sources