osx - in R createDataPartition how do I pass a value for y coming from a function call -
i created function calls createdatapartition in function, pass dataframe , targety value when call createdatapartition getting following error:
error in createdatapartition(df[target], p = 0.05, list = false) : y must have @ least 2 data points
is there unique way on how function calls?
code:
targety = 'response' # adultfile dataframe trainpct = .95 my_function <- function (df=adultfile,targety=targety,p=trainpct) { testidx <- createdatapartition(df[targety], p=p, list = false) }
Comments
Post a Comment