rxDataStep
xdf파일(.xdf)이나 데이터 프레임형식의 input 데이터로부터 xdf파일(.xdf)이나 데이터 프레임형식의 output 데이터로 변환하는 함수
Usage
rxDataStep(inData = NULL, outFile = NULL, varsToKeep = NULL, varsToDrop = NULL,
rowSelection = NULL, transforms = NULL, transformObjects = NULL,
transformFunc = NULL, transformVars = NULL,
transformPackages = NULL, transformEnvir = NULL,
append = “none”, overwrite = FALSE, removeMissings = FALSE,
computeLowHigh = TRUE, maxRowsByCols = 3000000,
rowsPerRead = -1, startRow = 1, numRows = -1, returnTransformObjects =FALSE,
blocksPerRead = rxGetOption(“blocksPerRead”),
reportProgress = rxGetOption(“reportProgress”),
xdfCompressionLevel = rxGetOption(“xdfCompressionLevel”), …)
rxDataStepXdf(inFile, outFile, varsToKeep = NULL, varsToDrop = NULL,
rowSelection = NULL, transforms = NULL, transformObjects = NULL,
transformFunc = NULL, transformVars = NULL,
transformPackages = NULL, transformEnvir = NULL,
append = “none”, overwrite = FALSE, removeMissings = FALSE,
computeLowHigh = TRUE, rowsPerRead = -1,
startRow = 1, numRows = -1, startBlock = 1, numBlocks = -1,
returnTransformObjects = FALSE,
blocksPerRead = rxGetOption(“blocksPerRead”),
reportProgress = rxGetOption(“reportProgress”),
xdfCompressionLevel = rxGetOption(“xdfCompressionLevel”),
checkVarsToKeep = TRUE, userObjects = NULL, cppInterp = NULL)
Arguments
- inData : 데이터 프레임, xdf파일(.xdf)이나 RxXdfData가 사용 가능
만약 Null이라면 하나의 변수를 가지는 데이터 셋이 자동으로 생성된다.
- inFile : RxXdfData 오브젝트와 xdf파일(.xdf) 둘다 사용 가능
- outFile : RxXdfData 오브젝트와 xdf파일(.xdf) 둘다 사용 가능,
만약 returnTransformObjects가 TRUE만 아니라면, rxDatastep으로부터 데이터 프레임 형식으로 반환된다
- varsToKeep : 변수 중 남기고 싶은 변수 선택
- varsToDrop : 변수 중 버릴 변수 선택
- rowSelection : 변수에서 특정 행만(ex. age가 10이상인) select하고 싶을 때
- transforms : 변수변환의 첫단계(변수이름=표현, …)
- transformObjects : transforms, transformsFuns, rowSelection으로써 참조된 오브젝트를 포함하는 리스트
- transformVars : transformation 함수를 위해 필요한 input 데이터 셋의 변수들에 대한 문자 벡터
- append : “none”-새로운 xdf파일을 덧붙이는 것/“rows”-존재하는 xdf파일에 행을 추가하는 것
- overwrite : 같은 이름의 데이터를 불러왔을 때, 데이터 업그레이드(덮어쓰기 허용)
- removeMissings : TRUE이면 행의 결측치는 포함하지 않은 데이터가 input된다
- computeLowHigh : FALSE이면 데이터의 가장 작고 큰 값이 자동으로 계산되지 않는다
- maxRowsByCols : 불러오는 데이터의 최대 행의 수
- rowsPerRead : 한 번에 읽는 row의 수
- startRow : 검색을 하기 위한 시작 행을 지정
- numRows : Import되는 최대 행수, '-1(default)'이면 모든 행을 다 Import함
- returnTransformObjects : 논리 값. TRUE이면, 데이터 프레임이나 데이터소스 오브젝트 대신에 transformObjects의 리스트가 반환된다
- startBlock : 읽어올 데이터의 시작 Block을 설정(startRow가 1보다 크게 되어있을 경우 무시) ( If the input transformObjects have been modified, by using .rxSet or .rxModify in the transformFunc, the updated values will be returned. Any data returned from the transformFunc is ignored. If no transformObjects are used, NULL is returned. This argument allows for user-defined computations within a transformFunc without creating new data.)
- numBlocks : 읽어오는 데이터 Block의 수(Ignored if numRows is not set to -1. )
- blocksPerRead : 데이터 소스로부터 읽어오는 데이터의 각 chunk에서 읽는 Block의 수(Ignored for data frames or if rowsPerRead is positive.)
- reportProgress : 0-어떤프로세스도 report되지 않음/1-진행된 행의 숫자가 프린트되고 업데이트됨/2-진행된 행과 그 시간이 report됨/ 3-진행된 행과 전체 시간이 report됨
- xdfCompressionLevel : integer in the range of -1 to 9. The higher the value, the greater the amount of compression - resulting in smaller files but a longer time to create them. If xdfCompressionLevel is set to 0, there will be no compression and files will be compatible with the 6.0 release of Revolution R Enterprise. If set to -1, a default level of compression will be used.
- checkVarsToKeep : logical value. If TRUE variable names specified in varsToKeep will be checked against variables in the data set to make sure they exist. An error will be reported if not found. Ignored if more than 500 variables in the data set.
- userObjects : 중지된 옵션
- cppInterp : 지원하지 않음
자세한 옵션을 보시려면, 여기 를 클릭하세요.
Sample Code