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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:25:25+00:00 2026-06-13T20:25:25+00:00

I have two sets of data with different time stamps. One set of data

  • 0

I have two sets of data with different time stamps. One set of data contains calibration data, the other contains sample data. The calibration is much less frequent than the samples.

What I would like to do is interpolate the calibration data (low freq) onto the sample time series (high freq).

sam <- textConnection("time, value
01:00:52, 256
01:03:02, 254
01:05:23, 255
01:07:42, 257
01:10:12, 256")

cal <- textConnection("time, value
01:01:02, 252.3
01:05:15, 249.8
01:10:02, 255.6")

sample <- read.csv(sam)

sample$time <- as.POSIXct(sample$time, format="%H:%M:%S")

calib <- read.csv(cal)

calib$time <- as.POSIXct(calib$time, format="%H:%M:%S")

The big problem (that I see) is that the freq of the data changes randomly.

Have any of you had to do similar things? Is there a chron or zoo function which would do what I want (interpolate low freq data onto higher freq data where both ts are random)?

  • 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-13T20:25:26+00:00Added an answer on June 13, 2026 at 8:25 pm

    I would use zoo (or xts) and do it like this:

    library(zoo)
    # Create zoo objects
    zc <- zoo(calib$value, calib$time)    # low freq
    zs <- zoo(sample$value, sample$time)  # high freq
    # Merge series into one object
    z <- merge(zs,zc)
    # Interpolate calibration data (na.spline could also be used)
    z$zc <- na.approx(z$zc, rule=2)
    # Only keep index values from sample data
    Z <- z[index(zs),]
    Z
    #                      zs       zc
    # 2012-10-25 01:00:52 256 252.3000
    # 2012-10-25 01:03:02 254 251.1142
    # 2012-10-25 01:05:23 255 249.9617
    # 2012-10-25 01:07:42 257 252.7707
    # 2012-10-25 01:10:12 256 255.6000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two types of data sets. Both are in same size. One contains
Have two sets of data (two tables) for patient records, one 1999-2003, the other
I have two data sets, each dataset contains the pixel values of an image.
In our application, we have two sets of tables: One set of working tables
I have two constructors for an objects, which use two different sets of data.
I have a UIPickerView which will be loaded with two different data sets based
I have two functions to submit to different sets of data to the same
I have two sets of data, (Ax, Ay; Bx, By). I'd like to plot
I have two data sets in google app engine datastore. class First_Set(db.Model): start_time =
I have two Sets. Set b is the subset of Set a . they're

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.