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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -