knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) library(deviz)
/dɪˈvaɪz/ (device + vizualisation)
🖱️ + ⌨️ tracking and visualization in R.
deviz wraps the the python package pynput
, which allows us to collect the mouse movement and keyboard strokes data.
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("marcosci/deviz")
If you want to track your mouse, just run:
library(deviz) mouse_df <- track_mouse("00h00m90s")
... this will track your mouse for 90 seconds, but also block your R console. If you use RStudio, the most convienent way to track your mouse movement with deviz
is to run track_mouse("00h00m90s", as_job = TRUE)
. This launches the function as an RStudio job, which at its end returns a mouse_df
object with the tracked data.
The returned contains information about the type of mouse input (movement, click, scroll) and further information about the specific event:
mouse_df
visualize_mouse(mouse_df, type = "dot")
Equivalent to the way we can track mouse movement, we can track the key strokes in a given time interval:
library(deviz) key_df <- track_keyboard("00h00m90s")
There is also the possibility to run this command as an RStudio Job.
visualize_keyboard(key_df)
Please note that the deviz project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.