Skip to content

Commit

Permalink
v0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gagolews committed Aug 5, 2021
1 parent 04ca583 commit a0c7d03
Show file tree
Hide file tree
Showing 43 changed files with 187 additions and 165 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: stringx
Type: Package
Title: Drop-in Replacements for Base String Functions Powered by 'stringi'
Version: 0.1.2.9001
Version: 0.1.3
Date: 2021-08-05
Authors@R: c(
person("Marek", "Gagolewski",
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# What Is New in *stringx*


## 0.1.2.9xxx (under development)
## 0.1.3 (2021-08-05)

* [BUGFIX] #4: Fixed failing check with ICU 55.

Expand Down
7 changes: 7 additions & 0 deletions devel/sphinx/news.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# What Is New in *stringx*


## 0.1.3 (2021-08-05)

* [BUGFIX] #4: Fixed failing check with ICU 55.

* [BUGFIX] #5: Fixed failing check under POSIX/C locale.


## 0.1.2 (2021-07-27)

* First [CRAN](https://cran.r-project.org/package=stringx) release.
Expand Down
2 changes: 1 addition & 1 deletion devel/sphinx/rapi/constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Letters and digits sets complementing the built-in `LETTERS` and `letters`, see [Constants](https://stat.ethz.ch/R-manual/R-devel/library/base/help/Constants.html).

Note: calling, e.g., [`tolower`](chartr.md) on `LETTERS_FRAK` does not currently yield `letters_frak`.
Note: calling, e.g., [`tolower`](chartr.md) on `LETTERS_FRAK` in the current version of <span class="pkg">ICU</span> does not currently yield `letters_frak`.

## Usage

Expand Down
34 changes: 17 additions & 17 deletions devel/sphinx/rapi/grepl.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,23 @@ Related function(s): [`paste`](paste.md), [`nchar`](nchar.md), [`strsplit`](strs

```r
x <- c("abc", "1237", "\U0001f602", "\U0001f603", "stringx\U0001f970", NA)
grepl2(x, "\\p{EMOJI_PRESENTATION}")
## [1] FALSE FALSE TRUE TRUE TRUE NA
which(grepl2(x, "\\p{EMOJI_PRESENTATION}")) # like grep
## [1] 3 4 5
# at least 1 letter, digit, or emoji:
p <- c("\\p{L}", "\\p{N}", "\\p{EMOJI_PRESENTATION}")
grepl2(x, "\\p{L}")
## [1] TRUE FALSE FALSE FALSE TRUE NA
which(grepl2(x, "\\p{L}")) # like grep
## [1] 1 5
# at least 1 letter or digit:
p <- c("\\p{L}", "\\p{N}")
`dimnames<-`(outer(x, p, grepl2), list(x, p))
## \\p{L} \\p{N} \\p{EMOJI_PRESENTATION}
## abc TRUE FALSE FALSE
## 1237 FALSE TRUE FALSE
## 😂 FALSE FALSE TRUE
## 😃 FALSE FALSE TRUE
## stringx🥰 TRUE FALSE TRUE
## <NA> NA NA NA
x |> grepv2("\\p{EMOJI_PRESENTATION}")
## [1] "😂" "😃" "stringx🥰"
grepv2(x, "\\p{EMOJI_PRESENTATION}", invert=TRUE) <- "\U0001F496"
## \\p{L} \\p{N}
## abc TRUE FALSE
## 1237 FALSE TRUE
## 😂 FALSE FALSE
## 😃 FALSE FALSE
## stringx🥰 TRUE FALSE
## <NA> NA NA
x |> grepv2("\\p{L}")
## [1] "abc" "stringx🥰"
grepv2(x, "\\p{L}", invert=TRUE) <- "\U0001F496"
print(x)
## [1] "💖" "💖" "😂" "😃" "stringx🥰" NA
## [1] "abc" "💖" "💖" "💖" "stringx🥰" NA
```
4 changes: 2 additions & 2 deletions devel/sphinx/rapi/gsub.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ Related function(s): [`paste`](paste.md), [`nchar`](nchar.md), [`grepl2`](grepl.


```r
"change \U0001f602 me \U0001f603" |> gsub2("\\p{EMOJI_PRESENTATION}", "O_O")
## [1] "change O_O me O_O"
"change \U0001f602 me \U0001f603" |> gsub2("\\p{L}+", "O_O")
## [1] "O_O 😂 O_O 😃"
x <- c("mario", "Mario", "M\u00E1rio", "M\u00C1RIO", "Mar\u00EDa", "Rosario", NA)
sub2(x, "mario", "M\u00E1rio", fixed=NA, strength=1L)
## [1] "Mário" "Mário" "Mário" "Mário" "María" "Rosario" NA
Expand Down
4 changes: 2 additions & 2 deletions devel/sphinx/rapi/sprintf.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ cat(stringx::sprintf("%8s=%+.3f", l, r), sep="\n")
# coercion of the same argument to different types:
stringx::printf(c("UNIX time %1$f is %1$s.", "%1$s is %1$f UNIX time."),
Sys.time())
## UNIX time 1627519463.764384 is 2021-07-29 10:44:23.
## 2021-07-29 10:44:23 is 1627519463.764384 UNIX time.
## UNIX time 1628137840.855767 is 2021-08-05 14:30:40.
## 2021-08-05 14:30:40 is 1628137840.855767 UNIX time.
```
20 changes: 10 additions & 10 deletions devel/sphinx/rapi/strptime.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,22 @@ Related function(s): [`sprintf`](sprintf.md)

```r
stringx::strftime(Sys.time()) # default format - ISO 8601
## [1] "2021-07-29T10:44:24+1000"
## [1] "2021-08-05T14:30:41+1000"
f <- c("date_full", "%Y-%m-%d", "date_relative_short", "datetime_full")
stringx::strftime(Sys.time(), f) # current default locale
## [1] "Thursday, 29 July 2021"
## [2] "2021-07-29"
## [1] "Thursday, 5 August 2021"
## [2] "2021-08-05"
## [3] "today"
## [4] "Thursday, 29 July 2021 at 10:44:24 am Australian Eastern Standard Time"
## [4] "Thursday, 5 August 2021 at 2:30:41 pm Australian Eastern Standard Time"
stringx::strftime(Sys.time(), f, locale="de_DE")
## [1] "Donnerstag, 29. Juli 2021"
## [2] "2021-07-29"
## [3] "heute"
## [4] "Donnerstag, 29. Juli 2021 um 10:44:24 Ostaustralische Normalzeit"
## [1] "Donnerstag, 5. August 2021"
## [2] "2021-08-05"
## [3] "heute"
## [4] "Donnerstag, 5. August 2021 um 14:30:41 Ostaustralische Normalzeit"
stringx::strftime(Sys.time(), "date_short", locale="en_IL@calendar=hebrew")
## [1] "20 Av 5781"
## [1] "27 Av 5781"
stringx::strptime("1970-01-01 00:00:00", "%Y-%m-%d %H:%M:%S", tz="GMT")
## [1] "1970-01-01 00:00:00 GMT"
stringx::strptime("14 Nisan 5703", "date_short", locale="en_IL@calendar=hebrew")
## [1] "1943-04-19 10:44:24 AEST"
## [1] "1943-04-19 14:30:41 AEST"
```
6 changes: 3 additions & 3 deletions docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ processing to bioinformatics. It also gives powerful
means to represent or transfer unstructured data.

**stringx brings R string processing abilities into the 21st century.**
It replaces functions like `paste`, `grep`, `tolower`, `strftime`,
and `sprintf` with ones that:
It replaces functions like ``paste()``, ``grep()``, ``tolower()``,
``strftime()``, and ``sprintf()`` with ones that:

* support a wide range of languages and scripts and
fully conform to `Unicode <https://www.unicode.org/>`_ standards
Expand All @@ -42,7 +42,7 @@ and `sprintf` with ones that:
with other procedures, etc.;
they are all thoroughly documented in this online manual,
happy reading! 🤓),
* are more forward-pipe (`|>` or `magrittr::%>%`) operator-friendly.
* are more forward-pipe (``|>`` or ``magrittr::%>%``) operator-friendly.

Also, a few new, useful operations are introduced.

Expand Down
7 changes: 7 additions & 0 deletions docs/_sources/news.md.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# What Is New in *stringx*


## 0.1.3 (2021-08-05)

* [BUGFIX] #4: Fixed failing check with ICU 55.

* [BUGFIX] #5: Fixed failing check under POSIX/C locale.


## 0.1.2 (2021-07-27)

* First [CRAN](https://cran.r-project.org/package=stringx) release.
Expand Down
2 changes: 1 addition & 1 deletion docs/_sources/rapi/constants.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Letters and digits sets complementing the built-in `LETTERS` and `letters`, see [Constants](https://stat.ethz.ch/R-manual/R-devel/library/base/help/Constants.html).

Note: calling, e.g., [`tolower`](chartr.md) on `LETTERS_FRAK` does not currently yield `letters_frak`.
Note: calling, e.g., [`tolower`](chartr.md) on `LETTERS_FRAK` in the current version of <span class="pkg">ICU</span> does not currently yield `letters_frak`.

## Usage

Expand Down
34 changes: 17 additions & 17 deletions docs/_sources/rapi/grepl.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,23 @@ Related function(s): [`paste`](paste.md), [`nchar`](nchar.md), [`strsplit`](strs

```r
x <- c("abc", "1237", "\U0001f602", "\U0001f603", "stringx\U0001f970", NA)
grepl2(x, "\\p{EMOJI_PRESENTATION}")
## [1] FALSE FALSE TRUE TRUE TRUE NA
which(grepl2(x, "\\p{EMOJI_PRESENTATION}")) # like grep
## [1] 3 4 5
# at least 1 letter, digit, or emoji:
p <- c("\\p{L}", "\\p{N}", "\\p{EMOJI_PRESENTATION}")
grepl2(x, "\\p{L}")
## [1] TRUE FALSE FALSE FALSE TRUE NA
which(grepl2(x, "\\p{L}")) # like grep
## [1] 1 5
# at least 1 letter or digit:
p <- c("\\p{L}", "\\p{N}")
`dimnames<-`(outer(x, p, grepl2), list(x, p))
## \\p{L} \\p{N} \\p{EMOJI_PRESENTATION}
## abc TRUE FALSE FALSE
## 1237 FALSE TRUE FALSE
## 😂 FALSE FALSE TRUE
## 😃 FALSE FALSE TRUE
## stringx🥰 TRUE FALSE TRUE
## <NA> NA NA NA
x |> grepv2("\\p{EMOJI_PRESENTATION}")
## [1] "😂" "😃" "stringx🥰"
grepv2(x, "\\p{EMOJI_PRESENTATION}", invert=TRUE) <- "\U0001F496"
## \\p{L} \\p{N}
## abc TRUE FALSE
## 1237 FALSE TRUE
## 😂 FALSE FALSE
## 😃 FALSE FALSE
## stringx🥰 TRUE FALSE
## <NA> NA NA
x |> grepv2("\\p{L}")
## [1] "abc" "stringx🥰"
grepv2(x, "\\p{L}", invert=TRUE) <- "\U0001F496"
print(x)
## [1] "💖" "💖" "😂" "😃" "stringx🥰" NA
## [1] "abc" "💖" "💖" "💖" "stringx🥰" NA
```
4 changes: 2 additions & 2 deletions docs/_sources/rapi/gsub.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ Related function(s): [`paste`](paste.md), [`nchar`](nchar.md), [`grepl2`](grepl.


```r
"change \U0001f602 me \U0001f603" |> gsub2("\\p{EMOJI_PRESENTATION}", "O_O")
## [1] "change O_O me O_O"
"change \U0001f602 me \U0001f603" |> gsub2("\\p{L}+", "O_O")
## [1] "O_O 😂 O_O 😃"
x <- c("mario", "Mario", "M\u00E1rio", "M\u00C1RIO", "Mar\u00EDa", "Rosario", NA)
sub2(x, "mario", "M\u00E1rio", fixed=NA, strength=1L)
## [1] "Mário" "Mário" "Mário" "Mário" "María" "Rosario" NA
Expand Down
4 changes: 2 additions & 2 deletions docs/_sources/rapi/sprintf.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ cat(stringx::sprintf("%8s=%+.3f", l, r), sep="\n")
# coercion of the same argument to different types:
stringx::printf(c("UNIX time %1$f is %1$s.", "%1$s is %1$f UNIX time."),
Sys.time())
## UNIX time 1627519463.764384 is 2021-07-29 10:44:23.
## 2021-07-29 10:44:23 is 1627519463.764384 UNIX time.
## UNIX time 1628137840.855767 is 2021-08-05 14:30:40.
## 2021-08-05 14:30:40 is 1628137840.855767 UNIX time.
```
20 changes: 10 additions & 10 deletions docs/_sources/rapi/strptime.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,22 @@ Related function(s): [`sprintf`](sprintf.md)

```r
stringx::strftime(Sys.time()) # default format - ISO 8601
## [1] "2021-07-29T10:44:24+1000"
## [1] "2021-08-05T14:30:41+1000"
f <- c("date_full", "%Y-%m-%d", "date_relative_short", "datetime_full")
stringx::strftime(Sys.time(), f) # current default locale
## [1] "Thursday, 29 July 2021"
## [2] "2021-07-29"
## [1] "Thursday, 5 August 2021"
## [2] "2021-08-05"
## [3] "today"
## [4] "Thursday, 29 July 2021 at 10:44:24 am Australian Eastern Standard Time"
## [4] "Thursday, 5 August 2021 at 2:30:41 pm Australian Eastern Standard Time"
stringx::strftime(Sys.time(), f, locale="de_DE")
## [1] "Donnerstag, 29. Juli 2021"
## [2] "2021-07-29"
## [3] "heute"
## [4] "Donnerstag, 29. Juli 2021 um 10:44:24 Ostaustralische Normalzeit"
## [1] "Donnerstag, 5. August 2021"
## [2] "2021-08-05"
## [3] "heute"
## [4] "Donnerstag, 5. August 2021 um 14:30:41 Ostaustralische Normalzeit"
stringx::strftime(Sys.time(), "date_short", locale="en_IL@calendar=hebrew")
## [1] "20 Av 5781"
## [1] "27 Av 5781"
stringx::strptime("1970-01-01 00:00:00", "%Y-%m-%d %H:%M:%S", tz="GMT")
## [1] "1970-01-01 00:00:00 GMT"
stringx::strptime("14 Nisan 5703", "date_short", locale="en_IL@calendar=hebrew")
## [1] "1943-04-19 10:44:24 AEST"
## [1] "1943-04-19 14:30:41 AEST"
```
2 changes: 1 addition & 1 deletion docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.1.2',
VERSION: '0.1.3',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
4 changes: 2 additions & 2 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@


<div class="version">
0.1.2
0.1.3
</div>


Expand Down Expand Up @@ -206,7 +206,7 @@ <h1 id="index">Index</h1>
<p>
&#169; Copyright 2021, Marek Gagolewski.
<span class="lastupdated">
Last updated on 2021-07-29T10:44:28+1000.
Last updated on 2021-08-05T14:30:46+1000.
</span>

</p>
Expand Down
10 changes: 5 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@


<div class="version">
0.1.2
0.1.3
</div>


Expand Down Expand Up @@ -222,8 +222,8 @@ <h1>stringx: Drop-in replacements for base R string functions powered by stringi
processing to bioinformatics. It also gives powerful
means to represent or transfer unstructured data.</p>
<p><strong>stringx brings R string processing abilities into the 21st century.</strong>
It replaces functions like <cite>paste</cite>, <cite>grep</cite>, <cite>tolower</cite>, <cite>strftime</cite>,
and <cite>sprintf</cite> with ones that:</p>
It replaces functions like <code class="docutils literal notranslate"><span class="pre">paste()</span></code>, <code class="docutils literal notranslate"><span class="pre">grep()</span></code>, <code class="docutils literal notranslate"><span class="pre">tolower()</span></code>,
<code class="docutils literal notranslate"><span class="pre">strftime()</span></code>, and <code class="docutils literal notranslate"><span class="pre">sprintf()</span></code> with ones that:</p>
<ul class="simple">
<li><p>support a wide range of languages and scripts and
fully conform to <a class="reference external" href="https://www.unicode.org/">Unicode</a> standards
Expand All @@ -235,7 +235,7 @@ <h1>stringx: Drop-in replacements for base R string functions powered by stringi
with other procedures, etc.;
they are all thoroughly documented in this online manual,
happy reading! 🤓),</p></li>
<li><p>are more forward-pipe (<cite>|&gt;</cite> or <cite>magrittr::%&gt;%</cite>) operator-friendly.</p></li>
<li><p>are more forward-pipe (<code class="docutils literal notranslate"><span class="pre">|&gt;</span></code> or <code class="docutils literal notranslate"><span class="pre">magrittr::%&gt;%</span></code>) operator-friendly.</p></li>
</ul>
<p>Also, a few new, useful operations are introduced.</p>
<div class="highlight-r notranslate"><div class="highlight"><pre><span></span><span class="nf">install.packages</span><span class="p">(</span><span class="s">&quot;stringx&quot;</span><span class="p">)</span> <span class="c1"># install from CRAN</span>
Expand Down Expand Up @@ -323,7 +323,7 @@ <h1>stringx: Drop-in replacements for base R string functions powered by stringi
<p>
&#169; Copyright 2021, Marek Gagolewski.
<span class="lastupdated">
Last updated on 2021-07-29T10:44:28+1000.
Last updated on 2021-08-05T14:30:46+1000.
</span>

</p>
Expand Down
Loading

0 comments on commit a0c7d03

Please sign in to comment.