Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mattansb committed Dec 22, 2019
1 parent d883d26 commit 70acfa0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Create a list of files:
``` r
my_files <- list.files(path = '../doc', pattern = '.doc', full.names = T)
my_files
#> [1] "../doc/paper1 (1).docx" "../doc/paper1 (2).docx"
#> [3] "../doc/paper1 (3).docx" "../doc/paper2 (1).doc"
#> [1] "../doc/paper1 (1).docx" "../doc/paper1 (2).docx" "../doc/paper1 (3).docx"
#> [4] "../doc/paper2 (1).doc"
```

The first 3 documents are different drafts of the same paper, so we
Expand All @@ -56,23 +56,20 @@ The only function, `catch_em`, takes the following input arguments:

``` r
library(cheatR)
#> Registered S3 method overwritten by 'R.oo':
#> method from
#> throw.default R.methodsS3
#> Catch 'em cheaters!
results <- catch_em(flist = my_files,
n_grams = 10, time_lim = 1) # defults
#> Reading documents... Done!
#> Looking for cheaters
#> ===========================================================================
#> ================================================================================
#> Busted!
```

The resulting list contains a matrix with the similarity values between
each pair of documents:

``` r
knitr::kable(summary(results))
knitr::kable(results)
```

| | paper1 (1).docx | paper1 (2).docx | paper1 (3).docx | paper2 (1).doc |
Expand All @@ -86,8 +83,15 @@ You can also plot the relational graph if you’d like to get a more clear
picture of who copied from who.

``` r
plot(results, weight_range = c(0.7, 1))
#> Using `nicely` as default layout
plot(results, weight_range = c(0.7, 1), remove_lonely = FALSE)
#> Loading required package: tidygraph
#>
#> Attaching package: 'tidygraph'
#> The following object is masked from 'package:stats':
#>
#> filter
#> Loading required package: ggraph
#> Using `stress` as default layout
```

![](doc/cheater_graph-1.png)<!-- -->
Expand Down
Binary file modified doc/cheater_graph-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions vignettes/using-cheatR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ results <- catch_em(flist = my_files,
The resulting list contains a matrix with the similarity values between each pair of documents:

```{r}
knitr::kable(summary(results))
knitr::kable(results)
```

You can also plot the relational graph if you'd like to get a more clear picture of who copied from who.

```{r cheater_graph}
plot(results, weight_range = c(0.7, 1))
plot(results, weight_range = c(0.7, 1), remove_lonely = FALSE)
```

0 comments on commit 70acfa0

Please sign in to comment.