5
Skills Sharing: Batch files to graph with R GLEON Fellowship Workshop January 14-18, 2013 Sunapee, NH Hilary Dugan

Skills Sharing: Batch files to graph with R GLEON Fellowship Workshop January 14-18, 2013 Sunapee, NH Hilary Dugan

Embed Size (px)

Citation preview

Page 1: Skills Sharing: Batch files to graph with R GLEON Fellowship Workshop January 14-18, 2013 Sunapee, NH Hilary Dugan

Skills Sharing:Batch files to graph with R

GLEON Fellowship WorkshopJanuary 14-18, 2013

Sunapee, NHHilary Dugan

Page 2: Skills Sharing: Batch files to graph with R GLEON Fellowship Workshop January 14-18, 2013 Sunapee, NH Hilary Dugan

Batch file to run R script

• Any R script can be run. • In my example, my R script outputs a .pdf with

two barplots• I wanted the .pdf to be updated daily without

the user having to open R.

Page 3: Skills Sharing: Batch files to graph with R GLEON Fellowship Workshop January 14-18, 2013 Sunapee, NH Hilary Dugan

Skill relevance/usefulness

• Extremely useful for remotely accessed data• Easiest way to quickly view updated data files

Page 4: Skills Sharing: Batch files to graph with R GLEON Fellowship Workshop January 14-18, 2013 Sunapee, NH Hilary Dugan

Application to data

• The data files are updated daily, but header information remains the same (important)

• Challenges:– Different operating systems!

Page 5: Skills Sharing: Batch files to graph with R GLEON Fellowship Workshop January 14-18, 2013 Sunapee, NH Hilary Dugan

Share and visualize results • Batch file for Windows 7• Write in notepad. Save as

“NAME.bat”

"C:\Program Files\R\R-2.15.2\bin\x64\R.exe" CMD BATCH "D:\h.dugan\...\BB_sonar.r" "D:\...\Sonar.out”