There is something wrong in my function getting error:
Here is the code:
fun <- function(x){
reshape2::dcast(x, formula = PROVINCE + DISTRICT ~ DAILY_LANG,
value.var = "WEIGHT", fun.aggregate = sum)
}
By running the code getting this error:
Error in value.var %in% names(data) : object 'x' not found
Appreciate your help.