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

  • Home
  • SEARCH
  • 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 8006761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:37:14+00:00 2026-06-04T17:37:14+00:00

I have this time series data: timestamp depth from_sensor_to_river_bottom Depth_from_river_surface_to_bottom 1 2012-05-23 18:30:12-05 16.4

  • 0

I have this time series data:

     "timestamp"          "depth" "from_sensor_to_river_bottom" "Depth_from_river_surface_to_bottom"
"1" "2012-05-23 18:30:12-05" 16.4 17.16 0.760000000000002
"2" "2012-05-23 18:15:08-05" 16.38 17.16 0.780000000000001
"3" "2012-05-23 18:00:03-05" 16.39 17.16 0.77
"4" "2012-05-23 17:45:13-05" 16.35 17.16 0.809999999999999
"5" "2012-05-23 17:30:08-05" 16.37 17.16 0.789999999999999

I am using the following code:

d <- read.table(Name[1], header=TRUE)  #Name[1] is text file containing data

d <- read.zoo(d,
 format="'%Y-%m-%d %H:%M:%S'", 
 FUN=as.POSIXct  )

Its giving me this error:

Error in read.zoo(d, format = "'%Y-%m-%d %H:%M:%S'", FUN = as.POSIXct) : 
 index has 5 bad entries at data rows: 1 2 3 4 5

I wish to get help on this problem.
Thank you for your consideration.

  • 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-04T17:37:16+00:00Added an answer on June 4, 2026 at 5:37 pm

    This works on the data in the post provided its OK to ignore the -05 at the end of each date/time. (To read from a file use something like the commented out line.)

    Lines <- '"timestamp"          "depth" "from_sensor_to_river_bottom" "Depth_from_river_surface_to_bottom"
    "1" "2012-05-23 18:30:12-05" 16.4 17.16 0.760000000000002
    "2" "2012-05-23 18:15:08-05" 16.38 17.16 0.780000000000001
    "3" "2012-05-23 18:00:03-05" 16.39 17.16 0.77
    "4" "2012-05-23 17:45:13-05" 16.35 17.16 0.809999999999999
    "5" "2012-05-23 17:30:08-05" 16.37 17.16 0.789999999999999'
    
    library(zoo)
    # z <- read.zoo("myfile.txt", tz = "")
    z <- read.zoo(text = Lines, tz = "")
    

    The output from the above code is:

    > z
                        depth from_sensor_to_river_bottom Depth_from_river_surface_to_bottom
    2012-05-23 17:30:08 16.37                       17.16                               0.79
    2012-05-23 17:45:13 16.35                       17.16                               0.81
    2012-05-23 18:00:03 16.39                       17.16                               0.77
    2012-05-23 18:15:08 16.38                       17.16                               0.78
    2012-05-23 18:30:12 16.40                       17.16                               0.76
    

    For more info try ?read.zoo and ?read.table and also vignette(“zoo-read”). The last one is an entire document focused on giving read.zoo examples.

    EDIT: Added links to commentary.

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

Sidebar

Related Questions

i have a time series data like this: x <- structure(list(date = structure(c(1264572000, 1266202800,
I have a time series data that can plot using: plot(x$numbers, type=l, col=blue) I
I have a time series like this which consists of past 4 months (Feb,
I have a series of if statements in a function like this: if time
I have a long numerical time series data of approximately 200,000 rows (lets call
I have a (C#) genetic program that uses financial time-series data and it's currently
I've been using SQL Server to store historical time series data for a couple
I have some time-series data that I'm fitting a loess curve in ggplot2, as
I have a set of actions that are returning time-series data with-in ranges specifiable
I have a time series of data where the measurements are all integers between

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.