diff --git a/DESCRIPTION b/DESCRIPTION index 7f7063f..973db13 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: stemmatology Type: Package Title: Stemmatological Analysis of Textual Traditions -Version: 0.3.1 -Date: 2018-05-25 +Version: 0.3.2 +Date: 2019-03-28 Author: Jean-Baptiste Camps ; Florian Cafiero Maintainer: Jean-Baptiste Camps Description: Explore and analyse the genealogy of textual or musical traditions, from their variants, with various stemmatological methods, mainly the disagreement-based algorithms suggested by Camps and Cafiero (2015) . diff --git a/NAMESPACE b/NAMESPACE index 74c967b..82786d1 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,8 +1,5 @@ -exportPattern("^[^\\.]") # This exports everything from stemmatology -# namespace that does not start with a dot. If at some point we -# want a more explicit listing, we might use export(PCC, PCC.Exploratory…) +exportPattern("^[^\\.]") importFrom("graphics", "axis", "barplot", "plot","title") -# It would be possible to remove stats import with a few modifications (only 2 uses) importFrom("stats", "fisher.test", "na.omit") importFrom("cluster", "pam") importFrom("igraph", "graph_from_edgelist", "layout_as_tree", "layout_with_fr", "plot.igraph", "E", "union", "topo_sort","V","neighbors", "as_adjacency_matrix") diff --git a/R/PCC.conflicts.R b/R/PCC.conflicts.R index dcd87a8..b6d40f0 100644 --- a/R/PCC.conflicts.R +++ b/R/PCC.conflicts.R @@ -6,7 +6,7 @@ PCC.conflicts <- # TODO: perhaps better, for alternateReadings, to create as many # new rows as necessary, at the start, and avoid code redundancy # as well as many small inflexions to the code due to the fact - # that we need to cross VL with themselves if alternate… + # that we need to cross VL with themselves if alternate. # it could also make the network more legible. # This could even be ported into a different function, # for separate use. diff --git a/R/PCC.equipollent.R b/R/PCC.equipollent.R index f39f544..b6dce18 100644 --- a/R/PCC.equipollent.R +++ b/R/PCC.equipollent.R @@ -61,7 +61,7 @@ PCC.equipollent <- # configurations in which some members are in conflict between # themselves, in which case we will remove them. # In order for that to work, we need to deduplicate problematic - # configurations into unproblematic ones… Harder than it looks + # configurations into unproblematic ones... Harder than it looks toBeRemovedAsWell = as.vector(NULL) #If there is more than two members for (l in seq_len(length(notInConflict))) { diff --git a/R/import.TEIApparatus.R b/R/import.TEIApparatus.R index 127554e..170946b 100644 --- a/R/import.TEIApparatus.R +++ b/R/import.TEIApparatus.R @@ -39,7 +39,7 @@ import.TEIApparatus <- myRdgWits = sub("^\\s+|\\s+$", "", myRdgWits) myRdgWits = strsplit(myRdgWits, "\\s+") myRdgVars = NULL - # 0 for omission, 1…n for readings + # 0 for omission, 1...n for readings for (j in seq_len(length(myRdgs))) { if (xml2::xml_text(myRdgs[j], "normalize-space(.)") == "") { myRdgVars = c(myRdgVars, 0) diff --git a/README.md b/README.md index b7e72d0..418db9f 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,15 @@ [![Coverage Status](https://img.shields.io/codecov/c/github/Jean-Baptiste-Camps/stemmatology/master.svg)](https://codecov.io/github/Jean-Baptiste-Camps/stemmatology?branch=master) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/stemmatology)](https://cran.r-project.org/package=stemmatology) [![DOI](https://zenodo.org/badge/21941228.svg)](https://zenodo.org/badge/latestdoi/21941228) +[![metacran downloads](https://cranlogs.r-pkg.org/badges/grand-total/stemmatology)](https://cran.r-project.org/package=stemmatology) + Package: stemmatology Type: Package Title: Stemmatological Analysis of Textual Traditions - Version: 0.3.1 - Date: 2018-05-25 + Version: 0.3.2 + Date: 2019-03-28 Author: Jean-Baptiste Camps ; Florian Cafiero Maintainer: Jean-Baptiste Camps Description: Explore and analyse the genealogy of textual or musical traditions, from their variants, with various stemmatological methods, mainly the disagreement-based algorithms suggested by Camps and Cafiero (2015) . diff --git a/tests/testthat/test-PCC.Exploratory.R b/tests/testthat/test-PCC.Exploratory.R index ca0658b..333aeca 100644 --- a/tests/testthat/test-PCC.Exploratory.R +++ b/tests/testthat/test-PCC.Exploratory.R @@ -158,3 +158,25 @@ test_that("yields expected output on smaller case", { #VL12 1 2 2 2 1 1 2 2 #TODO: extend it to other exploratory functions ! +# +# test_that("works on non numeric input", { +# x = matrix(data = c( +# "1","1","2","2","1,2", +# "1","1","2","2","1,2", +# "0","0","1","2","1,2", +# "1","1","2","2","1", +# "1","1","2","2","2", +# "1","2","3","4","5" +# ), byrow = TRUE, +# ncol = 5, +# nrow = 6, +# dimnames = list( +# c("VL1", "VL2", "VL3", "VL4", "VL5", "VL6"), +# c("A","B","C","D","E") +# ) +# ) +# # TODO: create test and debug for very small databases +# PCC.Exploratory(x, omissionsAsReadings = FALSE, alternateReadings = TRUE) +# +# +# }) diff --git a/tests/testthat/test-PCC.R b/tests/testthat/test-PCC.R index 167aa8f..7232550 100644 --- a/tests/testthat/test-PCC.R +++ b/tests/testthat/test-PCC.R @@ -215,3 +215,16 @@ test_that("yields expected output on simple case (with conflicts)", { ) }) + +# test_that("PCC works on non numeric input", { +# myData = structure(c("1", "1", "1", "1,3", "1", "1", "1", "1,3", "1", +# "1", "1", "1,3", "1", "1", "1", "1,3", "2", "2", "1", "1,2", +# "2", "2", "1", "1,2", "2", "2", "1", "1,2", "2", "2", "1", "1,2", +# "2", "1,2", "1", "1", "2", "1,2", "1", "1", "2", "1,2", "1", +# "1", "2", "1,2", "1", "1", "2", "2", "1", "2", "2", "2", "1", +# "2", "2", "2", "1", "2", "2", "2", "1", "2", "1,2", "1", "2", +# "3", "1,2", "1", "2", "3", "1,2", "1", "2", "3", "1,2", "1", +# "2", "3"), .Dim = c(16L, 5L), .Dimnames = list(c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"), c("A", "D", "F", "T", "P"))) +# PCC(myData, alternateReadings = TRUE) +# +# })