Skip to content

Commit

Permalink
CRAN v5.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
laresbernardo committed Sep 12, 2024
1 parent aa66439 commit 6140cae
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 43 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Package: lares
Type: Package
Title: Analytics & Machine Learning Sidekick
Version: 5.2.8.9006
Version: 5.2.9
Authors@R: c(
person("Bernardo", "Lares", , "laresbernardo@gmail.com", c("aut", "cre")))
Maintainer: Bernardo Lares <laresbernardo@gmail.com>
Description: Auxiliary package for better/faster analytics, visualization, data mining, and machine
learning tasks. With a wide variety of family functions, like Machine Learning, Data Wrangling,
Exploratory, API, and Scrapper, it helps the analyst or data scientist to get quick and robust
results, without the need of repetitive coding or extensive R programming skills.
MMM, Exploratory, API, and Scrapper, it helps the analyst or data scientist to get quick and
robust results, without the need of repetitive coding or advanced R programming skills.
Depends:
R (>= 3.5.0)
Imports:
Expand Down
4 changes: 2 additions & 2 deletions R/audio.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ get_mp3 <- function(id,
if (open) {
if (file.exists(mp3_file)) {
message("Opening file: ", mp3_file)
browseURL(mp3_file)
browseURL(mp3_file)
} else {
warning("Can't open file; possibly due to strange characters in title: ", mp3_file)
}
Expand All @@ -139,7 +139,7 @@ get_mp3 <- function(id,
if (file.exists(mp3_file)) {
message("Deleting file: ", mp3_file)
if (open) Sys.sleep(5)
file.remove(mp3_file)
file.remove(mp3_file)
} else {
warning("Can't delete file; possibly due to strange characters in title: ", mp3_file)
}
Expand Down
6 changes: 4 additions & 2 deletions R/robyn.R
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,10 @@ robyn_performance <- function(
if (carryovers) {
try_require("Robyn")
carrov <- robyn_immcarr(
InputCollect, OutputCollect, solID = solID,
start_date = start_date, end_date = end_date, ...) %>%
InputCollect, OutputCollect,
solID = solID,
start_date = start_date, end_date = end_date, ...
) %>%
filter(.data$type == "Carryover")
mean_carryovers <- data.frame(
channel = carrov$rn,
Expand Down
36 changes: 20 additions & 16 deletions R/scrabble.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ scrabble_score <- function(words, scores.df) {
#' @family Scrabble
#' @param lang Character. Any of "en","es" or "chars". Set to NULL
#' if you wish to skip this step (and use \code{words} parameter in
#' \code{scrabble_words()} instead). The "chars" parameter will
#' \code{scrabble_words()} instead). The "chars" parameter will
#' score the number of characters a word has.
#' @return data.frame with tiles and scores for each alphabet letter.
#' @examples
Expand All @@ -133,15 +133,19 @@ scrabble_points <- function(lang) {
tolower(LETTERS)[1:14], intToUtf8(241),
tolower(LETTERS)[15:length(LETTERS)]
),
scores = c(1, 3, 2, 2, 1, 4, 3, 4, 1, 8, 10, 1, 3, 1,
8, 1, 3, 5, 1, 1, 1, 2, 4, 10, 10, 5, 10)
scores = c(
1, 3, 2, 2, 1, 4, 3, 4, 1, 8, 10, 1, 3, 1,
8, 1, 3, 5, 1, 1, 1, 2, 4, 10, 10, 5, 10
)
)
}
if (lang == "en") {
scores <- data.frame(
tiles = tolower(LETTERS),
scores = c(1, 4, 4, 2, 1, 4, 3, 3, 1, 10, 5, 2, 4,
2, 1, 4, 10, 1, 1, 1, 2, 5, 4, 8, 3, 10)
scores = c(
1, 4, 4, 2, 1, 4, 3, 3, 1, 10, 5, 2, 4,
2, 1, 4, 10, 1, 1, 1, 2, 5, 4, 8, 3, 10
)
)
}
if (lang %in% c("chars", "unique")) {
Expand Down Expand Up @@ -370,17 +374,17 @@ scrabble_words <- function(tiles = "",
}
# Exclude letters from positions (Wordle)
if (exclude_here[1] != "") {
for (eh in exclude_here) {
pos_tiles <- str_split_merge(tolower(eh))
for (i in seq_along(pos_tiles)) {
these <- str_split(pos_tiles, "\\|")[i][[1]]
if (!any(these %in% letters)) next
located <- stringr::str_locate_all(words, pos_tiles[i])
these <- !unlist(lapply(located, function(x) sum(x[, 1] == i) > 0))
words <- words[these]
.temp_print(length(words))
for (eh in exclude_here) {
pos_tiles <- str_split_merge(tolower(eh))
for (i in seq_along(pos_tiles)) {
these <- str_split(pos_tiles, "\\|")[i][[1]]
if (!any(these %in% letters)) next
located <- stringr::str_locate_all(words, pos_tiles[i])
these <- !unlist(lapply(located, function(x) sum(x[, 1] == i) > 0))
words <- words[these]
.temp_print(length(words))
}
}
}
}

.temp_print(length(words), last = TRUE)
Expand All @@ -391,7 +395,7 @@ scrabble_words <- function(tiles = "",
mutate(length = str_length(.data$word)) %>%
arrange(desc(.data$scores), desc(.data$length))
} else {
done <- scrabble_score(words, scores.df)
done <- scrabble_score(words, scores.df)
}
if (sum(done$scores) == 0) done$scores <- NULL
return(as_tibble(done))
Expand Down
6 changes: 3 additions & 3 deletions R/trees.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#' @family Exploratory
#' @family Visualization
#' @inheritParams h2o_automl
#' @inherit rpart::rpart
#' @inherit rpart::rpart.control
#' @inherit rpart.plot::rpart.plot
#' @inheritParams rpart::rpart
#' @inheritParams rpart::rpart.control
#' @inheritParams rpart.plot::rpart.plot
#' @param df Data frame
#' @param max Integer. Maximal depth of the tree.
#' @param min Integer. The minimum number of observations that must
Expand Down
2 changes: 1 addition & 1 deletion man/scrabble.Rd

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

16 changes: 0 additions & 16 deletions man/tree_var.Rd

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

0 comments on commit 6140cae

Please sign in to comment.