Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running TaskscheduleR on RStudio Project #89

Closed
msgoussi opened this issue Mar 11, 2022 · 3 comments
Closed

running TaskscheduleR on RStudio Project #89

msgoussi opened this issue Mar 11, 2022 · 3 comments

Comments

@msgoussi
Copy link

Create a "Trial.proj" via RStudio
Create Script "A.R"
setwd(rstudioapi::getActiveProject())
rm(list = ls())
x <- 1:5
Create Script "B.R"
source("A.R", chdir = TRUE)
y <- x^2
write(y, "D:/sample_nums.txt")

can i use the package to run Script B which exists inside a project?

@jwijffels
Copy link
Collaborator

taskscheduleR is not linked to RStudio projects, you don't need RStudio to schedule R scripts with the taskscheduleR package.
My preference is to use environment variables instead of rstudioapi::getActiveProject as the latter won't work when you schedule a task using the windows task scheduler.
See issues #60

You can use source, but provide the full path to a file.

@msgoussi
Copy link
Author

I have read your issues #60 and i tried to edit Enviroment Variables in Windows 10 (both user variables and System variables) and i fialed to run the task.
Is possible to create a dummy exmaple for explanation.?

@jwijffels
Copy link
Collaborator

I think the best place to ask these questions is stackoverflow. The issue tracker here is mainly for bugs not for how-to-do-things. Stackoverflow is the best channel there. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants