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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:15:29+00:00 2026-06-08T17:15:29+00:00

I would like to smooth a time curve, that I have plotted, by applying

  • 0

I would like to smooth a time curve, that I have plotted, by applying a loess function, but I can’t get it to work.
An example:

mydat <- runif(50)
day1 <- as.POSIXct("2012-07-13", tz = "UTC")
day2 <- day1 + 49*3600*24
pdays <- seq(day1, day2, by = "days")
lo <- loess(mydat ~ pdays)

I get the following message:

Error: NA/NaN/Inf in foreign function call (arg 2)

Is it possible to apply a loess smoothing to a time series

Any help or guidance is greatly appreciated!

  • 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-08T17:15:30+00:00Added an answer on June 8, 2026 at 5:15 pm

    I think the idea here is to convert your time series in a numerical form (using as.numeric) so you can perform the operation.

    mydat <- runif(50)
    day1 <- as.POSIXct("2012-07-13", tz = "UTC")
    day2 <- day1 + 49*3600*24
    pdays <- seq(day1, day2, by = "days")
    lo <- loess(mydat ~ as.numeric(pdays))
    
    # And then if you want to plot the result:
    plot(pdays,mydat)
    lines(pdays, lo$fitted)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Would like a for loop in jquery so that: For every hover_link: show hidden
Would like to make anapplication in Java that will not automatically parse parameters used
I would like to implement a timeline, much like one you can find in
Very simple thing I'm trying to do here. I would like to have 2
I would like my plot axis title to include among the text a function
I would like to use a MATLAB function to find the minimum length between
I have a dataset with about 50 points (x,y) and I would like to
This might sound like a duplicate, but I have searched through the forum questions
I know I shouldn't be using that function, and I don't care. Last time
Is there a script/way, that makes normal CSS :hover more smooth? Idea would be,

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.