Skip to content

Commit

Permalink
Merge pull request #52 from Jean-Baptiste-Camps/cranFix2
Browse files Browse the repository at this point in the history
fixing non ASCII characters in Namespace comments for CRAN
  • Loading branch information
floriancafiero authored Apr 10, 2019
2 parents ed99347 + 906eef3 commit 3ba4bc6
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 11 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
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) <doi:10.1484/M.LECTIO-EB.5.102565>.
Expand Down
5 changes: 1 addition & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
2 changes: 1 addition & 1 deletion R/PCC.conflicts.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion R/PCC.equipollent.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down
2 changes: 1 addition & 1 deletion R/import.TEIApparatus.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import.TEIApparatus <-
myRdgWits = sub("^\\s+|\\s+$", "", myRdgWits)
myRdgWits = strsplit(myRdgWits, "\\s+")
myRdgVars = NULL
# 0 for omission, 1n 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)
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
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) <doi:10.1484/M.LECTIO-EB.5.102565>.
Expand Down
22 changes: 22 additions & 0 deletions tests/testthat/test-PCC.Exploratory.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
#
#
# })
13 changes: 13 additions & 0 deletions tests/testthat/test-PCC.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
#
# })

0 comments on commit 3ba4bc6

Please sign in to comment.