คุณสามารถใช้ R 'แปลง' ฟังก์ชันการแปลงข้อมูล และการส่งผ่านที่ทำงานกับฟังก์ชัน 'rxDataStepXdf()' RevoScaleR จากนั้นคุณสามารถใช้แฟ้ม.xdf ชุดย่อยที่สร้างใหม่ ด้วยฟังก์ชัน RevoScaleR อื่น ๆ ข้างล่างนี้เป็นสคริปต์ตัวอย่าง R ที่สร้างไฟล์.xdf ใหม่ โดยการสุ่มสุ่มตัวอย่าง.xdf แฟ้มมีขนาดใหญ่ขึ้นโดยใช้แถวที่ซ่อนไว้เลือกตัวแปรพร้อมใช้งานใน 'transformFunc'
# Create a transformFunc that selects 25% of the data at random set.seed(13)
xform <- function(data) {
data$.rxRowSelection<-as.logical(rbinom(length(data[[1]]),1,.25))
return(data)
}
rxDataStepXdf(inFile=inFile, outFile="sampledData.xdf", transformFunc=xform, overwrite=TRUE)
# check that subsetting was done and the row selection variable is not kept in the data set.
rxGetInfoXdf(inFile)
rxGetInfoXdf("sampledData.xdf")