Skip to content

Commit 2fe0fe4

Browse files
committed
CRAN 5.1.4 [fix broken link]
1 parent 3d75b74 commit 2fe0fe4

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: lares
22
Type: Package
33
Title: Analytics & Machine Learning Sidekick
4-
Version: 5.1.3
4+
Version: 5.1.4
55
Authors@R: c(
66
person("Bernardo", "Lares", , "laresbernardo@gmail.com", c("aut", "cre")))
77
Maintainer: Bernardo Lares <laresbernardo@gmail.com>

R/other_functions.R

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,23 @@ NULL
1717
#' @param stop Boolean. Stop if not installed. If \code{FALSE} and
1818
#' library is not available, warning will be shown.
1919
#' @param load Boolean. Load library?
20-
#' @param ... Enabled lazyeval to ignore shared parameters.
20+
#' @param lib.loc Character vector. Location of R library trees
21+
#' to search through, or \code{NULL}. The default value of \code{NULL}
22+
#' corresponds to all libraries currently known to \code{.libPaths()}.
23+
#' Non-existent library trees are silently ignored.
24+
#' @param ... Pass additional parameters.
2125
#' @return No return value, called for side effects.
2226
#' @examples
2327
#' # Check if library base is installed. If not, stop and show error
2428
#' try_require("base", stop = TRUE)
2529
#' # Check if library xxx is installed. If not, show warning
2630
#' try_require("xxx", stop = FALSE)
2731
#' @export
28-
try_require <- function(package, stop = TRUE, load = TRUE, ...) {
32+
try_require <- function(package, stop = TRUE, load = TRUE, lib.loc = NULL, ...) {
2933
present <- length(find.package(package, quiet = TRUE)) > 0
3034
if (present & load) {
31-
suppressPackageStartupMessages(library(package, character.only = TRUE))
35+
# Be careful: ... parameter is not enabled in library()
36+
suppressPackageStartupMessages(library(package, character.only = TRUE, lib.loc = lib.loc))
3237
} else {
3338
if (stop) {
3439
stop(paste0("Package '", package, "' required. Install and try again."), call. = FALSE)

R/wordle.R

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#' @param lang_dic Character. Any of: "en", "es". Only used when \code{dictionary}
1414
#' parameter is NULL. Requires internet connection the first time. Uses cache.
1515
#' @param method Integer. 1 for \code{scrabble_dictionary()}, 3 for scrapping
16-
#' \href{https://www.nytimes.com/games/wordle/index.html}{NYTimes} set of words.
16+
#' the words taken straight from the game's source code.
1717
#' @param print Boolean. Print validation results?
1818
#' @return Invisible vector with results by letter.
1919
#' @examples
@@ -92,10 +92,8 @@ wordle_dictionary <- function(lang_dic = "en", method = 3, quiet = TRUE) {
9292
words <- scrabble_dictionary(lang_dic, quiet)[[1]]
9393
}
9494
if (method == 3) {
95-
url <- "https://www.nytimes.com/games/wordle/main.bd4cb59c.js"
96-
temp <- str_split(readLines(url), '"')[[1]]
97-
words <- toupper(unique(temp[nchar(temp) == 5]))
98-
words <- grep("^[[:alnum:]]+$", words, value = TRUE)
95+
url <- "https://raw.githubusercontent.com/tabatkins/wordle-list/main/words"
96+
words <- readLines(url, warn = FALSE)
9997
}
10098
out <- toupper(words[nchar(words) == 5])
10199
cache_write(out, cache_name, quiet = quiet)

man/try_require.Rd

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/wordle.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)