Skip to content

Commit 741ff20

Browse files
Reduced package size
1. Deleted inst/extdata/example_images 2. Replaced example_model and example_analysis with docs with writer IDs that contain numbers and letters. Updated all tests accordingly.
1 parent da301c8 commit 741ff20

30 files changed

+50
-180
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: handwriter
22
Title: Handwriting Analysis in R
3-
Version: 3.1.0.9000
3+
Version: 3.2.0
44
Authors@R: c(person("Iowa State University of Science and Technology on behalf of its Center for Statistics and Applications in Forensic Evidence", role = c("aut", "cph", "fnd")),
55
person("Nick", "Berry", role = "aut"),
66
person("Stephanie", "Reinders", role = c("aut", "cre"), email = "srein@iastate.edu"),

NEWS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# handwriter (development version)
1+
# handwriter 3.2.0
2+
3+
## Minor improvements and fixes
4+
5+
* The functions `fit_model()` and `analyze_questioned_documents()` now allow writer IDs that contain numbers and letters.
6+
27

38
# handwriter 3.1.0
49

R/RcppExports.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ cleanBinaryImage <- function(img) {
1616
#' getGraphInfo_cpp
1717
#'
1818
#' Gather and format the parameter values need to calculate the distance
19-
#'
19+
#' between ' two graphs.
20+
#'
2021
#' @param imageList1 A graph
2122
#' @param imageList2 A graph
2223
#' @param isProto1 True or false. Is the graph information in prototype format?
2324
#' @param isProto2 True or false. Is the graph information in prototype format?
2425
#' @param numPathCuts An integer number of cuts to make when comparing segments
25-
#'
26+
#' of paths ' @return List of formatted parameters
27+
#'
2628
#' @noRd
2729
getGraphInfo_cpp <- function(imageList1, imageList2, isProto1, isProto2, numPathCuts) {
2830
.Call(`_handwriter_getGraphInfo_cpp`, imageList1, imageList2, isProto1, isProto2, numPathCuts)

R/cluster_templates.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@
4444
#' @examples
4545
#' \dontrun{
4646
#' main_dir <- "path/to/folder"
47-
#' template_docs <- system.file("extdata/example_images/template_training_images",
48-
#' package = "handwriter"
49-
#' )
47+
#' template_docs <- "path/to/template_training_docs"
5048
#' template_list <- make_clustering_template(
5149
#' main_dir = main_dir,
5250
#' template_docs = template_docs,

R/data.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,17 @@
9595

9696
#' Example cluster template
9797
#'
98-
#' An example cluster template created from the template training example
99-
#' handwriting documents included in the package. These documents are located in
100-
#' `system.file("extdata/example_images/template_training_images", package =
101-
#' "handwriter")`. The cluster template was created with K=10 clusters and a
102-
#' small, random sample of 1000 graphs.
98+
#' An example cluster template created with [`make_clustering_template()`]. The
99+
#' cluster template was created from handwriting samples
100+
#' "w0016_s01_pLND_r01.png", "w0080_s01_pLND_r01.png", "w0124_s01_pLND_r01.png",
101+
#' "w0138_s01_pLND_r01.png", and "w0299_s01_pLND_r01.png" from the CSAFE Handwriting
102+
#' Database. The template has K=5 clusters.
103103
#'
104104
#' @format A list containing a single cluster template created by
105-
#' [`make_clustering_template()`]. The cluster template was created by
106-
#' sorting a random sample of 1000 graphs from 10 training documents into 10
107-
#' clusters with a K-means algorithm. The cluster template is a named list
108-
#' with 16 items:
105+
#' [`make_clustering_template()`]. The cluster template was created by sorting
106+
#' a random sample of 1000 graphs from 10 training documents into 10 clusters
107+
#' with a K-means algorithm. The cluster template is a named list with 16
108+
#' items:
109109
#' \describe{
110110
#' \item{seed}{An integer for the random number generator.}
111111
#' \item{cluster}{A vector of cluster assignments
@@ -135,7 +135,7 @@
135135
#' # view cluster fill counts for template training documents
136136
#' template_data <- format_template_data(example_cluster_template)
137137
#' plot_cluster_fill_counts(template_data, facet = TRUE)
138-
#'
138+
#'
139139
#' @md
140140
"example_cluster_template"
141141

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Use `processDocument()` to
5656
library(handwriter)
5757
phrase <- system.file("extdata", "phrase_example.png", package = "handwriter")
5858
doc <- processDocument(phrase)
59-
#> path in readPNGBinary: /private/var/folders/1z/jk9bqhdd06j1fxx0_xm2jj980000gn/T/RtmpEwGR3a/temp_libpathb4fe4d792ef7/handwriter/extdata/phrase_example.png
59+
#> path in readPNGBinary: /private/var/folders/1z/jk9bqhdd06j1fxx0_xm2jj980000gn/T/RtmplsdN6z/temp_libpath947954bb6036/handwriter/extdata/phrase_example.png
6060
#> Starting Processing...
6161
#> Getting Nodes...
6262
#> Skeletonizing writing...
@@ -288,7 +288,7 @@ View a description of a variable with the `about_variable` function.
288288

289289
``` r
290290
about_variable(variable = "mu[1,1]", model = model)
291-
#> [1] "Mu is the location parameter of a wrapped-Cauchy distribution for writer ID 9 and cluster 1"
291+
#> [1] "Mu is the location parameter of a wrapped-Cauchy distribution for writer ID w0009 and cluster 1"
292292
```
293293

294294
View a trace plot of a variable.
@@ -374,10 +374,10 @@ View the posterior probabilities of writership.
374374

375375
``` r
376376
analysis$posterior_probabilities
377-
#> known_writer w0030_s03_pWOZ_r01
378-
#> 1 known_writer_9 0
379-
#> 2 known_writer_30 1
380-
#> 3 known_writer_238 0
377+
#> known_writer w0030_s03_pWOZ_r01
378+
#> 1 known_writer_w0009 0
379+
#> 2 known_writer_w0030 1
380+
#> 3 known_writer_w0238 0
381381
```
382382

383383
#### For Research Only

data-raw/example_data.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ make_example_model <- function(main_dir){
3737
num_iters = 200,
3838
num_chains = 1,
3939
num_cores = 5,
40-
writer_indices = c(2, 5),
40+
writer_indices = c(1, 5),
4141
doc_indices = c(7, 18))
4242
# save to data folder
4343
usethis::use_data(example_model, overwrite = TRUE)
@@ -51,7 +51,7 @@ make_example_analyses <- function(main_dir, num_cores = 5) {
5151
questioned_docs = questioned_docs,
5252
model = example_model,
5353
num_cores = num_cores,
54-
writer_indices = c(2, 5),
54+
writer_indices = c(1, 5),
5555
doc_indices = c(7, 18))
5656

5757
usethis::use_data(example_analysis, overwrite = TRUE)

data/example_analysis.rda

-15 Bytes
Binary file not shown.

data/example_model.rda

-49 Bytes
Binary file not shown.
-34.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)