0

My data looks like the following:

Stock Market Data

All the columns are character types. I want to plot adjusted closing price across time. So, I convert the Date column to a Date class and the Adj.Close column to a numeric type.

data$Date <- as.Date(data$Date)
data$Adj.Close <- as.numeric(data$Adj.Close)

Next, I try to plot the variables

ggplot(data, aes(x = "Date", y = "Adj.Close")) + geom_line()

But, all I get is an empty grid. I've also tried converting the Date column to a time series data type with as.ts but this gives me the same result.

Ian Campbell
  • 23,484
  • 14
  • 36
  • 57
Andrew
  • 23
  • 1
  • 4

0 Answers0