Grapho is an R package for recording the commands and visualisations created in an R session. Functions are provided for parsing and visualising the user workflow.
Grapho is part of WAYS: What aren’t you seeing. The goal of this Turing funded research project is to ‘develop tools which enhance people’s capacity to visualise data, by letting them see what can and can’t be seen in the visualisation.’.
The version in this repository is currently under active development. A full release is forthcoming. Please see the roadmap for more details.
The package is written by Dr James Tripp and Dr Greg McInerny. Please contact James with any technical issues.
install the remotes package.
install.packages('remotes')
Then install the grapho package from github:
remotes::install_github('warwickcim/grapho')
Grapho will start recording a session once loaded using either
require(grapho)
or
library(grapho)
which will display a message welcoming you to the Grapho package. Grapho will now record your console commands, plots you create, errors and warnings.
You can view the files created by the grapho package by going to your Grapho folder location as shown in the introductory messages. Another way to get the location of the grapho folder is by running the below.
Sys.getenv('GRAPHO_FOLDER')
You can view a summary of the files contents of your grapho archive by running.
parse_grapho_archive()
You can stop and start grapho collecting data by running the command
toggle_grapho()
Part of the WAYS research project is to examine your workflow. Part of that is to collect anonymous data about your R session. If you wish to send us your data then please run the R command
prepare_archive()
which will zip up the files in your grapho archive, tell you the location of the zip file and the location of the form for you to submit the zip files to.
Your data is anonymous. Your files are identified with a session and user ID. Both the session and user ID are shown when you load in grapho. You can also view the current user ID by running
Sys.getenv('GRAPHO_USER_ID')
and get your current session ID by running the below.
Sys.getenv('GRAPHO_SESSION_ID')
The user ID is generated by running
user_hash <- digest::digest(
c(Sys.getenv('HOME'),
Sys.getenv('LANG'),
Sys.getenv('R_PLATFORM')),
algo = 'sha512'
)
Sys.setenv(
GRAPHO_USER_ID = substr(user_hash, 1, 40)
)
where a sha512 hash is generated from a combination of your home directory location, system language and the version of R you are using. Your user ID is the first 40 characters of the hash.
Your session ID is generated by running
session_hash <- digest::digest(
date(), algo = 'sha512'
)
Sys.setenv(
GRAPHO_SESSION_ID = substr(session_hash, 1, 40)
)
which takes the first 40 characters of an SHA512 has of the current date.