Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/marcosci/deviz

🖱️ + ⌨️ tracking and visualization in R
https://github.com/marcosci/deviz

ggplot2 inputdevice pynput r visualization

Last synced: 2 months ago
JSON representation

🖱️ + ⌨️ tracking and visualization in R

Awesome Lists containing this project

README

        

---
output: github_document
---

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

# deviz

[![Codecov test coverage](https://codecov.io/gh/marcosci/deviz/branch/master/graph/badge.svg)](https://codecov.io/gh/marcosci/deviz?branch=master)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![R-CMD-check](https://github.com/marcosci/deviz/workflows/R-CMD-check/badge.svg)](https://github.com/marcosci/deviz/actions)

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

## Input device tracking and visualization in R

🖱️ + ⌨️   tracking and visualization in R.
deviz wraps the the python package [`pynput`](https://pynput.readthedocs.io/en/latest/index.html), which allows us to collect the mouse movement and keyboard strokes data.

## Installation

You can install the development version from [GitHub](https://github.com/) with:

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

## Example

### Mouse

#### Mouse movement tracking

If you want to track your mouse, just run:

```{r, eval=FALSE}
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:

```{r}
mouse_df
```

### Visualize mouse movement

```{r}
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:

```{r, eval=FALSE}
library(deviz)
key_df <- track_keyboard("00h00m90s")
```

There is also the possibility to run this command as an RStudio Job.

### Visualize mouse movement

```{r, fig.height=6, fig.width=12, dpi=300}
visualize_keyboard(key_df)
```

## Code of Conduct

Please note that the deviz project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.