🤯 for years I thought automating R scripts would be challenging and never really looked into it...until now. literally the first thing I found and within 15 minutes I have my automation set up. Thank you.
@quantroom2 жыл бұрын
Happy to help!
@rmathew7333 жыл бұрын
Explained in a simple and excellent way. I really appreciate!!!
@quantroom3 жыл бұрын
Glad it was helpful!
@ramadajani5933 жыл бұрын
@@quantroom Hi thanks a lot for the video, I followed the steps but when I start testing the running, the command prompt closes immediately what is the reason you think?
@quantroom3 жыл бұрын
@Rama Dajani Try running the R-Script you have scheduled manually in RStudio/R to make sure it is free from errors. If all is good there, check the *bat* file to make sure you have correctly specified the path to your R-script & the version of R. I also usually also put print() messages throughout the script so I make it is running and can pin-point where it crashes.
@nv37963 жыл бұрын
Just what I needed. Liked and Subscribed :)
@quantroom3 жыл бұрын
Thank You
@emmanuelteitelbaum2 жыл бұрын
Have you used the taskscheduleR package or add-on in R Studio? If so, what do you think of it? Also, what if your computer is asleep? Will it wake up to run the script?
@quantroom2 жыл бұрын
I haven't used that package, but I think the method used in this script can be modified in the task Scheduler to run even if the computer is asleep.
@adamodonnell8 ай бұрын
Curious why you used a bat file instead of just setting task scheduler to run rscript (with script path as an argument). That's the way I've done it for years. Didn't know if you had found an advantage in using the bat file.
@quantroom7 ай бұрын
Just an alternative way to schedule R-scripts on Windows. I think I have used this method long before that package was available.
@bilalarif78412 жыл бұрын
Appreciate this! Will definitely sub.
@quantroom2 жыл бұрын
Thanks for the sub!
@James_198082 жыл бұрын
Thanks @JasonR it was a really great video. Is there anyway to create something like this to refresh a powerbi desktop if you have files connected local. PowerBi has a refresh but only for SQL or online connections not for desktop refreshing.
@quantroom2 жыл бұрын
Thanks for your comment, I am unfamiliar with PowerBi but maybe you can get an answer from StackOverflow.
@hareboll2 жыл бұрын
Did you ever get this to work? Trying to do the exact same thing
@mateobartra15023 жыл бұрын
Hi, I did the same but instead of running the black command tab it asks me how to open the file, after selecting rstudio, it opens but it doesn't open my script
@quantroom3 жыл бұрын
Hello, please make sure you are not missing any steps. If it loads the black screen it usually will print out the error you are getting. On the *.bat* file specify the version of R you are using, not the one in this video as you probably have a newer version than the one in the video. Also, make sure you specify the exact path to the Rscript you want to automate. You can modify the *.bat* file by right clicking on it and opening it on a text editor.
@pedrocampos78122 жыл бұрын
0:30 Why setting an library.path
@quantroom2 жыл бұрын
I don't remember specifically why, but it may have been an issue at the time.
@lonaxue6866 Жыл бұрын
i don't know why the result wasn't shown on my side, this is my batch file @echo oFF C: PATH "C:\Program Files\R\R-4.2.1\bin\x64" cd "S:\ERPA\Live Data Repository\Data_MassDL\English Version - OECD\Code -English Version -OECD-Raw data" Rscript "OECD.R" pause Can you help me to point out if I wrote anything wrong, THANK YOU!
@quantroom Жыл бұрын
I am not sure, depends on the error you are getting. I don't use quotations around the Rscript "OECD.R" or after cd Try making sure your Rscript runs without errors by sourcing: source("OECD.R") or by running it using the "background jobs" in RStudio.
@gardo803 жыл бұрын
It worked for me!! Thank you!
@quantroom3 жыл бұрын
Glad it helped!
@dubjoyce Жыл бұрын
Super useful thanks
@quantroom Жыл бұрын
Glad it was useful!
@marcosmetalmind2 жыл бұрын
Very good ! Thanks!
@quantroom2 жыл бұрын
Glad it helped!
@diligacosmas67673 жыл бұрын
What if it's a github package? How do you call the repo?
@quantroom3 жыл бұрын
You would need to install *devtools* and then also the package for example: *require("devtools")* *devtools::install_github("jestonblu/RobinHood")*
@BlueQualityRhythm2 жыл бұрын
You only need to setwd() if you are not using an R- project. This is bad in my opinion as the path only works on your machine. Using an R- project allows you to copy your project anywhere and the paths will just relate to the project folder, wherever it is.
@quantroom2 жыл бұрын
Yes, although I rather set the working directory instead of writing the full path of files/items within the working directory.