Learn R Programming

valueprhr (version 0.1.0)

safe_rmse: Safe RMSE Calculation

Description

Calculates Root Mean Squared Error handling non-finite values.

Usage

safe_rmse(actual, predicted)

Value

A single numeric value for RMSE, or NA if calculation not possible.

Arguments

actual

Numeric vector of actual values.

predicted

Numeric vector of predicted values.

Examples

Run this code
actual <- c(1, 2, 3, 4, 5)
predicted <- c(1.1, 2.2, 2.9, 4.1, 5.2)
safe_rmse(actual, predicted)

Run the code above in your browser using DataLab