hrbrmstr / darksky

:cloud: R interface to the Dark Sky API [APPLE IS SHUTTING DOWN THE API 2022-12-31]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mutate Each Warnings Prevent Automation

DamonWoods opened this issue · comments

Whether I run the get_current_Forecast or the get_forecast_for function, I end up with the following warnings:

mutate_each() is deprecated.
Use mutate_all(), mutate_at() or mutate_if() instead.
To map funs over a selection of variables, use mutate_at()

These are the only warnings that appear, and while I can still write a *.csv when I run this once in RStudio, these warnings prevent the writing of a *.csv any time I try to automate the process using Windows Task Scheduler. Is there a solution that avoids these warning errors?

Investigating further, it appears that the failure may be due to the script not receiving my API key. The script runs when I explicitly define the API key in my Rscript when I run the full script in RStudio. However, for whatever reason, this line is not picked up when I try to run task scheduler. Instead it tries to get it from the environment.

In my R-script where I try to run my get_forecast function, I have an earlier line that is:
env <- Sys.getenv("FORECASTIO_API_KEY")

I have created a file called ".Renviron" and saved it to my User/Documents/R folder. In that file I only have the line FORECASTIO_API_KEY=myuniquekey123

Where am I going wrong?

Can you try the github version? There are no dplyr dependencies in it.