Questions tagged [as.date]

as.Date is an R function used to convert between character or numeric representations and objects of class "Date", representing calendar dates.

as.Date is an R function used to convert between character or numeric representations and objects of class "Date", representing calendar dates.

https://www.rdocumentation.org/packages/base/versions/3.3.2/topics/as.Date

349 questions
-3
votes
1 answer

calculating time difference between 201912 and JOIN_YM variables

I have some data table which looks like this. [DATA] Customer ID : 1255455 , 5258545 , 227484, 25485418 , 3745648 ..... SEX : 1 , 1 , 2, 1 , 2 ..... JOIN_YM : 200608 , 201802 ,20170408, 201104 , 201009…
hyejuryu
  • 109
  • 4
-3
votes
2 answers

convert to date in R using abbreviated month

I'm new to R and trying to load some time series data but I'm stuck at the first hurdle. I have a dataframe with a date column called Date. The date format of the data is: 23-May-16 (it appears like this in the R console when I print df). To read…
joshi123
  • 835
  • 2
  • 13
  • 33
-3
votes
1 answer

Removing unnecessary dates

I have a list of days in 2017 and I have to remove the date, which do not have to calculate days_2016 <- seq(start_day, end_day, by="days") holidays <- seq(start_h, end_h, by="days") work_days <- How to make list without holidays?
Mariusz
  • 3
  • 3
-6
votes
1 answer

r: convert a string to date

I have a string like that: 201601 201603 201604 201606 201501 And I'd like to convert to Date, like so: 2016-01 2016-03 2016-04 2016-06 2015-01 I have tried:df$month_key=as.Date(df$month_key,format="YYYYmm") But it asks for the origin, which…
1 2 3
23
24