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 3783588
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:14:50+00:00 2026-05-19T11:14:50+00:00

I have got CSV files which has the Date in the following format: 25-Aug-2004

  • 0

I have got CSV files which has the Date in the following format:
25-Aug-2004

I want to read it as an “xts” object so as to use the function “periodReturn” in quantmod package.

Can I use the following file for the function?

Symbol Series        Date Prev.Close Open.Price High.Price Low.Price

1       XXX     EQ 25-Aug-2004     850.00    1198.70    1198.70    979.00

2       XXX     EQ 26-Aug-2004     987.95     992.00     997.00    975.30

Guide me with the same.

  • 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-05-19T11:14:51+00:00Added an answer on May 19, 2026 at 11:14 am

    Unfortunately I can’t speak for the ts part, but this is how you can convert your dates to a proper format that can be read by other functions as dates (or time).
    You can import your data into a data.frame as usual (see here if you’ve missed it). Then, you can convert your Date column into a POSIXlt (POSIXt) class using strptime function.

    nibha <- "25-Aug-2004" # this should be your imported column
    lct <- Sys.getlocale("LC_TIME"); Sys.setlocale("LC_TIME", "C") #temporarily change locale to C if you happen go get NAs
    strptime(nibha, format = "%d-%b-%Y")
    Sys.setlocale("LC_TIME", lct) #revert back to your locale
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large number of csv files that I want to read into
I have a UTF-16 CSV file which I have to read. Python csv module
I have got ASCII files and want to convert them into maybe excel or
Have got an NSString *str = @12345.6789 and want to find out if there
I have got a field that has been setup to allow for Null, but
I have got method which is using Assembly.LoadFrom(...) statement and returns the supported cultures
I have a CSV file the first row of which contains the variables names
I have a CSV file which the code below uses to put the contents
I have a large CSV file, approx 10 MB in size, which contains all
I have an issue that has got me pretty stumped, and would appreciate some

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.