Hey R community, I keep getting the R error "Error in data$t : object of type 'closure' is not subsettable"
my R code is below, do you guys know why this would be?
Thank you, I look forward to hearing from you guys.
#..splitting the time variable.
library(stringr)
require(ggplot2)
Time = str_split_fixed(data$t, ":", n= 3)
datatime = cbind(Time, data)
To add to @FJCC's excellent points, data() is a built-in function in R. So if you haven't successfully assigned your own object to the name data, R falls back on trying to use that function. Internally, R calls functions "closures", which is why it's complaining that it can't subset an object of that type.