Error in as.POSIXlt.numeric(x, tz = tz(x)) : 'origin' must be supplied

I had a dataframe with monthly stock data.
25 columns of which 24 are 'chr', and the Date was a 'yearmon num'.
Running the following code gave no problems:

tmp = tmp %>% mutate_at(vars(names(tmp)[4:ncol(tmp)]), funs(as.numeric)) %>%
mutate_if(is.numeric, funs(ifelse(is.infinite(.), NA, .))) %>% # replace Inf w/ NA's
mutate_if(is.numeric, funs(round(., 5))) %>% # round to 5 decimal places (for some reason, 0's not properly coded in some instances)
select(-c(COGS, SGAE, RD, NIBED, INVT, PPEG, LTD, DPS, EPS, CFPS)) %>%
filter(is.na(ISIN) == F & year(Date) < 2019) %>%
distinct()

Now I have donwloaded the weekly data, and the catagory of this column is either 'Date' or 'numeric'.
When I run the exact same code, I am getting the following error:

"Error in as.POSIXlt.numeric(x, tz = tz(x)) : 'origin' must be supplied"

Is there any 'yearweek num' I can select, or is there any other solution for this?

Thanks!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.