Hi all, I am trying to use the kable() function to include a table of my data in a powerpoint presentation. I keep getting the following error:
Error in as.data.frame.default(x) :
cannot coerce class '"function"' to a data.frame
Calls: ... eval -> kable -> as.data.frame -> as.data.frame.default
Execution halted
the code where the error occurs is as follows:
kable(data, format='simple')
and the code I used to form the data is as follows:
withdraw <- c(1,0,0,1,1,1,0,0,1,0)
tolerance <- c(0,1,1,0,0,1,0,1,1,0)
failureStop <- c(0,1,1,0,0,1,1,0,0,1)
riskyBehavior <- c(1,0,0,0,0,1,1,1,0,1)
diagnosis <- rep(0,10)
data <- data.frame(withdraw, tolerance, failureStop, riskyBehavior,diagnosis)
When I type 'class(data)' into the console, I get that the class is in fact a data.frame so I'm really not sure why this isn't working. Anything would be appreciated. Thanks.