问题
I am trying to replicate this example of time series analysis in R using Keras
(see Here) and unfortunately I am receiving error message while computing first average rmes
coln <- colnames(compare_train)[4:ncol(compare_train)]
cols <- map(coln, quo(sym(.)))
rsme_train <-
map_dbl(cols, function(col)
rmse(
compare_train,
truth = value,
estimate = !!col,
na.rm = TRUE
)) %>% mean()
rsme_train
Error message:
Error in is_symbol(x) : object '.' not found
There are some helpful comments at the bottom of the post but new version of dplyr
doesn't help really. Any suggestion how to get around this?
回答1:
I stumbled upon the same problem, so here's a solution that is close to the original code.
The transformation for cols
is not necessary, because !!
works with the character vector already. You can change the code to
coln <- colnames(compare_train)[4:ncol(compare_train)]
rsme_train <-
map_df(coln, function(col)
rmse(
compare_train,
truth = value,
estimate = !!col,
na.rm = TRUE
)) %>%
pull(.estimate) %>%
mean()
rsme_train
You might also want to check for updates of tidyverse
, just to be sure.
来源:https://stackoverflow.com/questions/56594095/getting-error-message-while-calculating-rmse-in-a-time-series-analysis