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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:51:07+00:00 2026-06-03T14:51:07+00:00

Used to run R with numbers and matrix, when it comes to play with

  • 0

Used to run R with numbers and matrix, when it comes to play with strings and characters I am lost. I want to analyze some data where the time is read into R as follow:

>my.time.char[1]
[1] "\"2011-10-05 15:55:00\"" 

I want to end up with a string containing only:

"2011-10-05 15:55:00"

Using the function sub() (that i barely understand…), I got the following result:

> sub("(\")","",my.time.char[1])
[1] "2011-10-05 15:55:00\""

This is closer to the format i am looking for, but I still need to get rid of the two last characters (\").

  • 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-03T14:51:10+00:00Added an answer on June 3, 2026 at 2:51 pm

    The second line from ?sub explains:

    sub and gsub perform replacement of the first and all matches respectively.

    which should tell you to use gsub instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a controller program used to run a humanoid kidsize robot. The OS
We have an older VB6 application that used to run under various user's accounts.
I have two batch files which is used to run a large C++ build,
If you were to build a processor that would be used to run any
In oracle database, command host can be used to run bash command from database
I'm trying to debug an objective C program. It used to run, and I'm
I used hadoop to run map-reduce applications on our cluster. The jobs take around
I used a loop in my php script to run insert queries into my
I used ssh to connect to my EC2 ubuntu. I then run a command
I'm trying to run tests for my webapp. I've used Spring and Hibernate for

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.