I am trying to reproduce my current project and create a master document (eventually a .rmd file) that will be used to invoke and execute several other documents. Thus, I and other researchers should only open and run one file.
The current configuration includes three levels: the main file, 2 files for reading, 2 databases. The main file calls the read-in files using source (), and the read-in files parse the .csv databases and apply labels.
Reading files and databases are automatically generated using the data management software that I use (REDCAP) every time I download updated data.
However, there is a line of code in the read files that deletes all the objects in my environment. I would like to edit reading files directly from the main file, so I don’t have to open reading files every time I run my report. In particular, since all the files to read are the same, I would like to delete line # 2 in each.
I tried searching google and tried file.edit () but couldn't find anything. I'm not even sure that this is possible, but thought that I would ask. Let me know if I can improve this question or if you need any additional code to answer it. Thank!
Current relevant master code (edited for generality):
source("read-in1")
source("read-in2")
The current current code of the file to read (the same in each file, except for the database name):
rm(list=ls())
graphics.off()
library(Hmisc)
data=read.csv('database.csv')
[reading code truncated]
:
: Windows 7 Professional x86
R: 3.1.3
R Studio version: 0.99.441