RE: questions about using dapply

2016-09-12 Thread xingye
ot;cr_cd", 1:12, sep = "")], Margin=2, function(y){ y %in% c(61, 99)})},schema )The error shows Error in match.fun(FUN) : argument "FUN" is missing, with no default From: felixcheun...@hotmail.com To: user@spark.apache.org; tracy.up...@gmail.com Subject: Re: questions abo

Re: questions about using dapply

2016-09-10 Thread Felix Cheung
You might need MARGIN capitalized, this example works though: c <- as.DataFrame(cars) # rename the columns to c1, c2 c <- selectExpr(c, "speed as c1", "dist as c2") cols_in <- dapplyCollect(c, function(x) {apply(x[, paste("c", 1:2, sep = "")], MARGIN=2, FUN = function(y){ y %in% c(61, 99)})}) #