knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
library(deviz)

deviz

Codecov test coverage Lifecycle: experimental R-CMD-check

/dɪˈvaɪz/ (device + vizualisation)

Input device tracking and visualization in R

🖱️ + ⌨️   tracking and visualization in R. deviz wraps the the python package pynput, which allows us to collect the mouse movement and keyboard strokes data.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("marcosci/deviz")

Example

Mouse

Mouse movement tracking

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 movement

visualize_mouse(mouse_df, type = "dot")

Keyboard

Keyboard strokes tracking

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 mouse movement

visualize_keyboard(key_df)

Code of Conduct

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.



marcosci/deviz documentation built on Jan. 17, 2021, 1:14 a.m.