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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:24:21+00:00 2026-06-18T00:24:21+00:00

In cor function , there is a wonderful argument the use (e.g. : use=na.or.complete

  • 0

In cor function , there is a wonderful argument the ” use “(e.g. : use=”na.or.complete” )

I tried to use the same argument with calculating RMSE or bias. It seems that it is not working.I wonder what we could use instead.

RMSE <- function(x, y){
sqrt(mean((x-y)^2))}
RMSE(x,y, use = "na.or.complete")
Error in RMSE(x,y, use = "na.or.complete") : 
unused argument(s) (use = "na.or.complete")
  • 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-18T00:24:22+00:00Added an answer on June 18, 2026 at 12:24 am

    The mean function to compute THE RMSE has an na.rm argument, You can use it like this :

    RMSE <- function (pred,obs,na.rm=FALSE){
       sqrt(mean((pred - obs)^2, na.rm = na.rm))
    }
    

    The na.rm argument can be used to mimic na.or.complete behavior since in almost cases , using na.or.complete option is equiavlent to remove NA value from the original pairs. For example :

    swM <- swiss[,1:2]
    swM[1,2] <-  NA 
    swM[1,1] <-  NA 
    identical(cor(swM, use = "na.or.complete"),
              cor(na.exclude(swM), use = "all"))
    TRUE
    

    With RMSE

    swM[1,2] <-  NA 
    swM[1,1] <-  NA 
    identical(RMSE(swM[,1],swM[,2],na.rm=T),
              RMSE(swM[,1],swM[,2],na.rm=F))
     FALSE
    

    EDIT set very small values to NA

    I don’know how you store your data. But I assume you have a data.table with a variable x. You can do something like this :

     dat$x[dat$x <= -3.4e+38] <- NA
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a by() function, I will use cor (correlation) to be the FUN there.
The cor() function fails to compute the correlation value if there are extremely big
Is there a package that contains Levenshtein distance counting function which is implemented as
In Delphi there is a function ExpandUNCFileName that takes in a filename and converts
Are there any C or C++ compilers out there that implement aggressive memory consistency
Possible Duplicate: Write a function that returns the longest palindrome in a given string
In c++ there is a function called atexit where you can register functions which
Is there any available C++ (or maybe C) function/class/library with only purpose to sanitize
Why shouldn’t extern C be specified for a function that needs to be defined
Is there a simple solution/idea/strategy to create a setTimeout equivalent function in a WinForms

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.