Skip to content

Commit

Permalink
remove stLength() 🔥 - close #9
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Cazelles committed Jun 21, 2019
1 parent f451ae6 commit 7e39b84
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 141 deletions.
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ export(setColClass)
export(signifSymbols)
export(squaretize)
export(stApply)
export(stLength)
export(strLength)
export(substrBib)
export(whichIs)
export(wordCount)
Expand Down
25 changes: 11 additions & 14 deletions R/addURL.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#' Add an URL
#' Add a URL
#'
#' Add and URL in HTML or Markdown format.
#' Add a URL in HTML or Markdown format.
#'
#' @author
#' Kevin Cazelles
#'
#' @param url An URL.
#' @param url A URL.
#' @param text A character string to be searched within.
#' @param extra Extra A connection object or a character string that stand for a path,
#' ignored if text is defined.
Expand All @@ -18,24 +15,24 @@
#' addURL('https://github.com/inSileco/letiRmisc', 'Github repo', markdown=TRUE)

addURL <- function(url, text = NULL, extra = NULL, markdown = FALSE) {
url %<>% as.character
url <- as.character(url)

if (!is.null(text)) {
text %<>% as.character
text <- as.character(text)
} else text <- url

if (!is.null(extra)) {
extra %<>% as.character()
extra <- as.character(extra)
extra <- paste0(" ", extra)
} else extra <- ""

if (!markdown) {
out <- paste0("<a href='", url, "'", extra, ">", text, "</a>")
} else {
out <- paste0("[", text, "](", url, ")")
if (stLength(extra))
if (nchar(extra))
warning("markdown is 'TRUE' so 'extra' is ignored")
}
##
##
out
}
10 changes: 5 additions & 5 deletions R/categorize.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#' Assign categories to a vector of values.
#'
#' Assigns a category to each element of a vector for a given set of threshold values. Note that category are always sorted.
#' Assigns a category to each element of a vector for a given set of threshold
#' values. Note that categories are always sorted. By defaults trheshold values
#' are regarded as upper boiundaries.
#'
#' @author
#' Kevin Cazelles
#' @param x A numeric, complex, character or logical vector.
#' @param categ A set of threshold that are used to assign categories.
#' @param lower A logical, if TRUE elements equal to a given threshold values are included in the lower category, default is FALSE.
#' @param lower A logical, if `TRUE` then `categ` are considered elements equal to a given threshold values are included in the lower category, default is FALSE.
#' @return
#' A vector countaining values standing for categories into which elements of x have fallen.
#' A vector of categories assinged.
#' @export
#' @examples
#' categorize(stats::runif(40), categ=c(0.5,0.75))
Expand All @@ -18,9 +20,7 @@


categorize <- function(x, categ, lower = FALSE) {
##
categ <- sort(unique(categ))
##
out <- rep(1, length(x))
##
if (lower) {
Expand Down
23 changes: 0 additions & 23 deletions R/stLength.R

This file was deleted.

23 changes: 0 additions & 23 deletions R/strLength.R

This file was deleted.

9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ package, please do!

## Installation

To get the current development version from GitHub, use the
[*devtools*](http://cran.r-project.org/web/packages/remotes) package
like so:
The current development is on GitHub and easy to install with the
[remotes](http://cran.r-project.org/web/packages/remotes) :package::

```r
if (!require("remotes")) install.packages("remotess")
if (!require("remotes")) install.packages("remotes")
remotes::install_github("inSileco/inSilecoMisc")
```



## Tout-doux list

- [ ] [inSileco](https://insileco.github.io/) members, a short but useful function you often use? Add it to this repo :stuck_out_tongue_winking_eye:;
- [ ] [inSileco](https://insileco.github.io/) members, a short but useful function you often use? Well, you can add it to this repo :stuck_out_tongue_winking_eye:;
8 changes: 5 additions & 3 deletions man/categorize.Rd

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

23 changes: 0 additions & 23 deletions man/stLength.Rd

This file was deleted.

23 changes: 0 additions & 23 deletions man/strLength.Rd

This file was deleted.

11 changes: 0 additions & 11 deletions tests/testthat/test-strLength.R

This file was deleted.

9 changes: 0 additions & 9 deletions vignettes/overview.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,6 @@ loremIpsum(10)
keepWords(lor, c(1,4))
```

## Size of a string

```{r stLength}
lor <- loremIpsum()
stLength(lor)
nchar(lor)
stLength(lor, ignore = "q")
```



## Adjust the size of a character string
Expand Down

0 comments on commit 7e39b84

Please sign in to comment.