object of type 'closure' is not subsettable - contradiction?
- by Alex
I'm writing a function to produce time series plots of stock prices. However, I'm getting the following error
"Error in df[, 7] : object of type 'closure' is not subsettable"
Here's an example of the function:
plot.prices <- function(df) {
require(ggplot2)
g <- ggplot(df, aes(x= as.Date(Date, format= "%Y-%m-%d"),
y=…