Data partition in shiny using caret package

Hi,

Although I don't know if the data in the variable new$student is valid, one mistake I see in the code is that you assign a reactive variable index, but when you call it, you don't call it as a reactive variable. You should use the brackets when calling them like so:

new[index(),]

I know it looks a bit weird, but in Shiny, reactive values are functions that store the value.

It's better next time to create a reprex (or create one if this didn't help), so we can more easily test the issue ourselves:

Hope this helps,
PJ