Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7981329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:20:12+00:00 2026-06-04T10:20:12+00:00

The date in my original Excel file represents the monthly data in the format

  • 0

The date in my original Excel file represents the monthly data in the format of “Jan-01”. Of course, I can manually convert them to something more useful in the Excel first and then input that into R.

How can I convert such adate into a Date class in R?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:20:14+00:00Added an answer on June 4, 2026 at 10:20 am

    If you want a date class, use as.Date:

    x <- "Jan-01"
    as.Date(paste("01-", x, sep = ""), format = "%d-%b-%y")
    

    If you want a POSIXct class, consider using lubridate:

    library(lubridate)
    x <- "Jan-01"
    dmy(paste("01-", x , sep =""))
    

    If you want to just rely on base:

    x <- "Jan-01"
    as.POSIXct(paste("01-", x, sep = ""), format = "%d-%b-%y")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to format the created_at field date from the original to something like
I want to format the created_at field date from the original for something like
I am trying to convert a uncommon date format into a standard date. Basically
Currently, every comment has the same date as the original post. Theme functions PHP:
The copied original folder should be pasted inside folder named with today's date like
UPDATE: This question is out of date, but left for informational purposes. Original Question
echo date(W,strtotime('2010-01-01')); This outputs 53. I would expect it to output 1. Can anyone
FYI - this query runs from excel. i have prompt fields to set date
I encountered a weird problem setting a custom date format with PHPExcel: I'm writing
I'm working with a query that has a column named Date. The original query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.