Skip to content

Commit

Permalink
try to fix for CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
agricolamz committed Apr 8, 2024
1 parent 11afbec commit d7cd294
Show file tree
Hide file tree
Showing 55 changed files with 450 additions and 617 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: phonfieldwork
Type: Package
Title: Linguistic Phonetic Fieldwork Tools
Version: 0.0.12
Version: 0.0.13
Depends: R (>= 3.5.0)
Imports:
tuneR,
Expand All @@ -11,7 +11,7 @@ Imports:
graphics,
rmarkdown,
xml2,
uchardet,
readr,
tools,
mime
Authors@R: c(
Expand Down Expand Up @@ -47,7 +47,7 @@ URL: https://CRAN.R-project.org/package=phonfieldwork, https://docs.ropensci.org
BugReports: https://github.com/ropensci/phonfieldwork/issues
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
VignetteBuilder: knitr
Suggests:
knitr,
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ importFrom(graphics,rect)
importFrom(graphics,segments)
importFrom(graphics,text)
importFrom(mime,guess_type)
importFrom(readr,guess_encoding)
importFrom(rmarkdown,render)
importFrom(stats,fft)
importFrom(stats,na.omit)
Expand All @@ -55,7 +56,6 @@ importFrom(tuneR,extractWave)
importFrom(tuneR,readMP3)
importFrom(tuneR,readWave)
importFrom(tuneR,writeWave)
importFrom(uchardet,detect_file_enc)
importFrom(utils,installed.packages)
importFrom(utils,read.delim)
importFrom(utils,write.csv)
Expand Down
5 changes: 3 additions & 2 deletions R/formant_to_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' formant_to_df(system.file("extdata", "e.Formant", package = "phonfieldwork"))
#' @export
#'
#' @importFrom uchardet detect_file_enc
#' @importFrom readr guess_encoding
#'

formant_to_df <- function(file_name) {
Expand All @@ -22,7 +22,8 @@ formant_to_df <- function(file_name) {
formant <- file_name
} else {
# thanks to Artem Klevtsov for this code
con <- file(file_name, encoding = uchardet::detect_file_enc(file_name))
con <- file(file_name,
encoding = readr::guess_encoding(file_name)$encoding)
formant <- readLines(con)
close(con)
}
Expand Down
5 changes: 3 additions & 2 deletions R/intensity_to_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' intensity_to_df(system.file("extdata", "test.Intensity", package = "phonfieldwork"))
#' @export
#'
#' @importFrom uchardet detect_file_enc
#' @importFrom readr guess_encoding
#'

intensity_to_df <- function(file_name) {
Expand All @@ -23,7 +23,8 @@ intensity_to_df <- function(file_name) {
intensity <- file_name
} else {
# thanks to Artem Klevtsov for this code
con <- file(file_name, encoding = uchardet::detect_file_enc(file_name))
con <- file(file_name,
encoding = readr::guess_encoding(file_name)$encoding)
intensity <- readLines(con)
close(con)
}
Expand Down
5 changes: 3 additions & 2 deletions R/pitch_to_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' pitch_to_df(system.file("extdata", "test.Pitch", package = "phonfieldwork"))
#' @export
#'
#' @importFrom uchardet detect_file_enc
#' @importFrom readr guess_encoding
#'

pitch_to_df <- function(file_name,
Expand All @@ -26,7 +26,8 @@ pitch_to_df <- function(file_name,
pitch <- file_name
} else {
# thanks to Artem Klevtsov for this code
con <- file(file_name, encoding = uchardet::detect_file_enc(file_name))
con <- file(file_name,
encoding = readr::guess_encoding(file_name)$encoding)
pitch <- readLines(con)
close(con)
}
Expand Down
1 change: 0 additions & 1 deletion R/set_textgrid_names.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#' )
#' @export
#'
#' @importFrom uchardet detect_file_enc
#'

set_textgrid_names <- function(textgrid,
Expand Down
5 changes: 3 additions & 2 deletions R/srt_to_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
#' srt_to_df(system.file("extdata", "test.srt", package = "phonfieldwork"))
#' @export
#'
#' @importFrom uchardet detect_file_enc
#' @importFrom readr guess_encoding
#'

srt_to_df <- function(file_name) {

# thanks to Artem Klevtsov for this code
con <- file(file_name, encoding = uchardet::detect_file_enc(file_name))
con <- file(file_name,
encoding = readr::guess_encoding(file_name)$encoding)
srt <- readLines(con)
close(con)

Expand Down
1 change: 0 additions & 1 deletion R/textgrid_to_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#' ))
#' @export
#'
#' @importFrom uchardet detect_file_enc
#'

textgrid_to_df <- function(file_name) {
Expand Down
5 changes: 3 additions & 2 deletions R/utils.r
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
#' @author George Moroz <[email protected]>
#' @param file_name string with a filename or path to the TextGrid
#' @noRd
#' @importFrom uchardet detect_file_enc
#' @importFrom readr guess_encoding
#'

read_textgrid <- function(file_name) {
if (grepl("TextGrid", file_name[2])) {
tg <- file_name
} else {
# thanks to Artem Klevtsov for this code
con <- file(file_name, encoding = uchardet::detect_file_enc(file_name))
con <- file(file_name,
encoding = readr::guess_encoding(file_name)$encoding)
tg <- readLines(con)
close(con)
}
Expand Down
18 changes: 6 additions & 12 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@
"codeRepository": "https://github.com/ropensci/phonfieldwork",
"issueTracker": "https://github.com/ropensci/phonfieldwork/issues",
"license": "https://spdx.org/licenses/GPL-2.0",
"version": "0.0.12",
"version": "0.0.13",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.2.2 Patched (2022-11-10 r83330)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"runtimePlatform": "R version 4.3.3 (2024-02-29)",
"author": [
{
"@type": "Person",
Expand Down Expand Up @@ -206,15 +200,15 @@
},
"9": {
"@type": "SoftwareApplication",
"identifier": "uchardet",
"name": "uchardet",
"identifier": "readr",
"name": "readr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=uchardet"
"sameAs": "https://CRAN.R-project.org/package=readr"
},
"10": {
"@type": "SoftwareApplication",
Expand All @@ -235,7 +229,7 @@
},
"SystemRequirements": "pandoc (>= 1.14) - http://pandoc.org"
},
"fileSize": "4371.17KB",
"fileSize": "4059.603KB",
"citation": [
{
"datePublished": "2023",
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 19 additions & 11 deletions docs/additional/first_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -3060,20 +3060,23 @@
});
};

if (document.readyState !== "loading" &&
document.querySelector('slides') === null) {
// if the document is done loading but our element hasn't yet appeared, defer
// loading of the deck
window.setTimeout(function() {
loadDeck(null);
}, 0);
} else {
// still loading the DOM, so wait until it's finished
document.addEventListener("DOMContentLoaded", loadDeck);
if (!window.Shiny) {
// If Shiny is loaded, the slide deck is initialized in ioslides template

if (document.readyState !== "loading" &&
document.querySelector('slides') === null) {
// if the document is done loading but our element hasn't yet appeared, defer
// loading of the deck
window.setTimeout(function() {
loadDeck(null);
}, 0);
} else {
// still loading the DOM, so wait until it's finished
document.addEventListener("DOMContentLoaded", loadDeck);
}
}



</script>

<style type="text/css">
Expand Down Expand Up @@ -3184,6 +3187,11 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
window.jQuery(e.target).trigger('shown');
});
}
if (window.Shiny) {
// Initialize slides when this script appears on the page, since it
// indicates that the <slides> markup has been fully loaded.
window.loadDeck();
}
})();
</script>

Expand Down
Binary file modified docs/additional/glossed_document.docx
Binary file not shown.
30 changes: 19 additions & 11 deletions docs/additional/second_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -3060,20 +3060,23 @@
});
};

if (document.readyState !== "loading" &&
document.querySelector('slides') === null) {
// if the document is done loading but our element hasn't yet appeared, defer
// loading of the deck
window.setTimeout(function() {
loadDeck(null);
}, 0);
} else {
// still loading the DOM, so wait until it's finished
document.addEventListener("DOMContentLoaded", loadDeck);
if (!window.Shiny) {
// If Shiny is loaded, the slide deck is initialized in ioslides template

if (document.readyState !== "loading" &&
document.querySelector('slides') === null) {
// if the document is done loading but our element hasn't yet appeared, defer
// loading of the deck
window.setTimeout(function() {
loadDeck(null);
}, 0);
} else {
// still loading the DOM, so wait until it's finished
document.addEventListener("DOMContentLoaded", loadDeck);
}
}



</script>

<style type="text/css">
Expand Down Expand Up @@ -3184,6 +3187,11 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
window.jQuery(e.target).trigger('shown');
});
}
if (window.Shiny) {
// Initialize slides when this script appears on the page, since it
// indicates that the <slides> markup has been fully loaded.
window.loadDeck();
}
})();
</script>

Expand Down
Loading

0 comments on commit d7cd294

Please sign in to comment.