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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:22:07+00:00 2026-05-27T05:22:07+00:00

I am looking at data from a device that spends much of its time

  • 0

I am looking at data from a device that spends much of its time underwater. When it surfaces, it gets a GPS fix (lat & lon) and then sinks (losing its GPS fix) and continues gathering data again until its next surfacing. This results in a lot of NA values in the data for the lat lon values and they don’t coincide with the underwater data readings.

I’d like to create a curtain plot of the data but I’ll need some interpolated lat/lon values to do a rough plot of the subsurface data against for a 3D map.

How can I fill in some linearly interpolated values for the many NA’s that occur in between GPS fixes in R? They are in numeric DD.DDDDD format.

An example of the data can be found at: http://modata.ceoe.udel.edu/public/gps_example_data.csv

  • 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-27T05:22:08+00:00Added an answer on May 27, 2026 at 5:22 am

    na.approx() in the zoo package does just what you’re looking for.

    With your data, do something like:

    df <- read.csv("http://modata.ceoe.udel.edu/public/gps_example_data.csv", 
                   header=T)
    
    library(zoo)
    
    df2 <- 
    transform(df, 
        m_gps_lat_dec = na.approx(m_gps_lat_dec, m_present_time, na.rm=FALSE),
        m_gps_lon_dec = na.approx(m_gps_lon_dec, m_present_time, na.rm=FALSE))
    

    See also this StackOverflow post, which includes a nice worked example (and some useful comments from an author of the zoo package, to boot.)

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

Sidebar

Related Questions

We use a data acquisition card to take readings from a device that increases
I've been looking quite some time today to gather GPS coordinates from a Windows
I want to write an application that reads data from the USB device and
Looking to move data from a table A to history table B every X
When looking to get data from a web page whats the recommended method if
I am looking at storing some JMX data from JVMs on many servers for
I'm looking for access to financial data from Google services. I found this URL
I'm looking for (arguably) the correct way to return data from a XmlHttpRequest .
I am looking for a way to extract / scrape data from Word files
I’m looking for some feedback on mechanisms to batch data from MySQL Community Server

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.