Create bat file from R script and set to run automatically

Good day,

I would like to set a script to run automatically as a .bat file.

I am trying to get with all the information provided, but I am still not getting through.

Is is possible that I can get some assistance?
Current part of the script that I have is:

{setwd("C:path working directory");

library(dplyr)

DataImport<- read.csv("12356789.csv", header = TRUE, sep = ",")
hh <- DataImport %>% select(SbjNum,
Date,
Srvyr,
PAR_BPNUM_NR_AKO,
PAR_HHPART_CN_AKO,
PAR_INTERVIEW_NR_AKO,
PAR_HHSIZE_NR_AKO,
PAR_NONREASON_CN_AKO,
PAR_NONREASON_TX_AKO,
PAR_BUSNAME_TX_AKO,
PAR_VISIT1_DT_AKO,
PAR_ATTEMPT2_CN_AKO,
PAR_VISIT2_DT_AKO,
PAR_ATTEMPT3_CN_AKO,
PAR_VISIT3_DT_AKO,
Status)
hh[is.na(hh)] <-""
write.csv(hh, '12356.csv')
path2<- "C:directory path to save the file"
write.csv(hh, paste0(path2,"/12356.csv"))
}

Many thanks in advance for assistance.

Regards,

Hi @CBSIT,
This blog post should help you to schedule an R script to run automatically.

https://theautomatic.net/2020/05/12/how-to-schedule-r-scripts/?utm_source=rss&utm_medium=rss&utm_campaign=how-to-schedule-r-scripts

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.