Sorry about this. So, I have attempted to use reprex but because I am running R on a Linux server that isn't mine, I can't get the xclip to install and when I run reprex I get an error saying that X11 requires xclip, and I don't have access to install that.
No input provided and clipboard is not available.
Rendering reprex...
Clipboard on X11 requires 'xclip' (recommended) or 'xsel'.
Unable to put result on the clipboard'
For my original problem:
I have the following libraries installed:
library(tidyverse)
library(caret)
library(data.table)
library(lubridate)
library(knitr)
library(ggplot2)
The code I am running when I get the error is:
RMSE <- function(predicted_ratings, true_ratings){
sqrt(mean((predicted_ratings - true_ratings)^2))
}
# Calculated Predicted Ratings with Movie Effect
predicted_ratings <- mu + edx_test %>
left_join(movie_avgs, by='movieId') %>%
.$b_i
# Calculate Predicted Ratings with Movie Effect
predicted_ratings <- mu + edx_test %>%
left_join(movie_avgs, by='movieId') %>%
.$b_i
# Calculate RMSE for Movie Effect Term Plus Mean (Mu)
RMSE_2 <- RMSE(predicted_ratings, edx_test$rating, na.rm = TRUE)
The error I get from this code is:
Error in RMSE(predicted_ratings, edx_test$rating, na.rm = TRUE) :
unused argument (na.rm = TRUE)