You need to provide the Date
column, not the entire data.frame
.
R> as.Date(dates[["Date"]], "%Y%m%d")
[1] "2013-07-07" "2013-07-06" "2013-07-05" "2013-07-04"
More Related Contents:
- Transform year/week to date object
- Looping over a Date or POSIXct object results in a numeric iterator
- Axis labels on two lines with nested x variables (year below months)
- Get the difference between dates in terms of weeks, months, quarters, and years
- What are the “standard unambiguous date” formats for string-to-date conversion in R?
- How to flatten / merge overlapping time periods
- How to change multiple Date formats in same column?
- How to get week numbers from dates?
- Extract month and year from a zoo::yearmon object
- How to get a vertical geom_vline to an x-axis of class date?
- Add a month to a Date [duplicate]
- efficiently generate a random sample of times and dates between two dates
- How to subtract/add days from/to a date?
- Formatting dates with scale_x_date in ggplot2
- Convert a numeric month to a month abbreviation
- Difference between as.POSIXct/as.POSIXlt and strptime for converting character vectors to POSIXct/POSIXlt
- Convert four digit year values to class Date
- Convert string to date, format: “dd.mm.yyyy”
- How can I fix corrupted dates in R?
- Add (subtract) months without exceeding the last day of the new month
- Format date as Year/Quarter
- Converting a character string into a date in R
- Checking if Date is Between two Dates in R
- Create end of the month date from a date variable
- Convert Factor to Date/Time in R
- How to convert a date from a character string?
- Get date difference in years (floating point)
- Formatting a date in R without leading zeros
- R: xtable and dates
- Convert decimal day to HH:MM