customFunc<-function(variable,compare,data) {
a.data <- tally(shuffle(variable)~compare,data=data,format="percent")
return(a.data)
}
I get this error message where survival and gender are two data in my data slasher
customFunc(survival,gender,data=slasher)
Error in sample(x, replace = replace, prob = prob, groups = groups) :
object 'survival' not found
But just this works
tally(shuffle(survival)~gender,data=slasher,format="percent")