A program written in R to create monthly reports of eResearch Analyst activities for the benefit of reporting to members.
Standard execution:
Rscript era_report.R
The program will run looping over all eRAs and generating a report for each. The reports are created for the previous month of work.
Rscript era_report.R MM YYYY
The program can take arguments for a specific month and year for the specific month you want the report to capture. This ability means that the program can be run retrospective or, e.g., even in a loop of months across a whole year.
You can also give a third argument which is optional, if you want to run the script for just one person. This is how it would look:
Rscript era_report.R MM YYYY era@intersect.org.au
Please read the advice on using your calendar before doing anything else: calendar_advice
For all other variables (e.g., your name, institution, etc), the program goes off an authority file on Intershare. Please make sure you have updated your details there.
If you are going to be the designated "report runner", there's a few things you'll need to do to get set up.
set_up.R
Enable APIs and Services
Enable
the Google Calendar API
, Gmail API
, Google Sheets API
and Google Drive API
for this ProjectCredentials
and click on Create credentials
and select Create OAuth client ID
Other
.Name
.era_report
directory and make sure its name starts with client_secret
.You will have to interactively authenticate the program the first time you run it. This effectively just means that you have to press a few buttons in the web browser as it pops up.
To do this, run:
Rscript authing.R
R/
directory holding the program in the terminalera_report.R
script.If you wish to set this up as a cron job, then you can use the run_report.sh
script. Running this script will record the time for each runs in log.txt
.
2.0 now does this for all eRAs and adds the monthly events to a running datasheet that can be used for MVR quarterly and annual reports. 1.0 was designed to only run for one eRA at a time.
Both 1.0 and 2.0 can be run the same way.
Error in httpuv::startServer(use$host, use$port, list(call = listen)) : Failed to create server
- this most likely means that you have a zombie port that's open. The Google API relies on talking to port 1410. To kill this zombie port: run sudo lsof -i :1410
to see which port is open, then run kill $(lsof -t -i :1410)
to kill it.