I am totally new in R and doing an assignment for my studies. While coding I found an error stating "non-numeric argument to mathematical function". I Know the header is causing it, as it is the only non-numeric character in the database. But I don't know how to fix it.
I tried to calculate excluding the header, but couldn't do it.
DF = read.csv("Nominal Broad Dollar Index Modified.csv", header = TRUE)
head(DF)
This is the head of my data frame, & I'm not sure where the x1 column came and whether it is causing the error.
Index = DF$Index
Index0 = Index[DF$Y < 2018]
R0 = diff(log(Index0))
Error in log(Index0) : non-numeric argument to mathematical function
there are no results, I'm just getting errors.