Reputation: 1
I am new to Microsoft Revr. I am facing a small problem in the below code
FILTER<-"TRANS > 0"
max_rows_cols <- 100000000000000000000
data1 <- rxDataStep(inData = data1,transformObjects=list(Filter=FILTER),
rowSelection =**noquote(Filter)** ,overwrite = TRUE,maxRowsByCols=max_rows_cols)
I get the value of FILTER at run time.
Is Something wrong with the row selection value?
Looking forward to help on this?
Upvotes: 0
Views: 347
Reputation: 57696
The rowSelection
argument should be an expression giving the rows to keep. You need to parse (but not evaluate) your filter text:
filterExpr <- parse(text=FILTER)
df <- rxDataStep(data1, rowSelection=filterExpr, maxRowsByCols=NULL)
Note that if you want to turn off the dataset size check, set maxRowsByCols=NULL
.
Upvotes: 2
Reputation: 887851
We can use eval(parse
library(RevoScaleR)
rxDataStep(inData = data1, transformObjects=list(Filter=FILTER),
rowSelection = eval(parse(text=Filter)))
# Rows Read: 5, Total Rows Processed: 5, Total Chunk Time: 0.003 seconds
# Col1 TRANS
#1 3 1
#2 4 3
#3 5 2
data1 <- data.frame(Col1 = 1:5, TRANS = c(-5, -4, 1, 3, 2))
FILTER<-"TRANS > 0"
Upvotes: 0