Bạn có thể sử dụng R 'chuyển đổi' chức để chuyển đổi dữ liệu qua chức năng đó RevoScaleR 'rxDataStepXdf()' hoạt động. Bạn có thể sử dụng tệp .xdf nhóm mới tạo, với các chức năng RevoScaleR. Dưới đây là một tập lệnh mẫu R tạo tệp .xdf mới bằng ngẫu nhiên mẫu tệp .xdf lớn bằng cách sử dụng biến lựa chọn hàng ẩn bằng '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")