Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
453 views
in Technique[技术] by (71.8m points)

r - What does this error mean "Error in get_col_name_date_or_date_time(data) : No date or POSIXct column found in `data`"?

I am doing some stock market analysis. I have been stuck in this error. What would be the meaning of this error? There's a link to the image of the file.

My code until now:

prices1<-read.csv(file.choose())

#using 'highcharter' to create a quick interactive chart

prices1 %>% 
  hchart(.,
         hcaes(x=Date, y=Index.value),
         type="line") %>%
  hc_title(text="NEPSE Price History")

#using "mutate" and "dplyr" package to calculate returns

returns1<- prices1 %>%
  select(Date,Index.value) %>%
  # The mutate() function adds a new columns
  mutate(Nepse_returns=log(prices1$Index.value)-
           log(lag(prices1$Index.value)))

#using table.stats() from "Performance.Analytics" to get some quick stats

returns1 %>% 
  tq_performance(Ra=Nepse_returns,
                 performance_fun = table.Stats) %>%
  #for easy viewing
  t() %>%
  knitr::kable()

And now when I try to run this last code, I get this error: "Error in get_col_name_date_or_date_time(data) : No date or POSIXct column found in `data"

question from:https://stackoverflow.com/questions/65644232/what-does-this-error-mean-error-in-get-col-name-date-or-date-timedata-no-da

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...