By obewanjacobi


2019-08-13 20:00:49 8 Comments

I am attempting to make an R script that will write a csv file to my working directory daily for me to check. I am trying to use the taskscheduleR package to do so, but it isn't behaving how I expected. Below is my code:

print("Running the Missing-Data Checker now.")

source('./functions/missing_data_checker.R') # this file contains a function 
                                             # to read in the data I need

dats = missing_chkr(as.character(Sys.Date()-30)) # the afformentioned function
missings = dats$missing_dats
rm(dats)

write.csv(missing, 'Missing_Data.csv', row.names = FALSE)

print("The job has been run.)

To schedule the task, I simply use the code

taskscheduler_create('missing_data_check','./daily_missingdata_check.R', 
                     "ONCE", starttime = format(Sys.time() + 3700, "%H:%M"))

When the tasks runs, I see a window open up, but nothing happens. No csv files are written, and I don't think it even reads in the data. Any help on this topic would be greatly appreciated. Thanks!

0 comments

Related Questions

Sponsored Content

12 Answered Questions

[SOLVED] Write lines of text to a file in R

  • 2010-03-18 13:51:59
  • amarillion
  • 297801 View
  • 327 Score
  • 12 Answer
  • Tags:   file-io r

7 Answered Questions

[SOLVED] Run R script from command line

  • 2013-08-19 04:23:21
  • Sait
  • 693096 View
  • 448 Score
  • 7 Answer
  • Tags:   r command-line

2 Answered Questions

[SOLVED] Read and write csv.gz file in R

  • 2013-12-16 11:25:48
  • Maximilian
  • 13040 View
  • 5 Score
  • 2 Answer
  • Tags:   r gzip

1 Answered Questions

[SOLVED] Loop through subfolders and extract data from CSV files

  • 2018-03-30 09:30:25
  • user1969717
  • 644 View
  • 0 Score
  • 1 Answer
  • Tags:   r

1 Answered Questions

[SOLVED] How to create a dataframe whose name is stored in a vector

2 Answered Questions

[SOLVED] R Programming - Prevent "apply" from repeating results beyone the range of data

  • 2013-04-11 14:39:50
  • Jonathan Ross Charlton
  • 60 View
  • 0 Score
  • 2 Answer
  • Tags:   r apply records

Sponsored Content