Skip to content

Commit

Permalink
Added factor analysis to dna_cluster and renamed dna_plotMDS to dna_p…
Browse files Browse the repository at this point in the history
…lotCoordinates
  • Loading branch information
Johannes Gruber committed May 21, 2018
1 parent 5f3cabd commit 182718b
Show file tree
Hide file tree
Showing 8 changed files with 438 additions and 265 deletions.
115 changes: 115 additions & 0 deletions Update rDNA package.R
@@ -0,0 +1,115 @@
# how to write an R package https://hilaryparker.com/2014/04/29/writing-an-r-package-from-scratch/

library("devtools")
library("roxygen2")

#Update Documentation
#setwd("C:/Users/binis/Documents/GitHub/dna/rDNA")
#setwd("F:/Dropbox/Github/dna/rDNA")
# setwd("/home/johannes/Documents/Github 4/dna/rDNA/")
setwd("/home/johannes/Documents/Github/dna/rDNA/")
desc <- readLines("DESCRIPTION")
date <- desc[grepl("^Date:", desc)]
date2 <- gsub("[^[:digit:]-]", "", date)
desc[grepl("^Date:", desc)] <- gsub(date2, Sys.Date(), desc[grepl("^Date:", desc)])
vers <- desc[grepl("^Version:", desc)]
vers2 <- gsub("[^[:digit:].]", "", vers)
vers3 <- readline(prompt = paste("New Version? Old:", vers2))
desc[grepl("^Version:", desc)] <- gsub(vers2, vers3, desc[grepl("^Version:", desc)])
writeLines(desc, "DESCRIPTION")


roxygen2::roxygenise(clean = TRUE)
setwd("..")
devtools::check("rDNA")
devtools::spell_check("rDNA", dict = "en_GB", ignore = c(
"CLASSPATH",
"dd",
"dna",
"DNA's",
"docTitle",
"excludeTypes",
"Gruber",
"Leifeld",
"igraph",
"ggplot",
"java",
"Jaccard",
"etc",
"mySQL",
"nw",
"org",
"pts",
"wd",
"plottable",
"linetype",
"bw",
"color",
"cutree",
"eigen",
"lineend",
"louvain",
"mcquitty",
"MDS",
"pam",
"plotDendro",
"RColorBrewer",
"walktrap",
"yyyy",
"onemode",
"twomode",
"getDocuments",
"clust",
"dh",
"drl",
"graphopt",
"kk",
"knitr",
"lables",
"lgl",
"mds",
"POSIXct",
"qualifierAggregation",
"setDocuments",
"dist",
"edgelist",
"eventSequence",
"isoMDS",
"plotMDS",
"timewindow",
"vegdist"
))
#source("https://install-github.me/MangoTheCat/goodpractice")
#goodpractice::gp("rDNA")
#lintr::lint("rDNA.R")
#lintr::lint_package("rDNA")

#devtools::install("rDNA")

# update github
system("git status")

system("git add -A")
commit_message <- readline(prompt = "Commit message")
system(paste0("git commit -m'",
commit_message,
"'"))

#build
build(pkg = "rDNA", manual = TRUE)

# create the package in wd
setwd("C:/Users/binis/Documents/GitHub/dna")
install("rDNA", args = c("--no-multiarch", "--no-test-load"))

# change version number in manual



### quick test
setwd("/home/johannes/Documents/Github/dna/rDNA/")
roxygen2::roxygenise(clean = TRUE)
setwd("..")
#devtools::check("rDNA")
devtools::install("rDNA")

120 changes: 67 additions & 53 deletions manual/dna-manual.Rnw

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions rDNA/DESCRIPTION
@@ -1,6 +1,6 @@
Package: rDNA
Version: 2.0.82
Date: 2018-05-20
Version: 2.0.83
Date: 2018-05-21
Title: Discourse Network Analysis in R
Authors@R:
c(person("Philip", "Leifeld", email = "Philip.Leifeld@glasgow.ac.uk",
Expand Down
3 changes: 2 additions & 1 deletion rDNA/NAMESPACE
Expand Up @@ -12,11 +12,11 @@ export(dna_getDocuments)
export(dna_gui)
export(dna_init)
export(dna_network)
export(dna_plotCoordinates)
export(dna_plotDendro)
export(dna_plotFrequency)
export(dna_plotHeatmap)
export(dna_plotHive)
export(dna_plotMDS)
export(dna_plotNetwork)
export(dna_plotTimeWindow)
export(dna_removeDocument)
Expand Down Expand Up @@ -65,6 +65,7 @@ importFrom(stats,cor)
importFrom(stats,cutree)
importFrom(stats,dendrapply)
importFrom(stats,dist)
importFrom(stats,factanal)
importFrom(stats,hclust)
importFrom(stats,is.leaf)
importFrom(stats,kmeans)
Expand Down

0 comments on commit 182718b

Please sign in to comment.